1 // Tests the default implementation of callbacks for
2 // -fsanitize-coverage=inline-8bit-counters,pc-table
3 
4 // REQUIRES: has_sancovcc,stable-runtime,linux,x86_64-target-arch
5 
6 // RUN: %clangxx -O0 %s -fsanitize-coverage=inline-8bit-counters,pc-table -o %t
7 // RUN: rm -f %t-counters %t-pcs
8 // RUN: env %tool_options="cov_8bit_counters_out=%t-counters cov_pcs_out=%t-pcs verbosity=1" %run %t 2>&1 | FileCheck %s
9 
10 // Check the file sizes
11 // RUN: wc -c %t-counters | grep "^2 "
12 // RUN: wc -c %t-pcs | grep "^32 "
13 
14 #include <stdio.h>
15 
foo()16 __attribute__((noinline)) void foo() {}
main()17 int main() {
18   foo();
19   foo();
20   fprintf(stderr, "PASS\n");
21   // CHECK: PASS
22   // CHECK: cov_8bit_counters_out: written {{.*}} bytes to {{.*}}-counter
23   // CHECK: cov_pcs_out: written {{.*}} bytes to {{.*}}-pcs
24 }
25