1 // RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macroception.c %s | FileCheck %s
2 
3 #define M2 {
4 #define M1 M2
5 #define M22 }
6 #define M11 M22
7 
8 // CHECK-LABEL: main:
9 // CHECK-NEXT: Expansion,File 0, [[@LINE+2]]:12 -> [[@LINE+2]]:14 = #0
10 // CHECK-NEXT: File 0, [[@LINE+1]]:14 -> [[@LINE+3]]:2 = #0
11 int main() M1
12   return 0;
13 }
14 // CHECK-NEXT: File 1, 4:12 -> 4:14 = #0
15 // CHECK-NEXT: Expansion,File 1, 4:12 -> 4:14 = #0
16 // CHECK-NEXT: File 2, 3:12 -> 3:13 = #0
17 
18 // CHECK-LABEL: func2:
19 // CHECK-NEXT: File 0, [[@LINE+2]]:14 -> [[@LINE+4]]:4 = #0
20 // CHECK-NEXT: Expansion,File 0, [[@LINE+3]]:1 -> [[@LINE+3]]:4 = #0
21 void func2() {
22   int x = 0;
23 M11
24 // CHECK-NEXT: File 1, 6:13 -> 6:16 = #0
25 // CHECK-NEXT: Expansion,File 1, 6:13 -> 6:16 = #0
26 // CHECK-NEXT: File 2, 5:13 -> 5:14 = #0
27 
28 // CHECK-LABEL: func3:
29 // CHECK-NEXT: Expansion,File 0, [[@LINE+3]]:14 -> [[@LINE+3]]:16 = #0
30 // CHECK-NEXT: File 0, [[@LINE+2]]:16 -> [[@LINE+4]]:4 = #0
31 // CHECK-NEXT: Expansion,File 0, [[@LINE+3]]:1 -> [[@LINE+3]]:4 = #0
32 void func3() M1
33   int x = 0;
34 M11
35 // CHECK-NEXT: File 1, 4:12 -> 4:14 = #0
36 // CHECK-NEXT: Expansion,File 1, 4:12 -> 4:14 = #0
37 // CHECK-NEXT: File 2, 6:13 -> 6:16 = #0
38 // CHECK-NEXT: Expansion,File 2, 6:13 -> 6:16 = #0
39 // CHECK-NEXT: File 3, 3:12 -> 3:13 = #0
40 // CHECK-NEXT: File 4, 5:13 -> 5:14 = #0
41 
42 // CHECK-LABEL: func4:
43 // CHECK-NEXT: Expansion,File 0, [[@LINE+3]]:14 -> [[@LINE+3]]:16 = #0
44 // CHECK-NEXT: File 0, [[@LINE+2]]:16 -> [[@LINE+2]]:20 = #0
45 // CHECK-NEXT: Expansion,File 0, [[@LINE+1]]:17 -> [[@LINE+1]]:20 = #0
46 void func4() M1 M11
47 // CHECK-NEXT: File 1, 4:12 -> 4:14 = #0
48 // CHECK-NEXT: Expansion,File 1, 4:12 -> 4:14 = #0
49 // CHECK-NEXT: File 2, 6:13 -> 6:16 = #0
50 // CHECK-NEXT: Expansion,File 2, 6:13 -> 6:16 = #0
51 // CHECK-NEXT: File 3, 3:12 -> 3:13 = #0
52 // CHECK-NEXT: File 4, 5:13 -> 5:14 = #0
53