Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion compiler-rt/lib/rtsan/rtsan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ static auto OnViolationAction(DiagnosticsInfo info) {
handle.inc_use_count_unsafe();
}

if (flags().halt_on_error)
if (flags().halt_on_error) {
if (flags().print_stats_on_exit)
PrintStatisticsSummary();
Die();
}
};
}

Expand Down
7 changes: 6 additions & 1 deletion compiler-rt/test/rtsan/exit_stats.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %clangxx -fsanitize=realtime %s -o %t
// RUN: env RTSAN_OPTIONS="halt_on_error=false,print_stats_on_exit=true" %run %t 2>&1 | FileCheck %s
// RUN: %env_rtsan_opts="halt_on_error=false,print_stats_on_exit=true" %run %t 2>&1 | FileCheck %s
// RUN: %env_rtsan_opts="halt_on_error=true,print_stats_on_exit=true" not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-HALT

// UNSUPPORTED: ios

Expand All @@ -22,3 +23,7 @@ int main() {
// CHECK: RealtimeSanitizer exit stats:
// CHECK-NEXT: Total error count: 10
// CHECK-NEXT: Unique error count: 1

// CHECK-HALT: RealtimeSanitizer exit stats:
// CHECK-HALT-NEXT: Total error count: 1
// CHECK-HALT-NEXT: Unique error count: 1
Loading