xref: /llvm-project/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cpp (revision 14de6e29b1315e9abe61d71e3e13f75bff80e1be)
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 
foo(int * a)13 void foo(int *a) {
14   if (a)
15     *a = 1;
16 }
17