Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Preprocessor / line-directive-output.c
blob5e3dec155cad40c4a4b8b2cdf8516fa02c8cee2f
1 // RUN: %clang_cc1 -E %s 2>&1 | FileCheck %s -strict-whitespace
2 // RUN: %clang_cc1 -E -fminimize-whitespace %s 2>&1 | FileCheck %s -strict-whitespace
3 // PR6101
4 int a;
5 // CHECK: # 1 "{{.*}}line-directive-output.c"
7 // Check that we do not emit an enter marker for the main file.
8 // CHECK-NOT: # 1 "{{.*}}line-directive-output.c" 1
10 // CHECK: int a;
12 // CHECK-NEXT: # 50 "{{.*}}line-directive-output.c"
13 // CHECK-NEXT: int b;
14 #line 50
15 int b;
17 // CHECK: # 13 "{{.*}}line-directive-output.c"
18 // CHECK-NEXT: int c;
19 # 13
20 int c;
23 // CHECK-NEXT: # 1 "A.c"
24 #line 1 "A.c"
25 // CHECK-NEXT: # 2 "A.c"
26 #line 2
28 // CHECK-NEXT: # 1 "B.c"
29 #line 1 "B.c"
31 // CHECK-NEXT: # 1000 "A.c"
32 #line 1000 "A.c"
34 int y;
42 // CHECK: # 1010 "A.c"
43 int z;
45 extern int x;
47 # 3 "temp2.h" 1
48 extern int y;
50 # 7 "A.c" 2
51 extern int z;
65 // CHECK: # 25 "A.c"
68 // CHECK: # 50 "C.c" 1
69 # 50 "C.c" 1
72 // CHECK-NEXT: # 2000 "A.c" 2
73 # 2000 "A.c" 2
74 # 42 "A.c"
75 # 44 "A.c"
76 # 49 "A.c"
78 // CHECK: # 50 "a\n.c"
79 # 50 "a\012.c"
81 # 1 "system.h" 3
82 # 2
83 void sys_foo(void);
84 // CHECK: # 1 "system.h" 3
85 // CHECK-NEXT: # 2 "system.h" 3
86 // CHECK-NEXT: void sys_foo(void);