1// Tests -fsanitize-coverage=no-prune
2
3// REQUIRES: has_sancovcc,stable-runtime
4// UNSUPPORTED: i386-darwin
5// XFAIL: ubsan
6// XFAIL: android && asan
7
8// 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
9// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc,bb 2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 2
10// 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
11// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc 2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 3
12
13void foo(int *a) {
14 if (a)
15 *a = 1;
16}
17

source code of compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cpp