aboutsummaryrefslogtreecommitdiff
path: root/test/CoverageMapping/macroparams2.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CoverageMapping/macroparams2.c')
-rw-r--r--test/CoverageMapping/macroparams2.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/test/CoverageMapping/macroparams2.c b/test/CoverageMapping/macroparams2.c
index 0445370b0e13..fc156de75582 100644
--- a/test/CoverageMapping/macroparams2.c
+++ b/test/CoverageMapping/macroparams2.c
@@ -1,20 +1,21 @@
// RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macroparams2.c %s | FileCheck %s
-// A test case for when the first macro parameter is used after the second
-// macro parameter.
+#define MACRO(REFS, CALLS) (4 * (CALLS) < (REFS))
struct S {
int i, j;
};
-#define MACRO(REFS, CALLS) (4 * (CALLS) < (REFS))
-
-int main() { // CHECK: File 0, [[@LINE]]:12 -> [[@LINE+7]]:2 = #0 (HasCodeBefore = 0)
- struct S arr[32] = { 0 }; // CHECK-NEXT: Expansion,File 0, [[@LINE+2]]:7 -> [[@LINE+2]]:12 = #0 (HasCodeBefore = 0, Expanded file = 1)
- int n = 0; // CHECK-NEXT: File 0, [[@LINE+1]]:13 -> [[@LINE+1]]:21 = #0 (HasCodeBefore = 0)
- if (MACRO(arr[n].j, arr[n].i)) { // CHECK-NEXT: File 0, [[@LINE]]:23 -> [[@LINE]]:31 = #0 (HasCodeBefore = 0)
- n = 1; // CHECK-NEXT: File 0, [[@LINE-1]]:34 -> [[@LINE+1]]:4 = #1 (HasCodeBefore = 0)
+// CHECK: File 0, [[@LINE+1]]:12 -> [[@LINE+10]]:2 = #0
+int main() {
+ struct S arr[32] = { 0 };
+ int n = 0;
+ // CHECK-NEXT: Expansion,File 0, [[@LINE+2]]:7 -> [[@LINE+2]]:12 = #0
+ // CHECK-NEXT: File 0, [[@LINE+1]]:34 -> [[@LINE+3]]:4 = #1
+ if (MACRO(arr[n].j, arr[n].i)) {
+ n = 1;
}
return n;
-} // CHECK-NEXT: File 1, [[@LINE-9]]:29 -> [[@LINE-9]]:51 = #0 (HasCodeBefore = 0
+}
+// CHECK: File 1, 3:29 -> 3:51 = #0