Clang Project

clang_source_code/test/CoverageMapping/unused_names.c
1// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -main-file-name unused_names.c -o - %s > %t
2// RUN: FileCheck -input-file %t %s
3// RUN: FileCheck -check-prefix=SYSHEADER -input-file %t %s
4
5// CHECK-DAG: @__profc_bar
6// CHECK-DAG: @__llvm_prf_nm = private constant {{.*}}, section "{{.*__llvm_prf_names|\.lprfn\$M}}"
7
8// These are never instantiated, so we shouldn't get counters for them.
9//
10// CHECK-NOT: @__profc_baz
11// CHECK-NOT: @__profc_unused_names.c_qux
12
13// SYSHEADER-NOT: @__profc_foo =
14
15
16#ifdef IS_SYSHEADER
17
18#pragma clang system_header
19inline int foo() { return 0; }
20
21#else
22
23#define IS_SYSHEADER
24#include __FILE__
25
26int bar() { return 0; }
27inline int baz() { return 0; }
28static int qux() { return 42; }
29
30#endif
31