annotate clang/test/Index/annotate-tokens-pp.c @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 #define NOTHING(X,Y)
anatofuz
parents:
diff changeset
2 #define STILL_NOTHING NOTHING(honk,warble)
anatofuz
parents:
diff changeset
3 #define BAR baz
anatofuz
parents:
diff changeset
4 #define WIBBLE(X, Y) X##Y
anatofuz
parents:
diff changeset
5 NOTHING(more,junk) float WIBBLE(int, float);
anatofuz
parents:
diff changeset
6 int BAR STILL_NOTHING;
anatofuz
parents:
diff changeset
7 #include "foo.h"
anatofuz
parents:
diff changeset
8 #undef BAR
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 #define REVERSE_MACRO(x,y) y + x
anatofuz
parents:
diff changeset
11 #define TWICE_MACRO(y) y + y
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 void test_macro_args() {
anatofuz
parents:
diff changeset
14 int z = 1;
anatofuz
parents:
diff changeset
15 int t = 2;
anatofuz
parents:
diff changeset
16 int k = REVERSE_MACRO(t,z);
anatofuz
parents:
diff changeset
17 int j = TWICE_MACRO(k + k);
anatofuz
parents:
diff changeset
18 int w = j + j;
anatofuz
parents:
diff changeset
19 }
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 #define fun_with_macro_bodies(x, y) do { if (x) y } while (0)
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 void test() {
anatofuz
parents:
diff changeset
24 int x = 10;
anatofuz
parents:
diff changeset
25 fun_with_macro_bodies(x, { int z = x; ++z; });
anatofuz
parents:
diff changeset
26 }
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 #include "pragma-once.h"
anatofuz
parents:
diff changeset
29 #include "guarded.h"
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 const char *fname = __FILE__;
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 #define SOME_MACRO 3
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35 #ifdef SOME_MACRO
anatofuz
parents:
diff changeset
36 #endif
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 struct A
anatofuz
parents:
diff changeset
39 {
anatofuz
parents:
diff changeset
40 #ifdef SOME_MACRO
anatofuz
parents:
diff changeset
41 int x;
anatofuz
parents:
diff changeset
42 #endif
anatofuz
parents:
diff changeset
43 };
anatofuz
parents:
diff changeset
44
anatofuz
parents:
diff changeset
45 // RUN: c-index-test -test-annotate-tokens=%s:2:1:44:1 -I%S/Inputs %s | FileCheck %s
anatofuz
parents:
diff changeset
46 // RUN: env CINDEXTEST_EDITING=1 c-index-test -test-annotate-tokens=%s:2:1:44:1 -I%S/Inputs %s | FileCheck %s
anatofuz
parents:
diff changeset
47 // CHECK: Punctuation: "#" [2:1 - 2:2] preprocessing directive=
anatofuz
parents:
diff changeset
48 // CHECK: Identifier: "define" [2:2 - 2:8] preprocessing directive=
anatofuz
parents:
diff changeset
49 // CHECK: Identifier: "STILL_NOTHING" [2:9 - 2:22] macro definition=STILL_NOTHING
anatofuz
parents:
diff changeset
50 // CHECK: Identifier: "NOTHING" [2:23 - 2:30] macro expansion=NOTHING:1:9
anatofuz
parents:
diff changeset
51 // CHECK: Punctuation: "(" [2:30 - 2:31] macro definition=STILL_NOTHING
anatofuz
parents:
diff changeset
52 // CHECK: Identifier: "honk" [2:31 - 2:35] macro definition=STILL_NOTHING
anatofuz
parents:
diff changeset
53 // CHECK: Punctuation: "," [2:35 - 2:36] macro definition=STILL_NOTHING
anatofuz
parents:
diff changeset
54 // CHECK: Identifier: "warble" [2:36 - 2:42] macro definition=STILL_NOTHING
anatofuz
parents:
diff changeset
55 // CHECK: Punctuation: ")" [2:42 - 2:43] macro definition=STILL_NOTHING
anatofuz
parents:
diff changeset
56 // CHECK: Punctuation: "#" [3:1 - 3:2] preprocessing directive=
anatofuz
parents:
diff changeset
57 // CHECK: Identifier: "define" [3:2 - 3:8] preprocessing directive=
anatofuz
parents:
diff changeset
58 // CHECK: Identifier: "BAR" [3:9 - 3:12] macro definition=BAR
anatofuz
parents:
diff changeset
59 // CHECK: Identifier: "baz" [3:13 - 3:16] macro definition=BAR
anatofuz
parents:
diff changeset
60 // CHECK: Punctuation: "#" [4:1 - 4:2] preprocessing directive=
anatofuz
parents:
diff changeset
61 // CHECK: Identifier: "define" [4:2 - 4:8] preprocessing directive=
anatofuz
parents:
diff changeset
62 // CHECK: Identifier: "WIBBLE" [4:9 - 4:15] macro definition=WIBBLE
anatofuz
parents:
diff changeset
63 // CHECK: Punctuation: "(" [4:15 - 4:16] macro definition=WIBBLE
anatofuz
parents:
diff changeset
64 // CHECK: Identifier: "X" [4:16 - 4:17] macro definition=WIBBLE
anatofuz
parents:
diff changeset
65 // CHECK: Punctuation: "," [4:17 - 4:18] macro definition=WIBBLE
anatofuz
parents:
diff changeset
66 // CHECK: Identifier: "Y" [4:19 - 4:20] macro definition=WIBBLE
anatofuz
parents:
diff changeset
67 // CHECK: Punctuation: ")" [4:20 - 4:21] macro definition=WIBBLE
anatofuz
parents:
diff changeset
68 // CHECK: Identifier: "X" [4:22 - 4:23] macro definition=WIBBLE
anatofuz
parents:
diff changeset
69 // CHECK: Punctuation: "##" [4:23 - 4:25] macro definition=WIBBLE
anatofuz
parents:
diff changeset
70 // CHECK: Identifier: "Y" [4:25 - 4:26] macro definition=WIBBLE
anatofuz
parents:
diff changeset
71 // CHECK: Identifier: "NOTHING" [5:1 - 5:8] macro expansion=NOTHING:1:9
anatofuz
parents:
diff changeset
72 // CHECK: Punctuation: "(" [5:8 - 5:9]
anatofuz
parents:
diff changeset
73 // CHECK: Identifier: "more" [5:9 - 5:13]
anatofuz
parents:
diff changeset
74 // CHECK: Punctuation: "," [5:13 - 5:14]
anatofuz
parents:
diff changeset
75 // CHECK: Identifier: "junk" [5:14 - 5:18]
anatofuz
parents:
diff changeset
76 // CHECK: Punctuation: ")" [5:18 - 5:19]
anatofuz
parents:
diff changeset
77 // CHECK: Keyword: "float" [5:20 - 5:25]
anatofuz
parents:
diff changeset
78 // CHECK: Identifier: "WIBBLE" [5:26 - 5:32] macro expansion=WIBBLE:4:9
anatofuz
parents:
diff changeset
79 // CHECK: Punctuation: "(" [5:32 - 5:33]
anatofuz
parents:
diff changeset
80 // CHECK: Keyword: "int" [5:33 - 5:36]
anatofuz
parents:
diff changeset
81 // CHECK: Punctuation: "," [5:36 - 5:37]
anatofuz
parents:
diff changeset
82 // CHECK: Keyword: "float" [5:38 - 5:43]
anatofuz
parents:
diff changeset
83 // CHECK: Punctuation: ")" [5:43 - 5:44]
anatofuz
parents:
diff changeset
84 // CHECK: Punctuation: ";" [5:44 - 5:45]
anatofuz
parents:
diff changeset
85 // CHECK: Keyword: "int" [6:1 - 6:4]
anatofuz
parents:
diff changeset
86 // CHECK: Identifier: "BAR" [6:5 - 6:8] macro expansion=BAR:3:9
anatofuz
parents:
diff changeset
87 // CHECK: Identifier: "STILL_NOTHING" [6:9 - 6:22] macro expansion=STILL_NOTHING:2:9
anatofuz
parents:
diff changeset
88 // CHECK: Punctuation: ";" [6:22 - 6:23]
anatofuz
parents:
diff changeset
89 // CHECK: Punctuation: "#" [7:1 - 7:2] inclusion directive=foo.h
anatofuz
parents:
diff changeset
90 // CHECK: Identifier: "include" [7:2 - 7:9] inclusion directive=foo.h
anatofuz
parents:
diff changeset
91 // CHECK: Literal: ""foo.h"" [7:10 - 7:17] inclusion directive=foo.h
anatofuz
parents:
diff changeset
92 // CHECK: Punctuation: "#" [8:1 - 8:2] preprocessing directive=
anatofuz
parents:
diff changeset
93 // CHECK: Identifier: "undef" [8:2 - 8:7] preprocessing directive=
anatofuz
parents:
diff changeset
94 // CHECK: Identifier: "BAR" [8:8 - 8:11] preprocessing directive=
anatofuz
parents:
diff changeset
95 // CHECK: Punctuation: "#" [10:1 - 10:2] preprocessing directive=
anatofuz
parents:
diff changeset
96 // CHECK: Identifier: "define" [10:2 - 10:8] preprocessing directive=
anatofuz
parents:
diff changeset
97 // CHECK: Identifier: "REVERSE_MACRO" [10:9 - 10:22] macro definition=REVERSE_MACRO
anatofuz
parents:
diff changeset
98 // CHECK: Punctuation: "(" [10:22 - 10:23] macro definition=REVERSE_MACRO
anatofuz
parents:
diff changeset
99 // CHECK: Identifier: "x" [10:23 - 10:24] macro definition=REVERSE_MACRO
anatofuz
parents:
diff changeset
100 // CHECK: Punctuation: "," [10:24 - 10:25] macro definition=REVERSE_MACRO
anatofuz
parents:
diff changeset
101 // CHECK: Identifier: "y" [10:25 - 10:26] macro definition=REVERSE_MACRO
anatofuz
parents:
diff changeset
102 // CHECK: Punctuation: ")" [10:26 - 10:27] macro definition=REVERSE_MACRO
anatofuz
parents:
diff changeset
103 // CHECK: Identifier: "y" [10:28 - 10:29] macro definition=REVERSE_MACRO
anatofuz
parents:
diff changeset
104 // CHECK: Punctuation: "+" [10:30 - 10:31] macro definition=REVERSE_MACRO
anatofuz
parents:
diff changeset
105 // CHECK: Identifier: "x" [10:32 - 10:33] macro definition=REVERSE_MACRO
anatofuz
parents:
diff changeset
106 // CHECK: Punctuation: "#" [11:1 - 11:2] preprocessing directive=
anatofuz
parents:
diff changeset
107 // CHECK: Identifier: "define" [11:2 - 11:8] preprocessing directive=
anatofuz
parents:
diff changeset
108 // CHECK: Identifier: "TWICE_MACRO" [11:9 - 11:20] macro definition=TWICE_MACRO
anatofuz
parents:
diff changeset
109 // CHECK: Punctuation: "(" [11:20 - 11:21] macro definition=TWICE_MACRO
anatofuz
parents:
diff changeset
110 // CHECK: Identifier: "y" [11:21 - 11:22] macro definition=TWICE_MACRO
anatofuz
parents:
diff changeset
111 // CHECK: Punctuation: ")" [11:22 - 11:23] macro definition=TWICE_MACRO
anatofuz
parents:
diff changeset
112 // CHECK: Identifier: "y" [11:24 - 11:25] macro definition=TWICE_MACRO
anatofuz
parents:
diff changeset
113 // CHECK: Punctuation: "+" [11:26 - 11:27] macro definition=TWICE_MACRO
anatofuz
parents:
diff changeset
114 // CHECK: Identifier: "y" [11:28 - 11:29] macro definition=TWICE_MACRO
anatofuz
parents:
diff changeset
115 // CHECK: Keyword: "void" [13:1 - 13:5] FunctionDecl=test_macro_args:13:6 (Definition)
anatofuz
parents:
diff changeset
116 // CHECK: Identifier: "test_macro_args" [13:6 - 13:21] FunctionDecl=test_macro_args:13:6 (Definition)
anatofuz
parents:
diff changeset
117 // CHECK: Punctuation: "(" [13:21 - 13:22] FunctionDecl=test_macro_args:13:6 (Definition)
anatofuz
parents:
diff changeset
118 // CHECK: Punctuation: ")" [13:22 - 13:23] FunctionDecl=test_macro_args:13:6 (Definition)
anatofuz
parents:
diff changeset
119 // CHECK: Punctuation: "{" [13:24 - 13:25] CompoundStmt=
anatofuz
parents:
diff changeset
120 // CHECK: Keyword: "int" [14:3 - 14:6] VarDecl=z:14:7 (Definition)
anatofuz
parents:
diff changeset
121 // CHECK: Identifier: "z" [14:7 - 14:8] VarDecl=z:14:7 (Definition)
anatofuz
parents:
diff changeset
122 // CHECK: Punctuation: "=" [14:9 - 14:10] VarDecl=z:14:7 (Definition)
anatofuz
parents:
diff changeset
123 // CHECK: Literal: "1" [14:11 - 14:12] IntegerLiteral=
anatofuz
parents:
diff changeset
124 // CHECK: Punctuation: ";" [14:12 - 14:13] DeclStmt=
anatofuz
parents:
diff changeset
125 // CHECK: Keyword: "int" [15:3 - 15:6] VarDecl=t:15:7 (Definition)
anatofuz
parents:
diff changeset
126 // CHECK: Identifier: "t" [15:7 - 15:8] VarDecl=t:15:7 (Definition)
anatofuz
parents:
diff changeset
127 // CHECK: Punctuation: "=" [15:9 - 15:10] VarDecl=t:15:7 (Definition)
anatofuz
parents:
diff changeset
128 // CHECK: Literal: "2" [15:11 - 15:12] IntegerLiteral=
anatofuz
parents:
diff changeset
129 // CHECK: Punctuation: ";" [15:12 - 15:13] DeclStmt=
anatofuz
parents:
diff changeset
130 // CHECK: Keyword: "int" [16:3 - 16:6] VarDecl=k:16:7 (Definition)
anatofuz
parents:
diff changeset
131 // CHECK: Identifier: "k" [16:7 - 16:8] VarDecl=k:16:7 (Definition)
anatofuz
parents:
diff changeset
132 // CHECK: Punctuation: "=" [16:9 - 16:10] VarDecl=k:16:7 (Definition)
anatofuz
parents:
diff changeset
133 // CHECK: Identifier: "REVERSE_MACRO" [16:11 - 16:24] macro expansion=REVERSE_MACRO:10:9
anatofuz
parents:
diff changeset
134 // CHECK: Punctuation: "(" [16:24 - 16:25]
anatofuz
parents:
diff changeset
135 // CHECK: Identifier: "t" [16:25 - 16:26] DeclRefExpr=t:15:7
anatofuz
parents:
diff changeset
136 // CHECK: Punctuation: "," [16:26 - 16:27]
anatofuz
parents:
diff changeset
137 // CHECK: Identifier: "z" [16:27 - 16:28] DeclRefExpr=z:14:7
anatofuz
parents:
diff changeset
138 // FIXME: The token below should really be annotated as "macro expansion=REVERSE_MACRO:10:9"
anatofuz
parents:
diff changeset
139 // CHECK: Punctuation: ")" [16:28 - 16:29] DeclStmt=
anatofuz
parents:
diff changeset
140 // CHECK: Punctuation: ";" [16:29 - 16:30] DeclStmt=
anatofuz
parents:
diff changeset
141 // CHECK: Keyword: "int" [17:3 - 17:6] VarDecl=j:17:7 (Definition)
anatofuz
parents:
diff changeset
142 // CHECK: Identifier: "j" [17:7 - 17:8] VarDecl=j:17:7 (Definition)
anatofuz
parents:
diff changeset
143 // CHECK: Punctuation: "=" [17:9 - 17:10] VarDecl=j:17:7 (Definition)
anatofuz
parents:
diff changeset
144 // CHECK: Identifier: "TWICE_MACRO" [17:11 - 17:22] macro expansion=TWICE_MACRO:11:9
anatofuz
parents:
diff changeset
145 // CHECK: Punctuation: "(" [17:22 - 17:23]
anatofuz
parents:
diff changeset
146 // CHECK: Identifier: "k" [17:23 - 17:24] DeclRefExpr=k:16:7
anatofuz
parents:
diff changeset
147 // CHECK: Punctuation: "+" [17:25 - 17:26] BinaryOperator=
anatofuz
parents:
diff changeset
148 // CHECK: Identifier: "k" [17:27 - 17:28] DeclRefExpr=k:16:7
anatofuz
parents:
diff changeset
149 // FIXME: The token below should really be annotated as "macro expansion=TWICE_MACRO:11:9"
anatofuz
parents:
diff changeset
150 // CHECK: Punctuation: ")" [17:28 - 17:29] DeclStmt=
anatofuz
parents:
diff changeset
151 // CHECK: Punctuation: ";" [17:29 - 17:30] DeclStmt=
anatofuz
parents:
diff changeset
152 // CHECK: Keyword: "int" [18:3 - 18:6] VarDecl=w:18:7 (Definition)
anatofuz
parents:
diff changeset
153 // CHECK: Identifier: "w" [18:7 - 18:8] VarDecl=w:18:7 (Definition)
anatofuz
parents:
diff changeset
154 // CHECK: Punctuation: "=" [18:9 - 18:10] VarDecl=w:18:7 (Definition)
anatofuz
parents:
diff changeset
155 // CHECK: Identifier: "j" [18:11 - 18:12] DeclRefExpr=j:17:7
anatofuz
parents:
diff changeset
156 // CHECK: Punctuation: "+" [18:13 - 18:14] BinaryOperator=
anatofuz
parents:
diff changeset
157 // CHECK: Identifier: "j" [18:15 - 18:16] DeclRefExpr=j:17:7
anatofuz
parents:
diff changeset
158 // CHECK: Punctuation: ";" [18:16 - 18:17] DeclStmt=
anatofuz
parents:
diff changeset
159 // CHECK: Punctuation: "}" [19:1 - 19:2] CompoundStmt=
anatofuz
parents:
diff changeset
160 // CHECK: Punctuation: "#" [21:1 - 21:2] preprocessing directive=
anatofuz
parents:
diff changeset
161 // CHECK: Identifier: "define" [21:2 - 21:8] preprocessing directive=
anatofuz
parents:
diff changeset
162 // CHECK: Identifier: "fun_with_macro_bodies" [21:9 - 21:30] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
163 // CHECK: Punctuation: "(" [21:30 - 21:31] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
164 // CHECK: Identifier: "x" [21:31 - 21:32] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
165 // CHECK: Punctuation: "," [21:32 - 21:33] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
166 // CHECK: Identifier: "y" [21:34 - 21:35] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
167 // CHECK: Punctuation: ")" [21:35 - 21:36] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
168 // CHECK: Keyword: "do" [21:37 - 21:39] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
169 // CHECK: Punctuation: "{" [21:40 - 21:41] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
170 // CHECK: Keyword: "if" [21:42 - 21:44] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
171 // CHECK: Punctuation: "(" [21:45 - 21:46] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
172 // CHECK: Identifier: "x" [21:46 - 21:47] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
173 // CHECK: Punctuation: ")" [21:47 - 21:48] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
174 // CHECK: Identifier: "y" [21:49 - 21:50] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
175 // CHECK: Punctuation: "}" [21:51 - 21:52] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
176 // CHECK: Keyword: "while" [21:53 - 21:58] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
177 // CHECK: Punctuation: "(" [21:59 - 21:60] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
178 // CHECK: Literal: "0" [21:60 - 21:61] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
179 // CHECK: Punctuation: ")" [21:61 - 21:62] macro definition=fun_with_macro_bodies
anatofuz
parents:
diff changeset
180 // CHECK: Keyword: "void" [23:1 - 23:5] FunctionDecl=test:23:6 (Definition)
anatofuz
parents:
diff changeset
181 // CHECK: Identifier: "test" [23:6 - 23:10] FunctionDecl=test:23:6 (Definition)
anatofuz
parents:
diff changeset
182 // CHECK: Punctuation: "(" [23:10 - 23:11] FunctionDecl=test:23:6 (Definition)
anatofuz
parents:
diff changeset
183 // CHECK: Punctuation: ")" [23:11 - 23:12] FunctionDecl=test:23:6 (Definition)
anatofuz
parents:
diff changeset
184 // CHECK: Punctuation: "{" [23:13 - 23:14] CompoundStmt=
anatofuz
parents:
diff changeset
185 // CHECK: Keyword: "int" [24:3 - 24:6] VarDecl=x:24:7 (Definition)
anatofuz
parents:
diff changeset
186 // CHECK: Identifier: "x" [24:7 - 24:8] VarDecl=x:24:7 (Definition)
anatofuz
parents:
diff changeset
187 // CHECK: Punctuation: "=" [24:9 - 24:10] VarDecl=x:24:7 (Definition)
anatofuz
parents:
diff changeset
188 // CHECK: Literal: "10" [24:11 - 24:13] IntegerLiteral=
anatofuz
parents:
diff changeset
189 // CHECK: Punctuation: ";" [24:13 - 24:14] DeclStmt=
anatofuz
parents:
diff changeset
190 // CHECK: Identifier: "fun_with_macro_bodies" [25:3 - 25:24] macro expansion=fun_with_macro_bodies:21:9
anatofuz
parents:
diff changeset
191 // CHECK: Punctuation: "(" [25:24 - 25:25] CompoundStmt=
anatofuz
parents:
diff changeset
192 // CHECK: Identifier: "x" [25:25 - 25:26] DeclRefExpr=x:24:7
anatofuz
parents:
diff changeset
193 // CHECK: Punctuation: "," [25:26 - 25:27]
anatofuz
parents:
diff changeset
194 // CHECK: Punctuation: "{" [25:28 - 25:29] CompoundStmt=
anatofuz
parents:
diff changeset
195 // CHECK: Keyword: "int" [25:30 - 25:33] VarDecl=z:25:34 (Definition)
anatofuz
parents:
diff changeset
196 // CHECK: Identifier: "z" [25:34 - 25:35] VarDecl=z:25:34 (Definition)
anatofuz
parents:
diff changeset
197 // CHECK: Punctuation: "=" [25:36 - 25:37] VarDecl=z:25:34 (Definition)
anatofuz
parents:
diff changeset
198 // CHECK: Identifier: "x" [25:38 - 25:39] DeclRefExpr=x:24:7
anatofuz
parents:
diff changeset
199 // CHECK: Punctuation: ";" [25:39 - 25:40] DeclStmt=
anatofuz
parents:
diff changeset
200 // CHECK: Punctuation: "++" [25:41 - 25:43] UnaryOperator=
anatofuz
parents:
diff changeset
201 // CHECK: Identifier: "z" [25:43 - 25:44] DeclRefExpr=z:25:3
anatofuz
parents:
diff changeset
202 // CHECK: Punctuation: ";" [25:44 - 25:45] CompoundStmt=
anatofuz
parents:
diff changeset
203 // CHECK: Punctuation: "}" [25:46 - 25:47] CompoundStmt=
anatofuz
parents:
diff changeset
204 // FIXME: The token below should really be annotated as "macro expansion=fun_with_macro_bodies:21:9"
anatofuz
parents:
diff changeset
205 // CHECK: Punctuation: ")" [25:47 - 25:48] CompoundStmt=
anatofuz
parents:
diff changeset
206 // CHECK: Punctuation: ";" [25:48 - 25:49] CompoundStmt=
anatofuz
parents:
diff changeset
207 // CHECK: Punctuation: "}" [26:1 - 26:2] CompoundStmt=
anatofuz
parents:
diff changeset
208 // CHECK: {{28:1.*inclusion directive=pragma-once.h.*multi-include guarded}}
anatofuz
parents:
diff changeset
209 // CHECK: {{29:1.*inclusion directive=guarded.h.*multi-include guarded}}
anatofuz
parents:
diff changeset
210 // CHECK: Identifier: "__FILE__" [31:21 - 31:29] macro expansion=__FILE__
anatofuz
parents:
diff changeset
211 // CHECK: Punctuation: "#" [35:1 - 35:2] preprocessing directive=
anatofuz
parents:
diff changeset
212 // CHECK: Identifier: "ifdef" [35:2 - 35:7] preprocessing directive=
anatofuz
parents:
diff changeset
213 // CHECK: Identifier: "SOME_MACRO" [35:8 - 35:18] macro expansion=SOME_MACRO:33:9
anatofuz
parents:
diff changeset
214 // CHECK: Punctuation: "#" [36:1 - 36:2] preprocessing directive=
anatofuz
parents:
diff changeset
215 // CHECK: Identifier: "endif" [36:2 - 36:7] preprocessing directive=
anatofuz
parents:
diff changeset
216 // CHECK: Keyword: "struct" [38:1 - 38:7] StructDecl=A:38:8 (Definition)
anatofuz
parents:
diff changeset
217 // CHECK: Identifier: "A" [38:8 - 38:9] StructDecl=A:38:8 (Definition)
anatofuz
parents:
diff changeset
218 // CHECK: Punctuation: "{" [39:1 - 39:2] StructDecl=A:38:8 (Definition)
anatofuz
parents:
diff changeset
219 // CHECK: Punctuation: "#" [40:1 - 40:2] preprocessing directive=
anatofuz
parents:
diff changeset
220 // CHECK: Identifier: "ifdef" [40:2 - 40:7] preprocessing directive=
anatofuz
parents:
diff changeset
221 // CHECK: Identifier: "SOME_MACRO" [40:8 - 40:18] macro expansion=SOME_MACRO:33:9
anatofuz
parents:
diff changeset
222 // CHECK: Keyword: "int" [41:3 - 41:6] FieldDecl=x:41:7 (Definition)
anatofuz
parents:
diff changeset
223 // CHECK: Identifier: "x" [41:7 - 41:8] FieldDecl=x:41:7 (Definition)
anatofuz
parents:
diff changeset
224 // CHECK: Punctuation: ";" [41:8 - 41:9] StructDecl=A:38:8 (Definition)
anatofuz
parents:
diff changeset
225 // CHECK: Punctuation: "#" [42:1 - 42:2] preprocessing directive=
anatofuz
parents:
diff changeset
226 // CHECK: Identifier: "endif" [42:2 - 42:7] preprocessing directive=
anatofuz
parents:
diff changeset
227 // CHECK: Punctuation: "}" [43:1 - 43:2] StructDecl=A:38:8 (Definition)