[compiler-rt] r289835 - [sanitizers] dont dump coverage if not asked to
Mike Aizatsky via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 15 09:30:58 PST 2016
Author: aizatsky
Date: Thu Dec 15 11:30:58 2016
New Revision: 289835
URL: http://llvm.org/viewvc/llvm-project?rev=289835&view=rev
Log:
[sanitizers] dont dump coverage if not asked to
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc
compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc?rev=289835&r1=289834&r2=289835&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc Thu Dec 15 11:30:58 2016
@@ -128,7 +128,7 @@ class TracePcGuardController {
}
void Dump() {
- if (!initialized) return;
+ if (!initialized || !common_flags()->coverage) return;
__sanitizer_dump_coverage(pc_vector.data(), pc_vector.size());
}
Modified: compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc?rev=289835&r1=289834&r2=289835&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc Thu Dec 15 11:30:58 2016
@@ -11,8 +11,12 @@
// RUN: %env_tool_opts=coverage=1 %t 2>&1 | FileCheck %s
// RUN: %sancovcc -covered-functions -strip_path_prefix=TestCases/ *.sancov %t 2>&1 | \
// RUN: FileCheck --check-prefix=CHECK-SANCOV %s
+// RUN: %env_tool_opts=coverage=0 %t 2>&1 | FileCheck --check-prefix=CHECK-NOCOV %s
// RUN: rm -rf $DIR
-
+// Make some room to stabilize line numbers
+//
+//
+//
#include <stdio.h>
int foo() {
@@ -31,5 +35,7 @@ int main() {
// CHECK-NEXT: foo
// CHECK-NEXT: SanitizerCoverage: ./sanitizer_coverage_trace_pc_guard.{{.*}}.sancov 2 PCs written
//
-// CHECK-SANCOV: sanitizer_coverage_trace_pc_guard.cc:18 foo
-// CHECK-SANCOV-NEXT: sanitizer_coverage_trace_pc_guard.cc:23 main
+// CHECK-SANCOV: sanitizer_coverage_trace_pc_guard.cc:22 foo
+// CHECK-SANCOV-NEXT: sanitizer_coverage_trace_pc_guard.cc:27 main
+//
+// CHECK-NOCOV-NOT: SanitizerCoverage
More information about the llvm-commits
mailing list