xref: /minix3/external/bsd/llvm/dist/clang/test/Preprocessor/line-directive-output.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -E %s 2>&1 | FileCheck %s -strict-whitespace
2*f4a2713aSLionel Sambuc // PR6101
3*f4a2713aSLionel Sambuc int a;
4*f4a2713aSLionel Sambuc // CHECK: # 1 "{{.*}}line-directive-output.c"
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc // Check that we do not emit an enter marker for the main file.
7*f4a2713aSLionel Sambuc // CHECK-NOT: # 1 "{{.*}}line-directive-output.c" 1
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc // CHECK: int a;
10*f4a2713aSLionel Sambuc 
11*f4a2713aSLionel Sambuc // CHECK-NEXT: # 50 "{{.*}}line-directive-output.c"
12*f4a2713aSLionel Sambuc // CHECK-NEXT: int b;
13*f4a2713aSLionel Sambuc #line 50
14*f4a2713aSLionel Sambuc int b;
15*f4a2713aSLionel Sambuc 
16*f4a2713aSLionel Sambuc // CHECK: # 13 "{{.*}}line-directive-output.c"
17*f4a2713aSLionel Sambuc // CHECK-NEXT: int c;
18*f4a2713aSLionel Sambuc # 13
19*f4a2713aSLionel Sambuc int c;
20*f4a2713aSLionel Sambuc 
21*f4a2713aSLionel Sambuc 
22*f4a2713aSLionel Sambuc // CHECK-NEXT: # 1 "A.c"
23*f4a2713aSLionel Sambuc #line 1 "A.c"
24*f4a2713aSLionel Sambuc // CHECK-NEXT: # 2 "A.c"
25*f4a2713aSLionel Sambuc #line 2
26*f4a2713aSLionel Sambuc 
27*f4a2713aSLionel Sambuc // CHECK-NEXT: # 1 "B.c"
28*f4a2713aSLionel Sambuc #line 1 "B.c"
29*f4a2713aSLionel Sambuc 
30*f4a2713aSLionel Sambuc // CHECK-NEXT: # 1000 "A.c"
31*f4a2713aSLionel Sambuc #line 1000 "A.c"
32*f4a2713aSLionel Sambuc 
33*f4a2713aSLionel Sambuc int y;
34*f4a2713aSLionel Sambuc 
35*f4a2713aSLionel Sambuc 
36*f4a2713aSLionel Sambuc 
37*f4a2713aSLionel Sambuc 
38*f4a2713aSLionel Sambuc 
39*f4a2713aSLionel Sambuc 
40*f4a2713aSLionel Sambuc 
41*f4a2713aSLionel Sambuc // CHECK: # 1010 "A.c"
42*f4a2713aSLionel Sambuc int z;
43*f4a2713aSLionel Sambuc 
44*f4a2713aSLionel Sambuc extern int x;
45*f4a2713aSLionel Sambuc 
46*f4a2713aSLionel Sambuc # 3 "temp2.h" 1
47*f4a2713aSLionel Sambuc extern int y;
48*f4a2713aSLionel Sambuc 
49*f4a2713aSLionel Sambuc # 7 "A.c" 2
50*f4a2713aSLionel Sambuc extern int z;
51*f4a2713aSLionel Sambuc 
52*f4a2713aSLionel Sambuc 
53*f4a2713aSLionel Sambuc 
54*f4a2713aSLionel Sambuc 
55*f4a2713aSLionel Sambuc 
56*f4a2713aSLionel Sambuc 
57*f4a2713aSLionel Sambuc 
58*f4a2713aSLionel Sambuc 
59*f4a2713aSLionel Sambuc 
60*f4a2713aSLionel Sambuc 
61*f4a2713aSLionel Sambuc 
62*f4a2713aSLionel Sambuc 
63*f4a2713aSLionel Sambuc 
64*f4a2713aSLionel Sambuc // CHECK: # 25 "A.c"
65*f4a2713aSLionel Sambuc 
66*f4a2713aSLionel Sambuc 
67*f4a2713aSLionel Sambuc // CHECK: # 50 "C.c" 1
68*f4a2713aSLionel Sambuc # 50 "C.c" 1
69*f4a2713aSLionel Sambuc 
70*f4a2713aSLionel Sambuc 
71*f4a2713aSLionel Sambuc // CHECK-NEXT: # 2000 "A.c" 2
72*f4a2713aSLionel Sambuc # 2000 "A.c" 2
73*f4a2713aSLionel Sambuc # 42 "A.c"
74*f4a2713aSLionel Sambuc # 44 "A.c"
75*f4a2713aSLionel Sambuc # 49 "A.c"
76*f4a2713aSLionel Sambuc 
77*f4a2713aSLionel Sambuc // CHECK: # 50 "a\n.c"
78*f4a2713aSLionel Sambuc # 50 "a\012.c"
79