xref: /minix3/external/bsd/llvm/dist/clang/test/CoverageMapping/header.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name tu1.cpp %s > %tmapping
2*0a6a1f1dSLionel Sambuc // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-FUNC
3*0a6a1f1dSLionel Sambuc // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-STATIC-FUNC
4*0a6a1f1dSLionel Sambuc // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-STATIC-FUNC2
5*0a6a1f1dSLionel Sambuc 
6*0a6a1f1dSLionel Sambuc #include "Inputs/header1.h"
7*0a6a1f1dSLionel Sambuc 
main()8*0a6a1f1dSLionel Sambuc int main() {
9*0a6a1f1dSLionel Sambuc   func(1);
10*0a6a1f1dSLionel Sambuc   static_func(2);
11*0a6a1f1dSLionel Sambuc }
12*0a6a1f1dSLionel Sambuc 
13*0a6a1f1dSLionel Sambuc // CHECK-FUNC: func
14*0a6a1f1dSLionel Sambuc // CHECK-FUNC: File 0, 4:25 -> 11:2 = #0 (HasCodeBefore = 0)
15*0a6a1f1dSLionel Sambuc // CHECK-FUNC: File 0, 6:15 -> 8:4 = #1 (HasCodeBefore = 0)
16*0a6a1f1dSLionel Sambuc // CHECK-FUNC: File 0, 8:10 -> 10:4 = (#0 - #1) (HasCodeBefore = 0)
17*0a6a1f1dSLionel Sambuc // CHECK-FUNC: Expansion,File 1, 6:10 -> 6:28 = #0 (HasCodeBefore = 0, Expanded file = 0)
18*0a6a1f1dSLionel Sambuc 
19*0a6a1f1dSLionel Sambuc // CHECK-STATIC-FUNC: static_func
20*0a6a1f1dSLionel Sambuc // CHECK-STATIC-FUNC: File 0, 12:32 -> 20:2 = #0 (HasCodeBefore = 0)
21*0a6a1f1dSLionel Sambuc // CHECK-STATIC-FUNC: File 0, 14:15 -> 16:4 = #1 (HasCodeBefore = 0)
22*0a6a1f1dSLionel Sambuc // CHECK-STATIC-FUNC: File 0, 16:10 -> 18:4 = (#0 - #1) (HasCodeBefore = 0)
23*0a6a1f1dSLionel Sambuc // CHECK-STATIC-FUNC: Expansion,File 1, 6:10 -> 6:28 = #0 (HasCodeBefore = 0, Expanded file = 0)
24*0a6a1f1dSLionel Sambuc 
25*0a6a1f1dSLionel Sambuc // CHECK-STATIC-FUNC2: static_func2
26*0a6a1f1dSLionel Sambuc // CHECK-STATIC-FUNC2: File 0, 21:33 -> 29:2 = 0 (HasCodeBefore = 0)
27*0a6a1f1dSLionel Sambuc // CHECK-STATIC-FUNC2: Expansion,File 1, 6:10 -> 6:28 = 0 (HasCodeBefore = 0, Expanded file = 0)
28