[compiler-rt] r302321 - [sanitizer-coverage] implement -fsanitize-coverage=no-prune, ... instead of a hidden -mllvm flag. compiler-rt part (test only).

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 16:28:47 PDT 2017


Author: kcc
Date: Fri May  5 18:28:47 2017
New Revision: 302321

URL: http://llvm.org/viewvc/llvm-project?rev=302321&view=rev
Log:
[sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a hidden -mllvm flag. compiler-rt part (test only).

Added:
    compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cc

Added: compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cc?rev=302321&view=auto
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cc (added)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cc Fri May  5 18:28:47 2017
@@ -0,0 +1,15 @@
+// Tests -fsanitize-coverage=no-prune
+//
+// REQUIRES: has_sancovcc,stable-runtime
+// UNSUPPORTED: i386-darwin
+// XFAIL: tsan,powerpc64,s390x,mips
+//
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc,bb,no-prune 2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 3
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc,bb          2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 2
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc,no-prune    2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 4
+// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc             2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 3
+
+void foo(int *a) {
+  if (a)
+    *a = 1;
+}




More information about the llvm-commits mailing list