1 // RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -mllvm -system-headers-coverage=true -std=c++11 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm -main-file-name system_macro.cpp -o %t.w_sys.ll %s | FileCheck %s --check-prefixes=CHECK,W_SYS
2 // RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -mllvm -system-headers-coverage=false -std=c++11 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm -main-file-name system_macro.cpp -o %t.wosys.ll %s | FileCheck %s --check-prefixes=CHECK,WOSYS
3 // RUN: FileCheck %s --check-prefixes=LL_CHECK,LL_W_SYS < %t.w_sys.ll
4 // RUN: FileCheck %s --check-prefixes=LL_CHECK,LL_WOSYS < %t.wosys.ll
6 // LL_CHECK: @__covrec_
7 // LL_W_SYS: [[PROFC:@.*__profc_.*SysTmpl.*]] =
8 // LL_W_SYS: @{{.*}}__profd_{{.*}}SysTmpl{{.*}} =
9 // LL_WOSYS-NOT: SysTmpl
11 // LL_CHECK: @llvm.used =
15 #pragma clang system_header
16 #define Func(x) if (x) {}
19 // LL_CHECK: define {{.*}} i1 @{{.*}}SysTmpl
20 template <bool f
> bool SysTmpl() { return f
; }
21 // Check SysTmpl() is instrumented or not.
22 // LL_W_SYS: load i64, ptr [[PROFC]],
23 // LL_WOSYS-NOT: load i64, ptr @__profc_
30 // CHECK-LABEL: doSomething
31 void doSomething(int x
) { // CHECK: File 0, [[@LINE]]:25 -> {{[0-9:]+}} = #0
32 // WOSYS-NOT: Expansion,
33 // W_SYS: Expansion,File 0, [[@LINE+1]]:3 -> [[@LINE+1]]:7
35 // CHECK: Gap,File 0, [[@LINE+1]]:10
37 // WOSYS-NOT: Expansion,
38 // W_SYS: Expansion,File 0, [[@LINE+1]]:3 -> [[@LINE+1]]:11
39 SomeType
*f
; // CHECK: File 0, [[@LINE]]:11 -> {{[0-9:]+}} = 0
43 int main() { // CHECK: File 0, [[@LINE]]:12 -> [[@LINE+2]]:2 = #0
44 Func([] { return SysTmpl
<true>(); }());