summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cpp
blob: 9604da222f8e9c3fb8d9c2d6d96abc6645e0e572 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Tests -fsanitize-coverage=no-prune

// REQUIRES: has_sancovcc,stable-runtime
// UNSUPPORTED: i386-darwin
// XFAIL: ubsan,tsan
// XFAIL: android && asan

// 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;
}
OpenPOWER on IntegriCloud