Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / sanitizer_coverage_inline8bit_counter_default_impl.cpp
blob1ac04b53491e14211b988b69f5632fbcbc2d7adf
1 // Tests the default implementation of callbacks for
2 // -fsanitize-coverage=inline-8bit-counters,pc-table
4 // REQUIRES: has_sancovcc,stable-runtime,linux,x86_64-target-arch
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
10 // Check the file sizes
11 // RUN: wc -c %t-counters | grep "^2 "
12 // RUN: wc -c %t-pcs | grep "^32 "
14 #include <stdio.h>
16 __attribute__((noinline)) void foo() {}
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