[compiler-rt] r272718 - Compiler-rt test for sanitizer coverage w/o sanitizers.
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 14 14:34:00 PDT 2016
Author: eugenis
Date: Tue Jun 14 16:33:59 2016
New Revision: 272718
URL: http://llvm.org/viewvc/llvm-project?rev=272718&view=rev
Log:
Compiler-rt test for sanitizer coverage w/o sanitizers.
Added:
compiler-rt/trunk/test/ubsan/TestCases/coverage.cc
Added: compiler-rt/trunk/test/ubsan/TestCases/coverage.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/coverage.cc?rev=272718&view=auto
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/coverage.cc (added)
+++ compiler-rt/trunk/test/ubsan/TestCases/coverage.cc Tue Jun 14 16:33:59 2016
@@ -0,0 +1,17 @@
+// RUN: %clangxx -O1 -fsanitize-coverage=func %s -o %t
+// RUN: %env_ubsan_opts=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
+// RUN: %clangxx -O1 -fsanitize-coverage=bb %s -o %t
+// RUN: %env_ubsan_opts=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2
+//
+// UNSUPPORTED: ubsan-tsan
+// UNSUPPORTED: android
+volatile int sink;
+int main(int argc, char **argv) {
+ if (argc == 0)
+ sink = 0;
+}
+
+// CHECK1: CovDump: bitset of 1 bits written for '{{.*}}', 1 bits are set
+// CHECK1: 1 PCs written
+// CHECK2: CovDump: bitset of 2 bits written for '{{.*}}', 1 bits are set
+// CHECK2: 1 PCs written
More information about the llvm-commits
mailing list