[SanitizerCoverage] Upgrade lit tests to new -fsanitize-coverage= flags.

llvm-svn: 236796
This commit is contained in:
Alexey Samsonov 2015-05-07 23:20:47 +00:00
parent 54966ebc54
commit 8e5e8fb2f3
22 changed files with 58 additions and 58 deletions

View File

@ -1,8 +1,8 @@
// Test for direct coverage writing with dlopen. // Test for direct coverage writing with dlopen.
// Test normal exit, coverage level 1. // Test normal exit, coverage level 1.
// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %T/libcoverage_android_test_1.so -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=1 -DSO_DIR=\"%device\" %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=func -DSO_DIR=\"%device\" %s -o %t
// RUN: adb shell rm -rf %device/coverage-android // RUN: adb shell rm -rf %device/coverage-android
// RUN: rm -rf %T/coverage-android // RUN: rm -rf %T/coverage-android
@ -18,8 +18,8 @@
// Test sudden death, coverage level 1. // Test sudden death, coverage level 1.
// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED -DKILL %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED -DKILL %s -shared -o %T/libcoverage_android_test_1.so -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=1 -DSO_DIR=\"%device\" %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=func -DSO_DIR=\"%device\" %s -o %t
// RUN: adb shell rm -rf %device/coverage-android-kill // RUN: adb shell rm -rf %device/coverage-android-kill
// RUN: rm -rf %T/coverage-android-kill // RUN: rm -rf %T/coverage-android-kill
@ -35,8 +35,8 @@
// Test normal exit, coverage level 2. // Test normal exit, coverage level 2.
// RUN: %clangxx_asan -fsanitize-coverage=2 -DSHARED %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=bb -DSHARED %s -shared -o %T/libcoverage_android_test_1.so -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=2 -DSO_DIR=\"%device\" %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=bb -DSO_DIR=\"%device\" %s -o %t
// RUN: adb shell rm -rf %device/coverage-android // RUN: adb shell rm -rf %device/coverage-android
// RUN: rm -rf %T/coverage-android // RUN: rm -rf %T/coverage-android
@ -52,8 +52,8 @@
// Test sudden death, coverage level 2. // Test sudden death, coverage level 2.
// RUN: %clangxx_asan -fsanitize-coverage=2 -DSHARED -DKILL %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=bb -DSHARED -DKILL %s -shared -o %T/libcoverage_android_test_1.so -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=2 -DSO_DIR=\"%device\" %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=bb -DSO_DIR=\"%device\" %s -o %t
// RUN: adb shell rm -rf %device/coverage-android-kill // RUN: adb shell rm -rf %device/coverage-android-kill
// RUN: rm -rf %T/coverage-android-kill // RUN: rm -rf %T/coverage-android-kill
@ -69,8 +69,8 @@
// Test normal exit, coverage level 3. // Test normal exit, coverage level 3.
// RUN: %clangxx_asan -fsanitize-coverage=3 -DSHARED %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=edge -DSHARED %s -shared -o %T/libcoverage_android_test_1.so -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=3 -DSO_DIR=\"%device\" %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=edge -DSO_DIR=\"%device\" %s -o %t
// RUN: adb shell rm -rf %device/coverage-android // RUN: adb shell rm -rf %device/coverage-android
// RUN: rm -rf %T/coverage-android // RUN: rm -rf %T/coverage-android
@ -86,8 +86,8 @@
// Test sudden death, coverage level 3. // Test sudden death, coverage level 3.
// RUN: %clangxx_asan -fsanitize-coverage=3 -DSHARED -DKILL %s -shared -o %T/libcoverage_android_test_1.so -fPIC // RUN: %clangxx_asan -fsanitize-coverage=edge -DSHARED -DKILL %s -shared -o %T/libcoverage_android_test_1.so -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=3 -DSO_DIR=\"%device\" %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=edge -DSO_DIR=\"%device\" %s -o %t
// RUN: adb shell rm -rf %device/coverage-android-kill // RUN: adb shell rm -rf %device/coverage-android-kill
// RUN: rm -rf %T/coverage-android-kill // RUN: rm -rf %T/coverage-android-kill

View File

@ -5,7 +5,7 @@
// First case: coverage from executable. main() is called on every code path; // First case: coverage from executable. main() is called on every code path;
// other than that, the foo and bar code paths are complementary in terms of // other than that, the foo and bar code paths are complementary in terms of
// PCs covered. // PCs covered.
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t -DFOOBAR -DMAIN // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t -DFOOBAR -DMAIN
// RUN: rm -rf %T/coverage-missing // RUN: rm -rf %T/coverage-missing
// RUN: mkdir -p %T/coverage-missing // RUN: mkdir -p %T/coverage-missing
// RUN: cd %T/coverage-missing // RUN: cd %T/coverage-missing
@ -27,8 +27,8 @@
// Second case: coverage from DSO. Strictly complementary code paths. // Second case: coverage from DSO. Strictly complementary code paths.
// cd %T // cd %T
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %dynamiclib -DFOOBAR -shared -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %dynamiclib -DFOOBAR -shared -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=1 %s %dynamiclib -o %t -DMAIN // RUN: %clangxx_asan -fsanitize-coverage=func %s %dynamiclib -o %t -DMAIN
// RUN: LIBNAME=`basename %dynamiclib` // RUN: LIBNAME=`basename %dynamiclib`
// RUN: rm -rf %T/coverage-missing // RUN: rm -rf %T/coverage-missing
// RUN: mkdir -p %T/coverage-missing // RUN: mkdir -p %T/coverage-missing

View File

@ -1,8 +1,8 @@
// Test for direct coverage writing enabled at activation time. // Test for direct coverage writing enabled at activation time.
// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib -fPIC
// RUN: %clangxx -c -DSO_DIR=\"%T\" %s -o %t.o // RUN: %clangxx -c -DSO_DIR=\"%T\" %s -o %t.o
// RUN: %clangxx_asan -fsanitize-coverage=1 %t.o %libdl -o %t // RUN: %clangxx_asan -fsanitize-coverage=func %t.o %libdl -o %t
// RUN: rm -rf %T/coverage-direct-activation // RUN: rm -rf %T/coverage-direct-activation

View File

@ -2,8 +2,8 @@
// Current implementation maps output file in chunks of 64K. This test overflows // Current implementation maps output file in chunks of 64K. This test overflows
// 1 chunk. // 1 chunk.
// RUN: %clangxx_asan -fsanitize-coverage=1 -O0 -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -O0 -DSHARED %s -shared -o %dynamiclib -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=1 -O0 %s %libdl -o %t // RUN: %clangxx_asan -fsanitize-coverage=func -O0 %s %libdl -o %t
// RUN: rm -rf %T/coverage-direct-large // RUN: rm -rf %T/coverage-direct-large

View File

@ -1,7 +1,7 @@
// Test for direct coverage writing with dlopen at coverage level 1 to 3. // Test for direct coverage writing with dlopen at coverage level 1 to 3.
// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=1 %s %libdl -o %t // RUN: %clangxx_asan -fsanitize-coverage=func %s %libdl -o %t
// RUN: rm -rf %T/coverage-direct // RUN: rm -rf %T/coverage-direct
@ -19,8 +19,8 @@
// RUN: diff -u coverage-direct/normal/out.txt coverage-direct/direct/out.txt // RUN: diff -u coverage-direct/normal/out.txt coverage-direct/direct/out.txt
// RUN: %clangxx_asan -fsanitize-coverage=2 -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx_asan -fsanitize-coverage=bb -DSHARED %s -shared -o %dynamiclib -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=2 -DSO_DIR=\"%T\" %s %libdl -o %t // RUN: %clangxx_asan -fsanitize-coverage=bb -DSO_DIR=\"%T\" %s %libdl -o %t
// RUN: rm -rf %T/coverage-direct // RUN: rm -rf %T/coverage-direct
@ -38,8 +38,8 @@
// RUN: diff -u coverage-direct/normal/out.txt coverage-direct/direct/out.txt // RUN: diff -u coverage-direct/normal/out.txt coverage-direct/direct/out.txt
// RUN: %clangxx_asan -fsanitize-coverage=3 -DSHARED %s -shared -o %dynamiclib -fPIC // RUN: %clangxx_asan -fsanitize-coverage=edge -DSHARED %s -shared -o %dynamiclib -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=3 -DSO_DIR=\"%T\" %s %libdl -o %t // RUN: %clangxx_asan -fsanitize-coverage=edge -DSO_DIR=\"%T\" %s %libdl -o %t
// RUN: rm -rf %T/coverage-direct // RUN: rm -rf %T/coverage-direct

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
// RUN: rm -rf %T/coverage-fork-direct // RUN: rm -rf %T/coverage-fork-direct
// RUN: mkdir -p %T/coverage-fork-direct && cd %T/coverage-fork-direct // RUN: mkdir -p %T/coverage-fork-direct && cd %T/coverage-fork-direct
// RUN: (ASAN_OPTIONS=coverage=1:coverage_direct=1:verbosity=1 %run %t; \ // RUN: (ASAN_OPTIONS=coverage=1:coverage_direct=1:verbosity=1 %run %t; \

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
// RUN: export ASAN_OPTIONS=coverage=1:coverage_direct=0:verbosity=1 // RUN: export ASAN_OPTIONS=coverage=1:coverage_direct=0:verbosity=1
// RUN: rm -rf %T/coverage-fork // RUN: rm -rf %T/coverage-fork
// RUN: mkdir -p %T/coverage-fork && cd %T/coverage-fork // RUN: mkdir -p %T/coverage-fork && cd %T/coverage-fork

View File

@ -1,8 +1,8 @@
// Check that unloading a module doesn't break coverage dumping for remaining // Check that unloading a module doesn't break coverage dumping for remaining
// modules. // modules.
// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %dynamiclib1 -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib1 -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %dynamiclib2 -fPIC // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib2 -fPIC
// RUN: %clangxx_asan -fsanitize-coverage=1 %s %libdl -o %t // RUN: %clangxx_asan -fsanitize-coverage=func %s %libdl -o %t
// RUN: export ASAN_OPTIONS=coverage=1:verbosity=1 // RUN: export ASAN_OPTIONS=coverage=1:verbosity=1
// RUN: mkdir -p %T/coverage-module-unloaded && cd %T/coverage-module-unloaded // RUN: mkdir -p %T/coverage-module-unloaded && cd %T/coverage-module-unloaded
// RUN: %run %t %dynamiclib1 %dynamiclib2 2>&1 | FileCheck %s // RUN: %run %t %dynamiclib1 %dynamiclib2 2>&1 | FileCheck %s

View File

@ -1,5 +1,5 @@
// RUN: %clangxx_asan -fsanitize-coverage=2 -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so // RUN: %clangxx_asan -fsanitize-coverage=bb -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t %ld_flags_rpath_exe // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t %ld_flags_rpath_exe
// RUN: export ASAN_OPTIONS=coverage=1:verbosity=1 // RUN: export ASAN_OPTIONS=coverage=1:verbosity=1
// RUN: rm -rf %T/coverage_sandboxing_test // RUN: rm -rf %T/coverage_sandboxing_test
// RUN: mkdir %T/coverage_sandboxing_test && cd %T/coverage_sandboxing_test // RUN: mkdir %T/coverage_sandboxing_test && cd %T/coverage_sandboxing_test

View File

@ -1,5 +1,5 @@
// RUN: %clangxx_asan -fsanitize-coverage=1 -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so // RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so
// RUN: %clangxx_asan -fsanitize-coverage=1 %s %ld_flags_rpath_exe -o %t // RUN: %clangxx_asan -fsanitize-coverage=func %s %ld_flags_rpath_exe -o %t
// RUN: export ASAN_OPTIONS=coverage=1:verbosity=1 // RUN: export ASAN_OPTIONS=coverage=1:verbosity=1
// RUN: rm -rf %T/coverage && mkdir -p %T/coverage && cd %T/coverage // RUN: rm -rf %T/coverage && mkdir -p %T/coverage && cd %T/coverage
// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-main // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-main

View File

@ -1,6 +1,6 @@
// RUN: rm -rf %T/coverage-basic // RUN: rm -rf %T/coverage-basic
// RUN: mkdir %T/coverage-basic && cd %T/coverage-basic // RUN: mkdir %T/coverage-basic && cd %T/coverage-basic
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o test.exe // RUN: %clangxx_asan -fsanitize-coverage=func %s -o test.exe
// RUN: env ASAN_OPTIONS=coverage=1 %run ./test.exe // RUN: env ASAN_OPTIONS=coverage=1 %run ./test.exe
// //
// RUN: %sancov print *.sancov | FileCheck %s // RUN: %sancov print *.sancov | FileCheck %s

View File

@ -1,6 +1,6 @@
// Make sure coverage is dumped even if there are reported leaks. // Make sure coverage is dumped even if there are reported leaks.
// //
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
// //
// RUN: rm -rf %T/coverage-and-lsan // RUN: rm -rf %T/coverage-and-lsan
// //

View File

@ -1,6 +1,6 @@
// Test __sanitizer_get_total_unique_coverage for caller-callee coverage // Test __sanitizer_get_total_unique_coverage for caller-callee coverage
// RUN: %clangxx_asan -fsanitize-coverage=4 %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=edge,indirect-calls %s -o %t
// RUN: ASAN_OPTIONS=coverage=1 %run %t // RUN: ASAN_OPTIONS=coverage=1 %run %t
// RUN: rm -f caller-callee*.sancov // RUN: rm -f caller-callee*.sancov
// //

View File

@ -1,7 +1,7 @@
// Test caller-callee coverage with large number of threads // Test caller-callee coverage with large number of threads
// and various numbers of callers and callees. // and various numbers of callers and callees.
// RUN: %clangxx_asan -fsanitize-coverage=4 %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=edge,indirect-calls %s -o %t
// RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 10 1 2>&1 | FileCheck %s --check-prefix=CHECK-10-1 // RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 10 1 2>&1 | FileCheck %s --check-prefix=CHECK-10-1
// RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 9 2 2>&1 | FileCheck %s --check-prefix=CHECK-9-2 // RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 9 2 2>&1 | FileCheck %s --check-prefix=CHECK-9-2
// RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 7 3 2>&1 | FileCheck %s --check-prefix=CHECK-7-3 // RUN: ASAN_OPTIONS=coverage=1:verbosity=1 %run %t 7 3 2>&1 | FileCheck %s --check-prefix=CHECK-7-3

View File

@ -1,6 +1,6 @@
// Test that no data is collected without a runtime flag. // Test that no data is collected without a runtime flag.
// //
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
// //
// RUN: rm -rf %T/coverage-disabled // RUN: rm -rf %T/coverage-disabled
// //

View File

@ -1,14 +1,14 @@
// Test various levels of coverage // Test various levels of coverage
// //
// RUN: %clangxx_asan -O1 -fsanitize-coverage=1 %s -o %t // RUN: %clangxx_asan -O1 -fsanitize-coverage=func %s -o %t
// RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 // RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
// RUN: %clangxx_asan -O1 -fsanitize-coverage=2 %s -o %t // RUN: %clangxx_asan -O1 -fsanitize-coverage=bb %s -o %t
// RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 // RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2
// RUN: %clangxx_asan -O1 -fsanitize-coverage=3 %s -o %t // RUN: %clangxx_asan -O1 -fsanitize-coverage=edge %s -o %t
// RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 // RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3
// RUN: %clangxx_asan -O1 -fsanitize-coverage=3 -mllvm -sanitizer-coverage-block-threshold=0 %s -o %t // RUN: %clangxx_asan -O1 -fsanitize-coverage=edge -mllvm -sanitizer-coverage-block-threshold=0 %s -o %t
// RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 // RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3
// RUN: %clangxx_asan -O1 -fsanitize-coverage=3 -mllvm -sanitizer-coverage-8bit-counters=1 %s -o %t // RUN: %clangxx_asan -O1 -fsanitize-coverage=edge,8bit-counters %s -o %t
// RUN: ASAN_OPTIONS=coverage=1:coverage_counters=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK_COUNTERS // RUN: ASAN_OPTIONS=coverage=1:coverage_counters=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK_COUNTERS
// RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=0:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOBITSET // RUN: ASAN_OPTIONS=coverage=1:coverage_bitset=0:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3_NOBITSET

View File

@ -1,7 +1,7 @@
// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
// XFAIL: android // XFAIL: android
// //
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
// RUN: rm -rf %T/coverage-maybe-open-file // RUN: rm -rf %T/coverage-maybe-open-file
// RUN: mkdir -p %T/coverage-maybe-open-file && cd %T/coverage-maybe-open-file // RUN: mkdir -p %T/coverage-maybe-open-file && cd %T/coverage-maybe-open-file
// RUN: ASAN_OPTIONS=coverage=1 %run %t | FileCheck %s --check-prefix=CHECK-success // RUN: ASAN_OPTIONS=coverage=1 %run %t | FileCheck %s --check-prefix=CHECK-success

View File

@ -2,7 +2,7 @@
// RUN: DIR=%T/coverage-order-pcs // RUN: DIR=%T/coverage-order-pcs
// RUN: rm -rf $DIR // RUN: rm -rf $DIR
// RUN: mkdir $DIR // RUN: mkdir $DIR
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
// RUN: ASAN_OPTIONS=coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t // RUN: ASAN_OPTIONS=coverage_dir=$DIR:coverage=1:coverage_order_pcs=0 %run %t
// RUN: mv $DIR/*sancov $DIR/A // RUN: mv $DIR/*sancov $DIR/A

View File

@ -1,6 +1,6 @@
// Test __sanitizer_reset_coverage(). // Test __sanitizer_reset_coverage().
// RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t // RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
// RUN: ASAN_OPTIONS=coverage=1 %run %t // RUN: ASAN_OPTIONS=coverage=1 %run %t
#include <sanitizer/coverage_interface.h> #include <sanitizer/coverage_interface.h>

View File

@ -1,6 +1,6 @@
// Test -mllvm -sanitizer-coverage-experimental-tracing // Test -fsanitize-coverage=trace-bb
// //
// RUN: %clangxx_asan -O1 -fsanitize-coverage=1 -mllvm -sanitizer-coverage-experimental-tracing %s -o %t // RUN: %clangxx_asan -O1 -fsanitize-coverage=func,trace-bb %s -o %t
// RUN: rm -rf %T/coverage-tracing // RUN: rm -rf %T/coverage-tracing
// RUN: mkdir %T/coverage-tracing // RUN: mkdir %T/coverage-tracing
// RUN: cd %T/coverage-tracing // RUN: cd %T/coverage-tracing

View File

@ -1,13 +1,13 @@
// Test various levels of coverage // Test various levels of coverage
// //
// RUN: %clangxx_msan -DINIT_VAR=1 -O1 -fsanitize-coverage=1 %s -o %t // RUN: %clangxx_msan -DINIT_VAR=1 -O1 -fsanitize-coverage=func %s -o %t
// RUN: mkdir -p %T/coverage-levels // RUN: mkdir -p %T/coverage-levels
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN // RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
// RUN: %clangxx_msan -O1 -fsanitize-coverage=1 %s -o %t // RUN: %clangxx_msan -O1 -fsanitize-coverage=func %s -o %t
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN // RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN
// RUN: %clangxx_msan -O1 -fsanitize-coverage=2 %s -o %t // RUN: %clangxx_msan -O1 -fsanitize-coverage=bb %s -o %t
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN // RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN
// RUN: %clangxx_msan -O1 -fsanitize-coverage=3 %s -o %t // RUN: %clangxx_msan -O1 -fsanitize-coverage=edge %s -o %t
// RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN // RUN: MSAN_OPTIONS=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN
// //
volatile int sink; volatile int sink;

View File

@ -2,16 +2,16 @@
// //
// RUN: mkdir -p %T/coverage-levels // RUN: mkdir -p %T/coverage-levels
// RUN: OPT=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels // RUN: OPT=coverage=1:verbosity=1:coverage_dir=%T/coverage-levels
// RUN: %clangxx -fsanitize=shift -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=1 %s -o %t // RUN: %clangxx -fsanitize=shift -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=func %s -o %t
// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN // RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
// RUN: %clangxx -fsanitize=undefined -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=1 %s -o %t // RUN: %clangxx -fsanitize=undefined -DGOOD_SHIFT=1 -O1 -fsanitize-coverage=func %s -o %t
// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN // RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_NOWARN
// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=1 %s -o %t // RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=func %s -o %t
// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN // RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --check-prefix=CHECK_WARN
// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=2 %s -o %t // RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=bb %s -o %t
// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN // RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --check-prefix=CHECK_WARN
// RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=3 %s -o %t // RUN: %clangxx -fsanitize=shift -O1 -fsanitize-coverage=edge %s -o %t
// RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN // RUN: UBSAN_OPTIONS=$OPT %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN
// Coverage is not yet implemented in TSan. // Coverage is not yet implemented in TSan.