1 // RUN: %clang_cc1 -fprofile-instr-generate -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: main 9 // CHECK-NEXT: File 0, 3:12 -> 3:13 = #0 (HasCodeBefore = 0) 10 // CHECK-NEXT: Expansion,File 1, 4:12 -> 4:14 = #0 (HasCodeBefore = 0, Expanded file = 0) 11 int main() M1 // CHECK-NEXT: Expansion,File 2, [[@LINE]]:12 -> [[@LINE]]:14 = #0 (HasCodeBefore = 0, Expanded file = 1) 12 return 0; // CHECK-NEXT: File 2, [[@LINE]]:3 -> [[@LINE+1]]:2 = #0 (HasCodeBefore = 0) 13 } 14 15 // CHECK-NEXT: func2 16 void func2() { // CHECK-NEXT: File 0, [[@LINE]]:14 -> [[@LINE+1]]:12 = #0 (HasCodeBefore = 0) 17 int x = 0; 18 M11 // CHECK-NEXT: Expansion,File 0, [[@LINE]]:1 -> [[@LINE]]:4 = #0 (HasCodeBefore = 0, Expanded file = 2) 19 // CHECK-NEXT: File 1, 5:13 -> 5:14 = #0 (HasCodeBefore = 0) 20 // CHECK-NEXT: Expansion,File 2, 6:13 -> 6:16 = #0 (HasCodeBefore = 0, Expanded file = 1) 21 22 // CHECK-NEXT: func3 23 // CHECK-NEXT: File 0, 3:12 -> 3:13 = #0 (HasCodeBefore = 0) 24 // CHECK-NEXT: Expansion,File 1, 4:12 -> 4:14 = #0 (HasCodeBefore = 0, Expanded file = 0) 25 void func3() M1 // CHECK-NEXT: Expansion,File 2, [[@LINE]]:14 -> [[@LINE]]:16 = #0 (HasCodeBefore = 0, Expanded file = 1) 26 int x = 0; // CHECK-NEXT: File 2, [[@LINE]]:3 -> [[@LINE]]:12 = #0 (HasCodeBefore = 0) 27 M11 // CHECK-NEXT: Expansion,File 2, [[@LINE]]:1 -> [[@LINE]]:4 = #0 (HasCodeBefore = 0, Expanded file = 4) 28 // CHECK-NEXT: File 3, 5:13 -> 5:14 = #0 (HasCodeBefore = 0) 29 // CHECK-NEXT: Expansion,File 4, 6:13 -> 6:16 = #0 (HasCodeBefore = 0, Expanded file = 3) 30 31 // CHECK-NEXT: func4 32 // CHECK-NEXT: File 0, 3:12 -> 3:13 = #0 (HasCodeBefore = 0) 33 // CHECK-NEXT: Expansion,File 1, 4:12 -> 4:14 = #0 (HasCodeBefore = 0, Expanded file = 0) 34 // CHECK-NEXT: Expansion,File 2, [[@LINE+1]]:14 -> [[@LINE+1]]:16 = #0 (HasCodeBefore = 0, Expanded file = 1) 35 void func4() M1 M11 // CHECK-NEXT: Expansion,File 2, [[@LINE]]:17 -> [[@LINE]]:20 = #0 (HasCodeBefore = 0, Expanded file = 4) 36 // CHECK-NEXT: File 3, 5:13 -> 5:14 = #0 (HasCodeBefore = 0) 37 // CHECK-NEXT: Expansion,File 4, 6:13 -> 6:16 = #0 (HasCodeBefore = 0, Expanded file = 3) 38