xref: /llvm-project/clang/test/Index/annotate-tokens.cpp (revision 1d18713486a076634a289f6b47f7eb8679a0e3fb)
1b59d21c2SDouglas Gregor struct bonk { };
test(bonk X)2b59d21c2SDouglas Gregor void test(bonk X) {
3b59d21c2SDouglas Gregor     X = X;
4cf7731b4SFrancois Pichet     __is_base_of(bonk, bonk);
5b59d21c2SDouglas Gregor }
6b59d21c2SDouglas Gregor 
7f20ec923SChandler Carruth struct X {
8f20ec923SChandler Carruth   X operator++();
9f20ec923SChandler Carruth   X operator++(int);
10f20ec923SChandler Carruth };
test2(X x)11f20ec923SChandler Carruth void test2(X x) {
12f20ec923SChandler Carruth   ++(x);
13f20ec923SChandler Carruth   (x)++;
14f20ec923SChandler Carruth }
15f20ec923SChandler Carruth 
16f20ec923SChandler Carruth struct S1 { void f(); };
17f20ec923SChandler Carruth struct S2 { S1 *operator->(); };
test3(S2 s2)18f20ec923SChandler Carruth void test3(S2 s2) {
19f20ec923SChandler Carruth   s2->f();
2066cd1dacSArgyrios Kyrtzidis   X foo;
21f20ec923SChandler Carruth }
22f20ec923SChandler Carruth 
232ec76747SArgyrios Kyrtzidis template <bool (*tfn)(X*)>
242ec76747SArgyrios Kyrtzidis struct TS {
252ec76747SArgyrios Kyrtzidis   void foo();
262ec76747SArgyrios Kyrtzidis };
272ec76747SArgyrios Kyrtzidis 
282ec76747SArgyrios Kyrtzidis template <bool (*tfn)(X*)>
foo()292ec76747SArgyrios Kyrtzidis void TS<tfn>::foo() {}
302ec76747SArgyrios Kyrtzidis 
test4()3150126f12SArgyrios Kyrtzidis void test4() {
3250126f12SArgyrios Kyrtzidis   if (int p = 0)
3350126f12SArgyrios Kyrtzidis     return;
3450126f12SArgyrios Kyrtzidis }
3550126f12SArgyrios Kyrtzidis 
364a4d2b41SArgyrios Kyrtzidis class C {
374a4d2b41SArgyrios Kyrtzidis   ~C();
384a4d2b41SArgyrios Kyrtzidis };
394a4d2b41SArgyrios Kyrtzidis 
40*1d187134SIvan Donchevskii auto test5(X) -> X;
41*1d187134SIvan Donchevskii 
42*1d187134SIvan Donchevskii // RUN: c-index-test -test-annotate-tokens=%s:1:1:41:1 %s -std=c++14 -fno-delayed-template-parsing | FileCheck %s
43b59d21c2SDouglas Gregor // CHECK: Keyword: "struct" [1:1 - 1:7] StructDecl=bonk:1:8 (Definition)
44b59d21c2SDouglas Gregor // CHECK: Identifier: "bonk" [1:8 - 1:12] StructDecl=bonk:1:8 (Definition)
45b59d21c2SDouglas Gregor // CHECK: Punctuation: "{" [1:13 - 1:14] StructDecl=bonk:1:8 (Definition)
46b59d21c2SDouglas Gregor // CHECK: Punctuation: "}" [1:15 - 1:16] StructDecl=bonk:1:8 (Definition)
47b59d21c2SDouglas Gregor // CHECK: Punctuation: ";" [1:16 - 1:17]
48b59d21c2SDouglas Gregor // CHECK: Keyword: "void" [2:1 - 2:5] FunctionDecl=test:2:6 (Definition)
49b59d21c2SDouglas Gregor // CHECK: Identifier: "test" [2:6 - 2:10] FunctionDecl=test:2:6 (Definition)
50b59d21c2SDouglas Gregor // CHECK: Punctuation: "(" [2:10 - 2:11] FunctionDecl=test:2:6 (Definition)
51b59d21c2SDouglas Gregor // CHECK: Identifier: "bonk" [2:11 - 2:15] TypeRef=struct bonk:1:8
52b59d21c2SDouglas Gregor // CHECK: Identifier: "X" [2:16 - 2:17] ParmDecl=X:2:16 (Definition)
53b59d21c2SDouglas Gregor // CHECK: Punctuation: ")" [2:17 - 2:18] FunctionDecl=test:2:6 (Definition)
544c362d53SDouglas Gregor // CHECK: Punctuation: "{" [2:19 - 2:20] CompoundStmt=
55b59d21c2SDouglas Gregor // CHECK: Identifier: "X" [3:5 - 3:6] DeclRefExpr=X:2:16
56a2a299e5SArgyrios Kyrtzidis // CHECK: Punctuation: "=" [3:7 - 3:8] DeclRefExpr=operator=:1:8
57b59d21c2SDouglas Gregor // CHECK: Identifier: "X" [3:9 - 3:10] DeclRefExpr=X:2:16
584c362d53SDouglas Gregor // CHECK: Punctuation: ";" [3:10 - 3:11] CompoundStmt=
59cf7731b4SFrancois Pichet // CHECK: Keyword: "__is_base_of" [4:5 - 4:17] UnexposedExpr=
60cf7731b4SFrancois Pichet // CHECK: Punctuation: "(" [4:17 - 4:18] UnexposedExpr=
61cf7731b4SFrancois Pichet // CHECK: Identifier: "bonk" [4:18 - 4:22] TypeRef=struct bonk:1:8
62cf7731b4SFrancois Pichet // CHECK: Punctuation: "," [4:22 - 4:23] UnexposedExpr=
63cf7731b4SFrancois Pichet // CHECK: Identifier: "bonk" [4:24 - 4:28] TypeRef=struct bonk:1:8
64cf7731b4SFrancois Pichet // CHECK: Punctuation: ")" [4:28 - 4:29] UnexposedExpr=
654c362d53SDouglas Gregor // CHECK: Punctuation: ";" [4:29 - 4:30] CompoundStmt=
664c362d53SDouglas Gregor // CHECK: Punctuation: "}" [5:1 - 5:2] CompoundStmt=
67f20ec923SChandler Carruth // CHECK: Keyword: "struct" [7:1 - 7:7] StructDecl=X:7:8 (Definition)
68f20ec923SChandler Carruth // CHECK: Identifier: "X" [7:8 - 7:9] StructDecl=X:7:8 (Definition)
69f20ec923SChandler Carruth // CHECK: Punctuation: "{" [7:10 - 7:11] StructDecl=X:7:8 (Definition)
70f20ec923SChandler Carruth // CHECK: Identifier: "X" [8:3 - 8:4] TypeRef=struct X:7:8
71f20ec923SChandler Carruth // CHECK: Keyword: "operator" [8:5 - 8:13] CXXMethod=operator++:8:5
72f20ec923SChandler Carruth // CHECK: Punctuation: "++" [8:13 - 8:15] CXXMethod=operator++:8:5
73f20ec923SChandler Carruth // CHECK: Punctuation: "(" [8:15 - 8:16] CXXMethod=operator++:8:5
74f20ec923SChandler Carruth // CHECK: Punctuation: ")" [8:16 - 8:17] CXXMethod=operator++:8:5
75f20ec923SChandler Carruth // CHECK: Punctuation: ";" [8:17 - 8:18] StructDecl=X:7:8 (Definition)
76f20ec923SChandler Carruth // CHECK: Identifier: "X" [9:3 - 9:4] TypeRef=struct X:7:8
77f20ec923SChandler Carruth // CHECK: Keyword: "operator" [9:5 - 9:13] CXXMethod=operator++:9:5
78f20ec923SChandler Carruth // CHECK: Punctuation: "++" [9:13 - 9:15] CXXMethod=operator++:9:5
79f20ec923SChandler Carruth // CHECK: Punctuation: "(" [9:15 - 9:16] CXXMethod=operator++:9:5
803a7cc81dSBenjamin Kramer // CHECK: Keyword: "int" [9:16 - 9:19] ParmDecl=:9:19 (Definition
813a7cc81dSBenjamin Kramer // CHECK: Punctuation: ")" [9:19 - 9:20] CXXMethod=operator++:9:5
82f20ec923SChandler Carruth // CHECK: Punctuation: ";" [9:20 - 9:21] StructDecl=X:7:8 (Definition)
83f20ec923SChandler Carruth // CHECK: Punctuation: "}" [10:1 - 10:2] StructDecl=X:7:8 (Definition)
84f20ec923SChandler Carruth // CHECK: Punctuation: ";" [10:2 - 10:3]
85f20ec923SChandler Carruth // CHECK: Keyword: "void" [11:1 - 11:5] FunctionDecl=test2:11:6 (Definition)
86f20ec923SChandler Carruth // CHECK: Identifier: "test2" [11:6 - 11:11] FunctionDecl=test2:11:6 (Definition)
87f20ec923SChandler Carruth // CHECK: Punctuation: "(" [11:11 - 11:12] FunctionDecl=test2:11:6 (Definition)
88f20ec923SChandler Carruth // CHECK: Identifier: "X" [11:12 - 11:13] TypeRef=struct X:7:8
89f20ec923SChandler Carruth // CHECK: Identifier: "x" [11:14 - 11:15] ParmDecl=x:11:14 (Definition)
90f20ec923SChandler Carruth // CHECK: Punctuation: ")" [11:15 - 11:16] FunctionDecl=test2:11:6 (Definition)
914c362d53SDouglas Gregor // CHECK: Punctuation: "{" [11:17 - 11:18] CompoundStmt=
92f20ec923SChandler Carruth // CHECK: Punctuation: "++" [12:3 - 12:5] CallExpr=operator++:8:5
934c362d53SDouglas Gregor // CHECK: Punctuation: "(" [12:5 - 12:6] ParenExpr=
94f20ec923SChandler Carruth // CHECK: Identifier: "x" [12:6 - 12:7] DeclRefExpr=x:11:14
954c362d53SDouglas Gregor // CHECK: Punctuation: ")" [12:7 - 12:8] ParenExpr=
964c362d53SDouglas Gregor // CHECK: Punctuation: ";" [12:8 - 12:9] CompoundStmt=
974c362d53SDouglas Gregor // CHECK: Punctuation: "(" [13:3 - 13:4] ParenExpr=
98f20ec923SChandler Carruth // CHECK: Identifier: "x" [13:4 - 13:5] DeclRefExpr=x:11:14
994c362d53SDouglas Gregor // CHECK: Punctuation: ")" [13:5 - 13:6] ParenExpr=
100a2a299e5SArgyrios Kyrtzidis // CHECK: Punctuation: "++" [13:6 - 13:8] DeclRefExpr=operator++:9:5
1014c362d53SDouglas Gregor // CHECK: Punctuation: ";" [13:8 - 13:9] CompoundStmt=
1024c362d53SDouglas Gregor // CHECK: Punctuation: "}" [14:1 - 14:2] CompoundStmt=
103f20ec923SChandler Carruth // CHECK: Keyword: "struct" [16:1 - 16:7] StructDecl=S1:16:8 (Definition)
104f20ec923SChandler Carruth // CHECK: Identifier: "S1" [16:8 - 16:10] StructDecl=S1:16:8 (Definition)
105f20ec923SChandler Carruth // CHECK: Punctuation: "{" [16:11 - 16:12] StructDecl=S1:16:8 (Definition)
106f20ec923SChandler Carruth // CHECK: Keyword: "void" [16:13 - 16:17] CXXMethod=f:16:18
107f20ec923SChandler Carruth // CHECK: Identifier: "f" [16:18 - 16:19] CXXMethod=f:16:18
108f20ec923SChandler Carruth // CHECK: Punctuation: "(" [16:19 - 16:20] CXXMethod=f:16:18
109f20ec923SChandler Carruth // CHECK: Punctuation: ")" [16:20 - 16:21] CXXMethod=f:16:18
110f20ec923SChandler Carruth // CHECK: Punctuation: ";" [16:21 - 16:22] StructDecl=S1:16:8 (Definition)
111f20ec923SChandler Carruth // CHECK: Punctuation: "}" [16:23 - 16:24] StructDecl=S1:16:8 (Definition)
112f20ec923SChandler Carruth // CHECK: Punctuation: ";" [16:24 - 16:25]
113f20ec923SChandler Carruth // CHECK: Keyword: "struct" [17:1 - 17:7] StructDecl=S2:17:8 (Definition)
114f20ec923SChandler Carruth // CHECK: Identifier: "S2" [17:8 - 17:10] StructDecl=S2:17:8 (Definition)
115f20ec923SChandler Carruth // CHECK: Punctuation: "{" [17:11 - 17:12] StructDecl=S2:17:8 (Definition)
116f20ec923SChandler Carruth // CHECK: Identifier: "S1" [17:13 - 17:15] TypeRef=struct S1:16:8
117f20ec923SChandler Carruth // CHECK: Punctuation: "*" [17:16 - 17:17] CXXMethod=operator->:17:17
118f20ec923SChandler Carruth // CHECK: Keyword: "operator" [17:17 - 17:25] CXXMethod=operator->:17:17
119f20ec923SChandler Carruth // CHECK: Punctuation: "->" [17:25 - 17:27] CXXMethod=operator->:17:17
120f20ec923SChandler Carruth // CHECK: Punctuation: "(" [17:27 - 17:28] CXXMethod=operator->:17:17
121f20ec923SChandler Carruth // CHECK: Punctuation: ")" [17:28 - 17:29] CXXMethod=operator->:17:17
122f20ec923SChandler Carruth // CHECK: Punctuation: ";" [17:29 - 17:30] StructDecl=S2:17:8 (Definition)
123f20ec923SChandler Carruth // CHECK: Punctuation: "}" [17:31 - 17:32] StructDecl=S2:17:8 (Definition)
124f20ec923SChandler Carruth // CHECK: Punctuation: ";" [17:32 - 17:33]
125f20ec923SChandler Carruth // CHECK: Keyword: "void" [18:1 - 18:5] FunctionDecl=test3:18:6 (Definition)
126f20ec923SChandler Carruth // CHECK: Identifier: "test3" [18:6 - 18:11] FunctionDecl=test3:18:6 (Definition)
127f20ec923SChandler Carruth // CHECK: Punctuation: "(" [18:11 - 18:12] FunctionDecl=test3:18:6 (Definition)
128f20ec923SChandler Carruth // CHECK: Identifier: "S2" [18:12 - 18:14] TypeRef=struct S2:17:8
129f20ec923SChandler Carruth // CHECK: Identifier: "s2" [18:15 - 18:17] ParmDecl=s2:18:15 (Definition)
130f20ec923SChandler Carruth // CHECK: Punctuation: ")" [18:17 - 18:18] FunctionDecl=test3:18:6 (Definition)
1314c362d53SDouglas Gregor // CHECK: Punctuation: "{" [18:19 - 18:20] CompoundStmt=
132f20ec923SChandler Carruth // CHECK: Identifier: "s2" [19:3 - 19:5] DeclRefExpr=s2:18:15
133a2a299e5SArgyrios Kyrtzidis // CHECK: Punctuation: "->" [19:5 - 19:7] DeclRefExpr=operator->:17:17
134f20ec923SChandler Carruth // CHECK: Identifier: "f" [19:7 - 19:8] MemberRefExpr=f:16:18
135f20ec923SChandler Carruth // CHECK: Punctuation: "(" [19:8 - 19:9] CallExpr=f:16:18
136f20ec923SChandler Carruth // CHECK: Punctuation: ")" [19:9 - 19:10] CallExpr=f:16:18
1374c362d53SDouglas Gregor // CHECK: Punctuation: ";" [19:10 - 19:11] CompoundStmt=
13866cd1dacSArgyrios Kyrtzidis // CHECK: Identifier: "X" [20:3 - 20:4] TypeRef=struct X:7:8
13966cd1dacSArgyrios Kyrtzidis // CHECK: Identifier: "foo" [20:5 - 20:8] VarDecl=foo:20:5 (Definition)
1404c362d53SDouglas Gregor // CHECK: Punctuation: ";" [20:8 - 20:9] DeclStmt=
1414c362d53SDouglas Gregor // CHECK: Punctuation: "}" [21:1 - 21:2] CompoundStmt=
1422ec76747SArgyrios Kyrtzidis // CHECK: Keyword: "template" [23:1 - 23:9] ClassTemplate=TS:24:8 (Definition)
1432ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "<" [23:10 - 23:11] ClassTemplate=TS:24:8 (Definition)
1442ec76747SArgyrios Kyrtzidis // CHECK: Keyword: "bool" [23:11 - 23:15] NonTypeTemplateParameter=tfn:23:18 (Definition)
1452ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "(" [23:16 - 23:17] NonTypeTemplateParameter=tfn:23:18 (Definition)
1462ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "*" [23:17 - 23:18] NonTypeTemplateParameter=tfn:23:18 (Definition)
1472ec76747SArgyrios Kyrtzidis // CHECK: Identifier: "tfn" [23:18 - 23:21] NonTypeTemplateParameter=tfn:23:18 (Definition)
1482ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: ")" [23:21 - 23:22] NonTypeTemplateParameter=tfn:23:18 (Definition)
1492ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "(" [23:22 - 23:23] NonTypeTemplateParameter=tfn:23:18 (Definition)
1502ec76747SArgyrios Kyrtzidis // CHECK: Identifier: "X" [23:23 - 23:24] TypeRef=struct X:7:8
1512ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "*" [23:24 - 23:25] ParmDecl=:23:25 (Definition)
1523a7cc81dSBenjamin Kramer // CHECK: Punctuation: ")" [23:25 - 23:26] NonTypeTemplateParameter=tfn:23:18 (Definition)
1532ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: ">" [23:26 - 23:27] ClassTemplate=TS:24:8 (Definition)
1542ec76747SArgyrios Kyrtzidis // CHECK: Keyword: "struct" [24:1 - 24:7] ClassTemplate=TS:24:8 (Definition)
1552ec76747SArgyrios Kyrtzidis // CHECK: Identifier: "TS" [24:8 - 24:10] ClassTemplate=TS:24:8 (Definition)
1562ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "{" [24:11 - 24:12] ClassTemplate=TS:24:8 (Definition)
1572ec76747SArgyrios Kyrtzidis // CHECK: Keyword: "void" [25:3 - 25:7] CXXMethod=foo:25:8
1582ec76747SArgyrios Kyrtzidis // CHECK: Identifier: "foo" [25:8 - 25:11] CXXMethod=foo:25:8
1592ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "(" [25:11 - 25:12] CXXMethod=foo:25:8
1602ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: ")" [25:12 - 25:13] CXXMethod=foo:25:8
1612ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: ";" [25:13 - 25:14] ClassTemplate=TS:24:8 (Definition)
1622ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "}" [26:1 - 26:2] ClassTemplate=TS:24:8 (Definition)
1632ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: ";" [26:2 - 26:3]
1642ec76747SArgyrios Kyrtzidis // CHECK: Keyword: "template" [28:1 - 28:9] CXXMethod=foo:29:15 (Definition)
1652ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "<" [28:10 - 28:11] CXXMethod=foo:29:15 (Definition)
1662ec76747SArgyrios Kyrtzidis // CHECK: Keyword: "bool" [28:11 - 28:15] NonTypeTemplateParameter=tfn:28:18 (Definition)
1672ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "(" [28:16 - 28:17] NonTypeTemplateParameter=tfn:28:18 (Definition)
1682ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "*" [28:17 - 28:18] NonTypeTemplateParameter=tfn:28:18 (Definition)
1692ec76747SArgyrios Kyrtzidis // CHECK: Identifier: "tfn" [28:18 - 28:21] NonTypeTemplateParameter=tfn:28:18 (Definition)
1702ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: ")" [28:21 - 28:22] NonTypeTemplateParameter=tfn:28:18 (Definition)
1712ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "(" [28:22 - 28:23] NonTypeTemplateParameter=tfn:28:18 (Definition)
1722ec76747SArgyrios Kyrtzidis // CHECK: Identifier: "X" [28:23 - 28:24] TypeRef=struct X:7:8
1732ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "*" [28:24 - 28:25] ParmDecl=:28:25 (Definition)
1743a7cc81dSBenjamin Kramer // CHECK: Punctuation: ")" [28:25 - 28:26] NonTypeTemplateParameter=tfn:28:18 (Definition)
1752ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: ">" [28:26 - 28:27] CXXMethod=foo:29:15 (Definition)
1762ec76747SArgyrios Kyrtzidis // CHECK: Keyword: "void" [29:1 - 29:5] CXXMethod=foo:29:15 (Definition)
1772ec76747SArgyrios Kyrtzidis // CHECK: Identifier: "TS" [29:6 - 29:8] TemplateRef=TS:24:8
1782ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "<" [29:8 - 29:9] CXXMethod=foo:29:15 (Definition)
1792ec76747SArgyrios Kyrtzidis // CHECK: Identifier: "tfn" [29:9 - 29:12] DeclRefExpr=tfn:28:18
1802ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: ">" [29:12 - 29:13] CXXMethod=foo:29:15 (Definition)
1812ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "::" [29:13 - 29:15] CXXMethod=foo:29:15 (Definition)
1822ec76747SArgyrios Kyrtzidis // CHECK: Identifier: "foo" [29:15 - 29:18] CXXMethod=foo:29:15 (Definition)
1832ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "(" [29:18 - 29:19] CXXMethod=foo:29:15 (Definition)
1842ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: ")" [29:19 - 29:20] CXXMethod=foo:29:15 (Definition)
1852ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "{" [29:21 - 29:22] CompoundStmt=
1862ec76747SArgyrios Kyrtzidis // CHECK: Punctuation: "}" [29:22 - 29:23] CompoundStmt=
1874a4d2b41SArgyrios Kyrtzidis // CHECK: Punctuation: "~" [37:3 - 37:4] CXXDestructor=~C:37:3
1884a4d2b41SArgyrios Kyrtzidis // CHECK: Identifier: "C" [37:4 - 37:5] CXXDestructor=~C:37:3
189*1d187134SIvan Donchevskii // CHECK: Keyword: "auto" [40:1 - 40:5] FunctionDecl=test5:40:6
190*1d187134SIvan Donchevskii // CHECK: Identifier: "test5" [40:6 - 40:11] FunctionDecl=test5:40:6
191*1d187134SIvan Donchevskii // CHECK: Punctuation: "(" [40:11 - 40:12] FunctionDecl=test5:40:6
192*1d187134SIvan Donchevskii // CHECK: Identifier: "X" [40:12 - 40:13] TypeRef=struct X:7:8
193*1d187134SIvan Donchevskii // CHECK: Punctuation: ")" [40:13 - 40:14] FunctionDecl=test5:40:6
194*1d187134SIvan Donchevskii // CHECK: Punctuation: "->" [40:15 - 40:17] FunctionDecl=test5:40:6
195*1d187134SIvan Donchevskii // CHECK: Identifier: "X" [40:18 - 40:19] TypeRef=struct X:7:8
196*1d187134SIvan Donchevskii // CHECK: Punctuation: ";" [40:19 - 40:20]
19750126f12SArgyrios Kyrtzidis 
19850126f12SArgyrios Kyrtzidis // RUN: env LIBCLANG_DISABLE_CRASH_RECOVERY=1 c-index-test -test-annotate-tokens=%s:32:1:32:13 %s | FileCheck %s -check-prefix=CHECK2
19950126f12SArgyrios Kyrtzidis // CHECK2: Keyword: "if" [32:3 - 32:5] IfStmt=
20050126f12SArgyrios Kyrtzidis // CHECK2: Punctuation: "(" [32:6 - 32:7] IfStmt=
20150126f12SArgyrios Kyrtzidis // CHECK2: Keyword: "int" [32:7 - 32:10] VarDecl=p:32:11 (Definition)
20250126f12SArgyrios Kyrtzidis // CHECK2: Identifier: "p" [32:11 - 32:12] VarDecl=p:32:11 (Definition)
20350126f12SArgyrios Kyrtzidis // CHECK2: Punctuation: "=" [32:13 - 32:14] VarDecl=p:32:11 (Definition)
204