blob: a271c51a30cf503f2fcd8d5cf932455a20fa6c80 [file] [log] [blame]
Douglas Gregor98146a62010-03-09 13:06:04 +00001@interface Foo
2- (int)compare:(Foo*)other;
3@end
4
Douglas Gregore0610a42010-03-09 20:57:01 +00005@implementation Foo
6- (int)compare:(Foo*)other {
7 return 0;
Douglas Gregor81d34662010-04-20 15:39:42 +00008 (void)@encode(Foo);
Douglas Gregore0610a42010-03-09 20:57:01 +00009}
10@end
11
Ted Kremeneka333c662010-05-12 05:29:33 +000012// From <rdar://problem/7971430>, the 'barType' referenced in the ivar
13// declarations should be annotated as TypeRefs.
14typedef int * barType;
15@interface Bar
16{
17 barType iVar;
18 barType iVar1, iVar2;
19}
20@end
21@implementation Bar
22- (void) method
23{
24 barType local = iVar;
25}
26@end
27
Ted Kremenek9a700d22010-05-12 06:16:13 +000028// From <rdar://problem/7967123>. The ranges for attributes are not
29// currently stored, causing most of the tokens to be falsely annotated.
30// Since there are no source ranges for attributes, we currently don't
31// annotate them.
32@interface IBActionTests
33- (IBAction) actionMethod:(id)arg;
34- (void)foo:(int)x;
35@end
36extern int ibaction_test(void);
37@implementation IBActionTests
38- (IBAction) actionMethod:(id)arg
39{
40 ibaction_test();
41 [self foo:0];
42}
43- (void) foo:(int)x
44{
45 (void) x;
46}
47@end
48
49// From <rdar://problem/7961995>. Essentially the same issue as 7967123,
50// but impacting code marked as IBOutlets.
51@interface IBOutletTests
52{
53 IBOutlet char * anOutlet;
54}
55- (IBAction) actionMethod:(id)arg;
56@property IBOutlet int * aPropOutlet;
57@end
58
Ted Kremenekd8b0a842010-08-25 22:16:02 +000059// From <rdar://problem/7974151>. The first 'foo:' wasn't being annotated as
60// being part of the Objective-C message expression since the argument
61// was expanded from a macro.
62
63#define VAL 0
64
65@interface R7974151
66- (int) foo:(int)arg;
67- (int) method;
68@end
69
70@implementation R7974151
71- (int) foo:(int)arg {
72 return arg;
73}
74- (int) method
75{
76 int local = [self foo:VAL];
77 int second = [self foo:0];
78 return local;
79}
Douglas Gregordb1314e2010-10-01 21:11:22 +000080- (int)othermethod:(IBOutletTests *)ibt {
81 return *ibt.aPropOutlet;
82}
Ted Kremenekd8b0a842010-08-25 22:16:02 +000083@end
84
Douglas Gregordb1314e2010-10-01 21:11:22 +000085@protocol Proto @end
86
87void f() {
88 (void)@protocol(Proto);
89}
90
Ted Kremenekd8c370c2010-11-02 23:10:24 +000091// <rdar://problem/8595462> - Properly annotate functions and variables
92// declared within an @implementation.
93@class Rdar8595462_A;
94@interface Rdar8595462_B
95@end
96
97@implementation Rdar8595462_B
98Rdar8595462_A * Rdar8595462_aFunction() {
99 Rdar8595462_A * localVar = 0;
100 return localVar;
101}
102static Rdar8595462_A * Rdar8595462_staticVar;
103@end
104
Douglas Gregore3c60a72010-11-17 00:13:31 +0000105// <rdar://problem/8595386> Issues doing syntax coloring of properties
106@interface Rdar8595386 {
107 Foo *_foo;
108}
109
110@property (readonly, copy) Foo *foo;
111@property (readonly) Foo *foo2;
112@end
113
114@implementation Rdar8595386
115@synthesize foo = _foo;
116@dynamic foo2;
117@end
118
Douglas Gregor2fcbcef2010-12-21 16:27:07 +0000119// <rdar://problem/8778404> Blocks don't get colored if annotation starts within the block itself
120@interface Rdar8778404
121@end
122
123@implementation Rdar8778404
124- (int)blah:(int)arg, ... { return arg; }
125- (int)blarg:(int)x {
126 (void)^ {
127 int result = [self blah:5, x];
128 Rdar8778404 *a = self;
129 return 0;
130 };
131}
132@end
133
Douglas Gregorbdb2d502010-12-21 17:34:17 +0000134@interface Rdar8062781
135+ (Foo*)getB;
136@property (readonly, nonatomic) Foo *blah;
137@end
138
Douglas Gregore3c60a72010-11-17 00:13:31 +0000139// RUN: c-index-test -test-annotate-tokens=%s:1:1:118:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' | FileCheck %s
Ted Kremenekfbd84ca2010-05-05 00:55:23 +0000140// CHECK: Punctuation: "@" [1:1 - 1:2] ObjCInterfaceDecl=Foo:1:12
141// CHECK: Keyword: "interface" [1:2 - 1:11] ObjCInterfaceDecl=Foo:1:12
Douglas Gregor98146a62010-03-09 13:06:04 +0000142// CHECK: Identifier: "Foo" [1:12 - 1:15] ObjCInterfaceDecl=Foo:1:12
143// CHECK: Punctuation: "-" [2:1 - 2:2] ObjCInstanceMethodDecl=compare::2:1
Ted Kremenekfbd84ca2010-05-05 00:55:23 +0000144// CHECK: Punctuation: "(" [2:3 - 2:4] ObjCInstanceMethodDecl=compare::2:1
145// CHECK: Keyword: "int" [2:4 - 2:7] ObjCInstanceMethodDecl=compare::2:1
146// CHECK: Punctuation: ")" [2:7 - 2:8] ObjCInstanceMethodDecl=compare::2:1
147// CHECK: Identifier: "compare" [2:8 - 2:15] ObjCInstanceMethodDecl=compare::2:1
148// CHECK: Punctuation: ":" [2:15 - 2:16] ObjCInstanceMethodDecl=compare::2:1
149// CHECK: Punctuation: "(" [2:16 - 2:17] ObjCInstanceMethodDecl=compare::2:1
Douglas Gregor98146a62010-03-09 13:06:04 +0000150// CHECK: Identifier: "Foo" [2:17 - 2:20] ObjCClassRef=Foo:1:12
Ted Kremenekfbd84ca2010-05-05 00:55:23 +0000151// CHECK: Punctuation: "*" [2:20 - 2:21] ParmDecl=other:2:22 (Definition)
152// CHECK: Punctuation: ")" [2:21 - 2:22] ParmDecl=other:2:22 (Definition)
Douglas Gregor98146a62010-03-09 13:06:04 +0000153// CHECK: Identifier: "other" [2:22 - 2:27] ParmDecl=other:2:22 (Definition)
Ted Kremenekfbd84ca2010-05-05 00:55:23 +0000154// CHECK: Punctuation: ";" [2:27 - 2:28] ObjCInstanceMethodDecl=compare::2:1
155// CHECK: Punctuation: "@" [3:1 - 3:2] ObjCInterfaceDecl=Foo:1:12
156// CHECK: Keyword: "end" [3:2 - 3:5] ObjCInterfaceDecl=Foo:1:12
Douglas Gregore0610a42010-03-09 20:57:01 +0000157// CHECK: Punctuation: "@" [5:1 - 5:2] ObjCImplementationDecl=Foo:5:1 (Definition)
Ted Kremenekfbd84ca2010-05-05 00:55:23 +0000158// CHECK: Keyword: "implementation" [5:2 - 5:16] ObjCImplementationDecl=Foo:5:1 (Definition)
159// CHECK: Identifier: "Foo" [5:17 - 5:20] ObjCImplementationDecl=Foo:5:1 (Definition)
Douglas Gregore0610a42010-03-09 20:57:01 +0000160// CHECK: Punctuation: "-" [6:1 - 6:2] ObjCInstanceMethodDecl=compare::6:1 (Definition)
Ted Kremenekfbd84ca2010-05-05 00:55:23 +0000161// CHECK: Punctuation: "(" [6:3 - 6:4] ObjCInstanceMethodDecl=compare::6:1 (Definition)
162// CHECK: Keyword: "int" [6:4 - 6:7] ObjCInstanceMethodDecl=compare::6:1 (Definition)
163// CHECK: Punctuation: ")" [6:7 - 6:8] ObjCInstanceMethodDecl=compare::6:1 (Definition)
164// CHECK: Identifier: "compare" [6:8 - 6:15] ObjCInstanceMethodDecl=compare::6:1 (Definition)
165// CHECK: Punctuation: ":" [6:15 - 6:16] ObjCInstanceMethodDecl=compare::6:1 (Definition)
166// CHECK: Punctuation: "(" [6:16 - 6:17] ObjCInstanceMethodDecl=compare::6:1 (Definition)
Douglas Gregore0610a42010-03-09 20:57:01 +0000167// CHECK: Identifier: "Foo" [6:17 - 6:20] ObjCClassRef=Foo:1:12
Ted Kremenekfbd84ca2010-05-05 00:55:23 +0000168// CHECK: Punctuation: "*" [6:20 - 6:21] ParmDecl=other:6:22 (Definition)
169// CHECK: Punctuation: ")" [6:21 - 6:22] ParmDecl=other:6:22 (Definition)
Douglas Gregore0610a42010-03-09 20:57:01 +0000170// CHECK: Identifier: "other" [6:22 - 6:27] ParmDecl=other:6:22 (Definition)
Ted Kremenekfbd84ca2010-05-05 00:55:23 +0000171// CHECK: Punctuation: "{" [6:28 - 6:29] UnexposedStmt=
172// CHECK: Keyword: "return" [7:3 - 7:9] UnexposedStmt=
173// CHECK: Literal: "0" [7:10 - 7:11] UnexposedExpr=
174// CHECK: Punctuation: ";" [7:11 - 7:12] UnexposedStmt=
175// CHECK: Punctuation: "(" [8:3 - 8:4] UnexposedExpr=
176// CHECK: Keyword: "void" [8:4 - 8:8] UnexposedExpr=
177// CHECK: Punctuation: ")" [8:8 - 8:9] UnexposedExpr=
178// CHECK: Punctuation: "@" [8:9 - 8:10] UnexposedExpr=
179// CHECK: Keyword: "encode" [8:10 - 8:16] UnexposedExpr=
180// CHECK: Punctuation: "(" [8:16 - 8:17] UnexposedExpr=
Douglas Gregor81d34662010-04-20 15:39:42 +0000181// CHECK: Identifier: "Foo" [8:17 - 8:20] ObjCClassRef=Foo:1:12
Ted Kremenekfbd84ca2010-05-05 00:55:23 +0000182// CHECK: Punctuation: ")" [8:20 - 8:21] UnexposedExpr=
183// CHECK: Punctuation: ";" [8:21 - 8:22] UnexposedStmt=
184// CHECK: Punctuation: "}" [9:1 - 9:2] UnexposedStmt=
185// CHECK: Punctuation: "@" [10:1 - 10:2] ObjCImplementationDecl=Foo:5:1 (Definition)
186// CHECK: Keyword: "end" [10:2 - 10:5]
Ted Kremeneka333c662010-05-12 05:29:33 +0000187// CHECK: Keyword: "typedef" [14:1 - 14:8]
188// CHECK: Keyword: "int" [14:9 - 14:12]
189// CHECK: Punctuation: "*" [14:13 - 14:14]
190// CHECK: Identifier: "barType" [14:15 - 14:22] TypedefDecl=barType:14:15 (Definition)
191// CHECK: Punctuation: ";" [14:22 - 14:23]
192// CHECK: Punctuation: "@" [15:1 - 15:2] ObjCInterfaceDecl=Bar:15:12
193// CHECK: Keyword: "interface" [15:2 - 15:11] ObjCInterfaceDecl=Bar:15:12
194// CHECK: Identifier: "Bar" [15:12 - 15:15] ObjCInterfaceDecl=Bar:15:12
195// CHECK: Punctuation: "{" [16:1 - 16:2] ObjCInterfaceDecl=Bar:15:12
196// CHECK: Identifier: "barType" [17:5 - 17:12] TypeRef=barType:14:15
197// CHECK: Identifier: "iVar" [17:13 - 17:17] ObjCIvarDecl=iVar:17:13 (Definition)
198// CHECK: Punctuation: ";" [17:17 - 17:18] ObjCInterfaceDecl=Bar:15:12
199// CHECK: Identifier: "barType" [18:5 - 18:12] TypeRef=barType:14:15
200// CHECK: Identifier: "iVar1" [18:13 - 18:18] ObjCIvarDecl=iVar1:18:13 (Definition)
201// CHECK: Punctuation: "," [18:18 - 18:19] ObjCIvarDecl=iVar2:18:20 (Definition)
202// CHECK: Identifier: "iVar2" [18:20 - 18:25] ObjCIvarDecl=iVar2:18:20 (Definition)
203// CHECK: Punctuation: ";" [18:25 - 18:26] ObjCInterfaceDecl=Bar:15:12
204// CHECK: Punctuation: "}" [19:1 - 19:2] ObjCInterfaceDecl=Bar:15:12
205// CHECK: Punctuation: "@" [20:1 - 20:2] ObjCInterfaceDecl=Bar:15:12
206// CHECK: Keyword: "end" [20:2 - 20:5] ObjCInterfaceDecl=Bar:15:12
207// CHECK: Punctuation: "@" [21:1 - 21:2] ObjCImplementationDecl=Bar:21:1 (Definition)
208// CHECK: Keyword: "implementation" [21:2 - 21:16] ObjCImplementationDecl=Bar:21:1 (Definition)
209// CHECK: Identifier: "Bar" [21:17 - 21:20] ObjCImplementationDecl=Bar:21:1 (Definition)
210// CHECK: Punctuation: "-" [22:1 - 22:2] ObjCInstanceMethodDecl=method:22:1 (Definition)
211// CHECK: Punctuation: "(" [22:3 - 22:4] ObjCInstanceMethodDecl=method:22:1 (Definition)
212// CHECK: Keyword: "void" [22:4 - 22:8] ObjCInstanceMethodDecl=method:22:1 (Definition)
213// CHECK: Punctuation: ")" [22:8 - 22:9] ObjCInstanceMethodDecl=method:22:1 (Definition)
214// CHECK: Identifier: "method" [22:10 - 22:16] ObjCInstanceMethodDecl=method:22:1 (Definition)
215// CHECK: Punctuation: "{" [23:1 - 23:2] UnexposedStmt=
216// CHECK: Identifier: "barType" [24:5 - 24:12] TypeRef=barType:14:15
217// CHECK: Identifier: "local" [24:13 - 24:18] VarDecl=local:24:13 (Definition)
218// CHECK: Punctuation: "=" [24:19 - 24:20] VarDecl=local:24:13 (Definition)
219// CHECK: Identifier: "iVar" [24:21 - 24:25] MemberRefExpr=iVar:17:13
220// CHECK: Punctuation: ";" [24:25 - 24:26] UnexposedStmt=
221// CHECK: Punctuation: "}" [25:1 - 25:2] UnexposedStmt=
222// CHECK: Punctuation: "@" [26:1 - 26:2] ObjCImplementationDecl=Bar:21:1 (Definition)
223// CHECK: Keyword: "end" [26:2 - 26:5]
Daniel Dunbare0530b02010-05-12 21:54:41 +0000224// CHECK: Punctuation: "@" [32:1 - 32:2] ObjCInterfaceDecl=IBActionTests:32:12
225// CHECK: Keyword: "interface" [32:2 - 32:11] ObjCInterfaceDecl=IBActionTests:32:12
226// CHECK: Identifier: "IBActionTests" [32:12 - 32:25] ObjCInterfaceDecl=IBActionTests:32:12
227// CHECK: Punctuation: "-" [33:1 - 33:2] ObjCInstanceMethodDecl=actionMethod::33:1
228// CHECK: Punctuation: "(" [33:3 - 33:4] ObjCInstanceMethodDecl=actionMethod::33:1
229// CHECK: Identifier: "IBAction" [33:4 - 33:12] macro instantiation=IBAction
230// CHECK: Punctuation: ")" [33:12 - 33:13] ObjCInstanceMethodDecl=actionMethod::33:1
231// CHECK: Identifier: "actionMethod" [33:14 - 33:26] ObjCInstanceMethodDecl=actionMethod::33:1
232// CHECK: Punctuation: ":" [33:26 - 33:27] ObjCInstanceMethodDecl=actionMethod::33:1
233// CHECK: Punctuation: "(" [33:27 - 33:28] ObjCInstanceMethodDecl=actionMethod::33:1
234// CHECK: Identifier: "id" [33:28 - 33:30] TypeRef=id:0:0
235// CHECK: Punctuation: ")" [33:30 - 33:31] ParmDecl=arg:33:31 (Definition)
236// CHECK: Identifier: "arg" [33:31 - 33:34] ParmDecl=arg:33:31 (Definition)
237// CHECK: Punctuation: ";" [33:34 - 33:35] ObjCInstanceMethodDecl=actionMethod::33:1
238// CHECK: Punctuation: "-" [34:1 - 34:2] ObjCInstanceMethodDecl=foo::34:1
239// CHECK: Punctuation: "(" [34:3 - 34:4] ObjCInstanceMethodDecl=foo::34:1
240// CHECK: Keyword: "void" [34:4 - 34:8] ObjCInstanceMethodDecl=foo::34:1
241// CHECK: Punctuation: ")" [34:8 - 34:9] ObjCInstanceMethodDecl=foo::34:1
242// CHECK: Identifier: "foo" [34:9 - 34:12] ObjCInstanceMethodDecl=foo::34:1
243// CHECK: Punctuation: ":" [34:12 - 34:13] ObjCInstanceMethodDecl=foo::34:1
244// CHECK: Punctuation: "(" [34:13 - 34:14] ObjCInstanceMethodDecl=foo::34:1
245// CHECK: Keyword: "int" [34:14 - 34:17] ParmDecl=x:34:18 (Definition)
246// CHECK: Punctuation: ")" [34:17 - 34:18] ParmDecl=x:34:18 (Definition)
247// CHECK: Identifier: "x" [34:18 - 34:19] ParmDecl=x:34:18 (Definition)
248// CHECK: Punctuation: ";" [34:19 - 34:20] ObjCInstanceMethodDecl=foo::34:1
249// CHECK: Punctuation: "@" [35:1 - 35:2] ObjCInterfaceDecl=IBActionTests:32:12
250// CHECK: Keyword: "end" [35:2 - 35:5] ObjCInterfaceDecl=IBActionTests:32:12
251// CHECK: Keyword: "extern" [36:1 - 36:7]
252// CHECK: Keyword: "int" [36:8 - 36:11] FunctionDecl=ibaction_test:36:12
253// CHECK: Identifier: "ibaction_test" [36:12 - 36:25] FunctionDecl=ibaction_test:36:12
254// CHECK: Punctuation: "(" [36:25 - 36:26] FunctionDecl=ibaction_test:36:12
255// CHECK: Keyword: "void" [36:26 - 36:30] FunctionDecl=ibaction_test:36:12
256// CHECK: Punctuation: ")" [36:30 - 36:31] FunctionDecl=ibaction_test:36:12
257// CHECK: Punctuation: ";" [36:31 - 36:32]
258// CHECK: Punctuation: "@" [37:1 - 37:2] ObjCImplementationDecl=IBActionTests:37:1 (Definition)
259// CHECK: Keyword: "implementation" [37:2 - 37:16] ObjCImplementationDecl=IBActionTests:37:1 (Definition)
260// CHECK: Identifier: "IBActionTests" [37:17 - 37:30] ObjCImplementationDecl=IBActionTests:37:1 (Definition)
261// CHECK: Punctuation: "-" [38:1 - 38:2] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition)
262// CHECK: Punctuation: "(" [38:3 - 38:4] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition)
263// CHECK: Identifier: "IBAction" [38:4 - 38:12] macro instantiation=IBAction
264// CHECK: Punctuation: ")" [38:12 - 38:13] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition)
265// CHECK: Identifier: "actionMethod" [38:14 - 38:26] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition)
266// CHECK: Punctuation: ":" [38:26 - 38:27] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition)
267// CHECK: Punctuation: "(" [38:27 - 38:28] ObjCInstanceMethodDecl=actionMethod::38:1 (Definition)
268// CHECK: Identifier: "id" [38:28 - 38:30] TypeRef=id:0:0
269// CHECK: Punctuation: ")" [38:30 - 38:31] ParmDecl=arg:38:31 (Definition)
270// CHECK: Identifier: "arg" [38:31 - 38:34] ParmDecl=arg:38:31 (Definition)
271// CHECK: Punctuation: "{" [39:1 - 39:2] UnexposedStmt=
272// CHECK: Identifier: "ibaction_test" [40:5 - 40:18] DeclRefExpr=ibaction_test:36:12
273// CHECK: Punctuation: "(" [40:18 - 40:19] CallExpr=ibaction_test:36:12
274// CHECK: Punctuation: ")" [40:19 - 40:20] CallExpr=ibaction_test:36:12
275// CHECK: Punctuation: ";" [40:20 - 40:21] UnexposedStmt=
276// CHECK: Punctuation: "[" [41:5 - 41:6] ObjCMessageExpr=foo::34:1
277// CHECK: Identifier: "self" [41:6 - 41:10] DeclRefExpr=self:0:0
278// CHECK: Identifier: "foo" [41:11 - 41:14] ObjCMessageExpr=foo::34:1
279// CHECK: Punctuation: ":" [41:14 - 41:15] ObjCMessageExpr=foo::34:1
280// CHECK: Literal: "0" [41:15 - 41:16] UnexposedExpr=
281// CHECK: Punctuation: "]" [41:16 - 41:17] ObjCMessageExpr=foo::34:1
282// CHECK: Punctuation: ";" [41:17 - 41:18] UnexposedStmt=
283// CHECK: Punctuation: "}" [42:1 - 42:2] UnexposedStmt=
284// CHECK: Punctuation: "-" [43:1 - 43:2] ObjCInstanceMethodDecl=foo::43:1 (Definition)
285// CHECK: Punctuation: "(" [43:3 - 43:4] ObjCInstanceMethodDecl=foo::43:1 (Definition)
286// CHECK: Keyword: "void" [43:4 - 43:8] ObjCInstanceMethodDecl=foo::43:1 (Definition)
287// CHECK: Punctuation: ")" [43:8 - 43:9] ObjCInstanceMethodDecl=foo::43:1 (Definition)
288// CHECK: Identifier: "foo" [43:10 - 43:13] ObjCInstanceMethodDecl=foo::43:1 (Definition)
289// CHECK: Punctuation: ":" [43:13 - 43:14] ObjCInstanceMethodDecl=foo::43:1 (Definition)
290// CHECK: Punctuation: "(" [43:14 - 43:15] ObjCInstanceMethodDecl=foo::43:1 (Definition)
291// CHECK: Keyword: "int" [43:15 - 43:18] ParmDecl=x:43:19 (Definition)
292// CHECK: Punctuation: ")" [43:18 - 43:19] ParmDecl=x:43:19 (Definition)
293// CHECK: Identifier: "x" [43:19 - 43:20] ParmDecl=x:43:19 (Definition)
294// CHECK: Punctuation: "{" [44:1 - 44:2] UnexposedStmt=
295// CHECK: Punctuation: "(" [45:3 - 45:4] UnexposedExpr=x:43:19
296// CHECK: Keyword: "void" [45:4 - 45:8] UnexposedExpr=x:43:19
297// CHECK: Punctuation: ")" [45:8 - 45:9] UnexposedExpr=x:43:19
298// CHECK: Identifier: "x" [45:10 - 45:11] DeclRefExpr=x:43:19
299// CHECK: Punctuation: ";" [45:11 - 45:12] UnexposedStmt=
300// CHECK: Punctuation: "}" [46:1 - 46:2] UnexposedStmt=
301// CHECK: Punctuation: "@" [47:1 - 47:2] ObjCImplementationDecl=IBActionTests:37:1 (Definition)
302// CHECK: Keyword: "end" [47:2 - 47:5]
303// CHECK: Punctuation: "@" [51:1 - 51:2] ObjCInterfaceDecl=IBOutletTests:51:12
304// CHECK: Keyword: "interface" [51:2 - 51:11] ObjCInterfaceDecl=IBOutletTests:51:12
305// CHECK: Identifier: "IBOutletTests" [51:12 - 51:25] ObjCInterfaceDecl=IBOutletTests:51:12
306// CHECK: Punctuation: "{" [52:1 - 52:2] ObjCInterfaceDecl=IBOutletTests:51:12
Ted Kremenekd8b0a842010-08-25 22:16:02 +0000307// CHECK: Identifier: "IBOutlet" [53:5 - 53:13] macro instantiation=IBOutlet
Daniel Dunbare0530b02010-05-12 21:54:41 +0000308// CHECK: Keyword: "char" [53:14 - 53:18] ObjCIvarDecl=anOutlet:53:21 (Definition)
309// CHECK: Punctuation: "*" [53:19 - 53:20] ObjCIvarDecl=anOutlet:53:21 (Definition)
310// CHECK: Identifier: "anOutlet" [53:21 - 53:29] ObjCIvarDecl=anOutlet:53:21 (Definition)
311// CHECK: Punctuation: ";" [53:29 - 53:30] ObjCInterfaceDecl=IBOutletTests:51:12
312// CHECK: Punctuation: "}" [54:1 - 54:2] ObjCInterfaceDecl=IBOutletTests:51:12
Douglas Gregorbdb2d502010-12-21 17:34:17 +0000313// CHECK: Punctuation: "-" [55:1 - 55:2] ObjCInstanceMethodDecl=actionMethod::55:1
314// CHECK: Punctuation: "(" [55:3 - 55:4] ObjCInstanceMethodDecl=actionMethod::55:1
315// CHECK: Identifier: "IBAction" [55:4 - 55:12] macro instantiation=IBAction:146:9
316// CHECK: Punctuation: ")" [55:12 - 55:13] ObjCInstanceMethodDecl=actionMethod::55:1
317// CHECK: Identifier: "actionMethod" [55:14 - 55:26] ObjCInstanceMethodDecl=actionMethod::55:1
318// CHECK: Punctuation: ":" [55:26 - 55:27] ObjCInstanceMethodDecl=actionMethod::55:1
319// CHECK: Punctuation: "(" [55:27 - 55:28] ObjCInstanceMethodDecl=actionMethod::55:1
320// CHECK: Identifier: "id" [55:28 - 55:30] TypeRef=id:0:0
321// CHECK: Punctuation: ")" [55:30 - 55:31] ParmDecl=arg:55:31 (Definition)
322// CHECK: Identifier: "arg" [55:31 - 55:34] ParmDecl=arg:55:31 (Definition)
323// CHECK: Punctuation: ";" [55:34 - 55:35] ObjCInstanceMethodDecl=actionMethod::55:1
Douglas Gregore3c60a72010-11-17 00:13:31 +0000324// CHECK: Punctuation: "@" [56:1 - 56:2] ObjCPropertyDecl=aPropOutlet:56:26
325// CHECK: Keyword: "property" [56:2 - 56:10] ObjCPropertyDecl=aPropOutlet:56:26
Ted Kremenekd8b0a842010-08-25 22:16:02 +0000326// CHECK: Identifier: "IBOutlet" [56:11 - 56:19] macro instantiation=IBOutlet
Douglas Gregore3c60a72010-11-17 00:13:31 +0000327// CHECK: Keyword: "int" [56:20 - 56:23] ObjCPropertyDecl=aPropOutlet:56:26
328// CHECK: Punctuation: "*" [56:24 - 56:25] ObjCPropertyDecl=aPropOutlet:56:26
Daniel Dunbare0530b02010-05-12 21:54:41 +0000329// CHECK: Identifier: "aPropOutlet" [56:26 - 56:37] ObjCPropertyDecl=aPropOutlet:56:26
330// CHECK: Punctuation: ";" [56:37 - 56:38] ObjCInterfaceDecl=IBOutletTests:51:12
331// CHECK: Punctuation: "@" [57:1 - 57:2] ObjCInterfaceDecl=IBOutletTests:51:12
332// CHECK: Keyword: "end" [57:2 - 57:5] ObjCInterfaceDecl=IBOutletTests:51:12
Ted Kremenekd8b0a842010-08-25 22:16:02 +0000333// CHECK: Punctuation: "#" [63:1 - 63:2] preprocessing directive=
334// CHECK: Identifier: "define" [63:2 - 63:8] preprocessing directive=
335// CHECK: Identifier: "VAL" [63:9 - 63:12] macro definition=VAL
Douglas Gregor4419b672010-10-21 06:10:04 +0000336// CHECK: Literal: "0" [63:13 - 63:14] macro definition=VAL
Ted Kremenekd8b0a842010-08-25 22:16:02 +0000337// CHECK: Punctuation: "@" [65:1 - 65:2] ObjCInterfaceDecl=R7974151:65:12
338// CHECK: Keyword: "interface" [65:2 - 65:11] ObjCInterfaceDecl=R7974151:65:12
339// CHECK: Identifier: "R7974151" [65:12 - 65:20] ObjCInterfaceDecl=R7974151:65:12
340// CHECK: Punctuation: "-" [66:1 - 66:2] ObjCInstanceMethodDecl=foo::66:1
341// CHECK: Punctuation: "(" [66:3 - 66:4] ObjCInstanceMethodDecl=foo::66:1
342// CHECK: Keyword: "int" [66:4 - 66:7] ObjCInstanceMethodDecl=foo::66:1
343// CHECK: Punctuation: ")" [66:7 - 66:8] ObjCInstanceMethodDecl=foo::66:1
344// CHECK: Identifier: "foo" [66:9 - 66:12] ObjCInstanceMethodDecl=foo::66:1
345// CHECK: Punctuation: ":" [66:12 - 66:13] ObjCInstanceMethodDecl=foo::66:1
346// CHECK: Punctuation: "(" [66:13 - 66:14] ObjCInstanceMethodDecl=foo::66:1
347// CHECK: Keyword: "int" [66:14 - 66:17] ParmDecl=arg:66:18 (Definition)
348// CHECK: Punctuation: ")" [66:17 - 66:18] ParmDecl=arg:66:18 (Definition)
349// CHECK: Identifier: "arg" [66:18 - 66:21] ParmDecl=arg:66:18 (Definition)
350// CHECK: Punctuation: ";" [66:21 - 66:22] ObjCInstanceMethodDecl=foo::66:1
351// CHECK: Punctuation: "-" [67:1 - 67:2] ObjCInstanceMethodDecl=method:67:1
352// CHECK: Punctuation: "(" [67:3 - 67:4] ObjCInstanceMethodDecl=method:67:1
353// CHECK: Keyword: "int" [67:4 - 67:7] ObjCInstanceMethodDecl=method:67:1
354// CHECK: Punctuation: ")" [67:7 - 67:8] ObjCInstanceMethodDecl=method:67:1
355// CHECK: Identifier: "method" [67:9 - 67:15] ObjCInstanceMethodDecl=method:67:1
356// CHECK: Punctuation: ";" [67:15 - 67:16] ObjCInstanceMethodDecl=method:67:1
357// CHECK: Punctuation: "@" [68:1 - 68:2] ObjCInterfaceDecl=R7974151:65:12
358// CHECK: Keyword: "end" [68:2 - 68:5] ObjCInterfaceDecl=R7974151:65:12
359// CHECK: Punctuation: "@" [70:1 - 70:2] ObjCImplementationDecl=R7974151:70:1 (Definition)
360// CHECK: Keyword: "implementation" [70:2 - 70:16] ObjCImplementationDecl=R7974151:70:1 (Definition)
361// CHECK: Identifier: "R7974151" [70:17 - 70:25] ObjCImplementationDecl=R7974151:70:1 (Definition)
362// CHECK: Punctuation: "-" [71:1 - 71:2] ObjCInstanceMethodDecl=foo::71:1 (Definition)
363// CHECK: Punctuation: "(" [71:3 - 71:4] ObjCInstanceMethodDecl=foo::71:1 (Definition)
364// CHECK: Keyword: "int" [71:4 - 71:7] ObjCInstanceMethodDecl=foo::71:1 (Definition)
365// CHECK: Punctuation: ")" [71:7 - 71:8] ObjCInstanceMethodDecl=foo::71:1 (Definition)
366// CHECK: Identifier: "foo" [71:9 - 71:12] ObjCInstanceMethodDecl=foo::71:1 (Definition)
367// CHECK: Punctuation: ":" [71:12 - 71:13] ObjCInstanceMethodDecl=foo::71:1 (Definition)
368// CHECK: Punctuation: "(" [71:13 - 71:14] ObjCInstanceMethodDecl=foo::71:1 (Definition)
369// CHECK: Keyword: "int" [71:14 - 71:17] ParmDecl=arg:71:18 (Definition)
370// CHECK: Punctuation: ")" [71:17 - 71:18] ParmDecl=arg:71:18 (Definition)
371// CHECK: Identifier: "arg" [71:18 - 71:21] ParmDecl=arg:71:18 (Definition)
372// CHECK: Punctuation: "{" [71:22 - 71:23] UnexposedStmt=
373// CHECK: Keyword: "return" [72:3 - 72:9] UnexposedStmt=
374// CHECK: Identifier: "arg" [72:10 - 72:13] DeclRefExpr=arg:71:18
375// CHECK: Punctuation: ";" [72:13 - 72:14] UnexposedStmt=
376// CHECK: Punctuation: "}" [73:1 - 73:2] UnexposedStmt=
377// CHECK: Punctuation: "-" [74:1 - 74:2] ObjCInstanceMethodDecl=method:74:1 (Definition)
378// CHECK: Punctuation: "(" [74:3 - 74:4] ObjCInstanceMethodDecl=method:74:1 (Definition)
379// CHECK: Keyword: "int" [74:4 - 74:7] ObjCInstanceMethodDecl=method:74:1 (Definition)
380// CHECK: Punctuation: ")" [74:7 - 74:8] ObjCInstanceMethodDecl=method:74:1 (Definition)
381// CHECK: Identifier: "method" [74:9 - 74:15] ObjCInstanceMethodDecl=method:74:1 (Definition)
382// CHECK: Punctuation: "{" [75:1 - 75:2] UnexposedStmt=
383// CHECK: Keyword: "int" [76:5 - 76:8] VarDecl=local:76:9 (Definition)
384// CHECK: Identifier: "local" [76:9 - 76:14] VarDecl=local:76:9 (Definition)
385// CHECK: Punctuation: "=" [76:15 - 76:16] VarDecl=local:76:9 (Definition)
386// CHECK: Punctuation: "[" [76:17 - 76:18] ObjCMessageExpr=foo::66:1
387// CHECK: Identifier: "self" [76:18 - 76:22] DeclRefExpr=self:0:0
388// CHECK: Identifier: "foo" [76:23 - 76:26] ObjCMessageExpr=foo::66:1
389// CHECK: Punctuation: ":" [76:26 - 76:27] ObjCMessageExpr=foo::66:1
390// CHECK: Identifier: "VAL" [76:27 - 76:30] macro instantiation=VAL:63:9
391// CHECK: Punctuation: "]" [76:30 - 76:31] ObjCMessageExpr=foo::66:1
392// CHECK: Punctuation: ";" [76:31 - 76:32] UnexposedStmt=
393// CHECK: Keyword: "int" [77:5 - 77:8] VarDecl=second:77:9 (Definition)
394// CHECK: Identifier: "second" [77:9 - 77:15] VarDecl=second:77:9 (Definition)
395// CHECK: Punctuation: "=" [77:16 - 77:17] VarDecl=second:77:9 (Definition)
396// CHECK: Punctuation: "[" [77:18 - 77:19] ObjCMessageExpr=foo::66:1
397// CHECK: Identifier: "self" [77:19 - 77:23] DeclRefExpr=self:0:0
398// CHECK: Identifier: "foo" [77:24 - 77:27] ObjCMessageExpr=foo::66:1
399// CHECK: Punctuation: ":" [77:27 - 77:28] ObjCMessageExpr=foo::66:1
400// CHECK: Literal: "0" [77:28 - 77:29] UnexposedExpr=
401// CHECK: Punctuation: "]" [77:29 - 77:30] ObjCMessageExpr=foo::66:1
402// CHECK: Punctuation: ";" [77:30 - 77:31] UnexposedStmt=
403// CHECK: Keyword: "return" [78:5 - 78:11] UnexposedStmt=
404// CHECK: Identifier: "local" [78:12 - 78:17] DeclRefExpr=local:76:9
405// CHECK: Punctuation: ";" [78:17 - 78:18] UnexposedStmt=
406// CHECK: Punctuation: "}" [79:1 - 79:2] UnexposedStmt=
Douglas Gregordb1314e2010-10-01 21:11:22 +0000407// CHECK: Punctuation: "-" [80:1 - 80:2] ObjCInstanceMethodDecl=othermethod::80:1 (Definition)
408// CHECK: Punctuation: "(" [80:3 - 80:4] ObjCInstanceMethodDecl=othermethod::80:1 (Definition)
409// CHECK: Keyword: "int" [80:4 - 80:7] ObjCInstanceMethodDecl=othermethod::80:1 (Definition)
410// CHECK: Punctuation: ")" [80:7 - 80:8] ObjCInstanceMethodDecl=othermethod::80:1 (Definition)
411// CHECK: Identifier: "othermethod" [80:8 - 80:19] ObjCInstanceMethodDecl=othermethod::80:1 (Definition)
412// CHECK: Punctuation: ":" [80:19 - 80:20] ObjCInstanceMethodDecl=othermethod::80:1 (Definition)
413// CHECK: Punctuation: "(" [80:20 - 80:21] ObjCInstanceMethodDecl=othermethod::80:1 (Definition)
414// CHECK: Identifier: "IBOutletTests" [80:21 - 80:34] ObjCClassRef=IBOutletTests:51:12
415// CHECK: Punctuation: "*" [80:35 - 80:36] ParmDecl=ibt:80:37 (Definition)
416// CHECK: Punctuation: ")" [80:36 - 80:37] ParmDecl=ibt:80:37 (Definition)
417// CHECK: Identifier: "ibt" [80:37 - 80:40] ParmDecl=ibt:80:37 (Definition)
418// CHECK: Punctuation: "{" [80:41 - 80:42] UnexposedStmt=
419// CHECK: Keyword: "return" [81:3 - 81:9] UnexposedStmt=
420// CHECK: Punctuation: "*" [81:10 - 81:11] UnexposedExpr=
421// CHECK: Identifier: "ibt" [81:11 - 81:14] DeclRefExpr=ibt:80:37
422// CHECK: Punctuation: "." [81:14 - 81:15] MemberRefExpr=aPropOutlet:56:26
423// CHECK: Identifier: "aPropOutlet" [81:15 - 81:26] MemberRefExpr=aPropOutlet:56:26
424// CHECK: Punctuation: ";" [81:26 - 81:27] UnexposedStmt=
425// CHECK: Punctuation: "}" [82:1 - 82:2] UnexposedStmt=
426// CHECK: Punctuation: "@" [83:1 - 83:2] ObjCImplementationDecl=R7974151:70:1 (Definition)
427// CHECK: Keyword: "end" [83:2 - 83:5]
428// CHECK: Punctuation: "@" [85:1 - 85:2] ObjCProtocolDecl=Proto:85:1 (Definition)
429// CHECK: Keyword: "protocol" [85:2 - 85:10] ObjCProtocolDecl=Proto:85:1 (Definition)
430// CHECK: Identifier: "Proto" [85:11 - 85:16] ObjCProtocolDecl=Proto:85:1 (Definition)
431// CHECK: Punctuation: "@" [85:17 - 85:18] ObjCProtocolDecl=Proto:85:1 (Definition)
432// CHECK: Keyword: "end" [85:18 - 85:21] ObjCProtocolDecl=Proto:85:1 (Definition)
433// CHECK: Keyword: "void" [87:1 - 87:5] FunctionDecl=f:87:6 (Definition)
434// CHECK: Identifier: "f" [87:6 - 87:7] FunctionDecl=f:87:6 (Definition)
435// CHECK: Punctuation: "(" [87:7 - 87:8] FunctionDecl=f:87:6 (Definition)
436// CHECK: Punctuation: ")" [87:8 - 87:9] FunctionDecl=f:87:6 (Definition)
437// CHECK: Punctuation: "{" [87:10 - 87:11] UnexposedStmt=
438// CHECK: Punctuation: "(" [88:3 - 88:4] UnexposedExpr=Proto:85:1
439// CHECK: Keyword: "void" [88:4 - 88:8] UnexposedExpr=Proto:85:1
440// CHECK: Punctuation: ")" [88:8 - 88:9] UnexposedExpr=Proto:85:1
441// CHECK: Punctuation: "@" [88:9 - 88:10] UnexposedExpr=Proto:85:1
442// CHECK: Keyword: "protocol" [88:10 - 88:18] UnexposedExpr=Proto:85:1
443// CHECK: Punctuation: "(" [88:18 - 88:19] UnexposedExpr=Proto:85:1
444// CHECK: Identifier: "Proto" [88:19 - 88:24] UnexposedExpr=Proto:85:1
445// CHECK: Punctuation: ")" [88:24 - 88:25] UnexposedExpr=Proto:85:1
446// CHECK: Punctuation: ";" [88:25 - 88:26] UnexposedStmt=
447// CHECK: Punctuation: "}" [89:1 - 89:2] UnexposedStmt=
Ted Kremenekd8c370c2010-11-02 23:10:24 +0000448// CHECK: Punctuation: "@" [93:1 - 93:2] UnexposedDecl=[93:8]
449// CHECK: Keyword: "class" [93:2 - 93:7] UnexposedDecl=[93:8]
450// CHECK: Identifier: "Rdar8595462_A" [93:8 - 93:21] ObjCClassRef=Rdar8595462_A:93:8
451// CHECK: Punctuation: ";" [93:21 - 93:22]
452// CHECK: Punctuation: "@" [94:1 - 94:2] ObjCInterfaceDecl=Rdar8595462_B:94:12
453// CHECK: Keyword: "interface" [94:2 - 94:11] ObjCInterfaceDecl=Rdar8595462_B:94:12
454// CHECK: Identifier: "Rdar8595462_B" [94:12 - 94:25] ObjCInterfaceDecl=Rdar8595462_B:94:12
455// CHECK: Punctuation: "@" [95:1 - 95:2] ObjCInterfaceDecl=Rdar8595462_B:94:12
456// CHECK: Keyword: "end" [95:2 - 95:5] ObjCInterfaceDecl=Rdar8595462_B:94:12
457// CHECK: Punctuation: "@" [97:1 - 97:2] ObjCImplementationDecl=Rdar8595462_B:97:1 (Definition)
458// CHECK: Keyword: "implementation" [97:2 - 97:16] ObjCImplementationDecl=Rdar8595462_B:97:1 (Definition)
459// CHECK: Identifier: "Rdar8595462_B" [97:17 - 97:30] ObjCImplementationDecl=Rdar8595462_B:97:1 (Definition)
460// CHECK: Identifier: "Rdar8595462_A" [98:1 - 98:14] ObjCClassRef=Rdar8595462_A:93:8
461// CHECK: Punctuation: "*" [98:15 - 98:16] FunctionDecl=Rdar8595462_aFunction:98:17 (Definition)
462// CHECK: Identifier: "Rdar8595462_aFunction" [98:17 - 98:38] FunctionDecl=Rdar8595462_aFunction:98:17 (Definition)
463// CHECK: Punctuation: "(" [98:38 - 98:39] FunctionDecl=Rdar8595462_aFunction:98:17 (Definition)
464// CHECK: Punctuation: ")" [98:39 - 98:40] FunctionDecl=Rdar8595462_aFunction:98:17 (Definition)
465// CHECK: Punctuation: "{" [98:41 - 98:42] UnexposedStmt=
466// CHECK: Identifier: "Rdar8595462_A" [99:3 - 99:16] ObjCClassRef=Rdar8595462_A:93:8
467// CHECK: Punctuation: "*" [99:17 - 99:18] VarDecl=localVar:99:19 (Definition)
468// CHECK: Identifier: "localVar" [99:19 - 99:27] VarDecl=localVar:99:19 (Definition)
469// CHECK: Punctuation: "=" [99:28 - 99:29] VarDecl=localVar:99:19 (Definition)
470// CHECK: Literal: "0" [99:30 - 99:31] UnexposedExpr=
471// CHECK: Punctuation: ";" [99:31 - 99:32] UnexposedStmt=
472// CHECK: Keyword: "return" [100:3 - 100:9] UnexposedStmt=
473// CHECK: Identifier: "localVar" [100:10 - 100:18] DeclRefExpr=localVar:99:19
474// CHECK: Punctuation: ";" [100:18 - 100:19] UnexposedStmt=
475// CHECK: Punctuation: "}" [101:1 - 101:2] UnexposedStmt=
476// CHECK: Keyword: "static" [102:1 - 102:7] ObjCImplementationDecl=Rdar8595462_B:97:1 (Definition)
477// CHECK: Identifier: "Rdar8595462_A" [102:8 - 102:21] ObjCClassRef=Rdar8595462_A:93:8
478// CHECK: Punctuation: "*" [102:22 - 102:23] VarDecl=Rdar8595462_staticVar:102:24
479// CHECK: Identifier: "Rdar8595462_staticVar" [102:24 - 102:45] VarDecl=Rdar8595462_staticVar:102:24
480// CHECK: Punctuation: ";" [102:45 - 102:46] ObjCImplementationDecl=Rdar8595462_B:97:1 (Definition)
481// CHECK: Punctuation: "@" [103:1 - 103:2] ObjCImplementationDecl=Rdar8595462_B:97:1 (Definition)
482// CHECK: Keyword: "end" [103:2 - 103:5]
483
Douglas Gregore3c60a72010-11-17 00:13:31 +0000484// CHECK: Punctuation: "@" [110:1 - 110:2] ObjCPropertyDecl=foo:110:33
485// CHECK: Keyword: "property" [110:2 - 110:10] ObjCPropertyDecl=foo:110:33
486// CHECK: Punctuation: "(" [110:11 - 110:12] ObjCPropertyDecl=foo:110:33
487// CHECK: Identifier: "readonly" [110:12 - 110:20] ObjCPropertyDecl=foo:110:33
488// CHECK: Punctuation: "," [110:20 - 110:21] ObjCPropertyDecl=foo:110:33
489// CHECK: Identifier: "copy" [110:22 - 110:26] ObjCPropertyDecl=foo:110:33
490// CHECK: Punctuation: ")" [110:26 - 110:27] ObjCPropertyDecl=foo:110:33
491// CHECK: Identifier: "Foo" [110:28 - 110:31] ObjCClassRef=Foo:1:12
492// CHECK: Punctuation: "*" [110:32 - 110:33] ObjCPropertyDecl=foo:110:33
493// CHECK: Identifier: "foo" [110:33 - 110:36] ObjCPropertyDecl=foo:110:33
494// CHECK: Keyword: "property" [111:2 - 111:10] ObjCPropertyDecl=foo2:111:27
495// CHECK: Punctuation: "(" [111:11 - 111:12] ObjCPropertyDecl=foo2:111:27
496// CHECK: Identifier: "readonly" [111:12 - 111:20] ObjCPropertyDecl=foo2:111:27
497// CHECK: Punctuation: ")" [111:20 - 111:21] ObjCPropertyDecl=foo2:111:27
498// CHECK: Identifier: "Foo" [111:22 - 111:25] ObjCClassRef=Foo:1:12
499// CHECK: Punctuation: "*" [111:26 - 111:27] ObjCPropertyDecl=foo2:111:27
500// CHECK: Identifier: "foo2" [111:27 - 111:31] ObjCPropertyDecl=foo2:111:27
501
Douglas Gregora4ffd852010-11-17 01:03:52 +0000502// CHECK: Punctuation: "@" [115:1 - 115:2] UnexposedDecl=foo:110:33 (Definition)
503// CHECK: Keyword: "synthesize" [115:2 - 115:12] UnexposedDecl=foo:110:33 (Definition)
504// CHECK: Identifier: "foo" [115:13 - 115:16] UnexposedDecl=foo:110:33 (Definition)
505// CHECK: Punctuation: "=" [115:17 - 115:18] UnexposedDecl=foo:110:33 (Definition)
506// CHECK: Identifier: "_foo" [115:19 - 115:23] MemberRef=_foo:107:8
507// CHECK: Punctuation: ";" [115:23 - 115:24] ObjCImplementationDecl=Rdar8595386:114:1 (Definition)
Douglas Gregor2fcbcef2010-12-21 16:27:07 +0000508
509// RUN: c-index-test -test-annotate-tokens=%s:127:1:130:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' | FileCheck -check-prefix=CHECK-INSIDE_BLOCK %s
510// CHECK-INSIDE_BLOCK: Keyword: "int" [127:5 - 127:8] VarDecl=result:127:9 (Definition)
511// CHECK-INSIDE_BLOCK: Identifier: "result" [127:9 - 127:15] VarDecl=result:127:9 (Definition)
512// CHECK-INSIDE_BLOCK: Punctuation: "=" [127:16 - 127:17] VarDecl=result:127:9 (Definition)
513// CHECK-INSIDE_BLOCK: Punctuation: "[" [127:18 - 127:19] ObjCMessageExpr=blah::124:1
514// CHECK-INSIDE_BLOCK: Identifier: "self" [127:19 - 127:23] DeclRefExpr=self:0:0
515// CHECK-INSIDE_BLOCK: Identifier: "blah" [127:24 - 127:28] ObjCMessageExpr=blah::124:1
516// CHECK-INSIDE_BLOCK: Punctuation: ":" [127:28 - 127:29] ObjCMessageExpr=blah::124:1
517// CHECK-INSIDE_BLOCK: Literal: "5" [127:29 - 127:30] UnexposedExpr=
518// CHECK-INSIDE_BLOCK: Punctuation: "," [127:30 - 127:31] ObjCMessageExpr=blah::124:1
519// CHECK-INSIDE_BLOCK: Identifier: "x" [127:32 - 127:33] DeclRefExpr=x:125:19
520// CHECK-INSIDE_BLOCK: Punctuation: "]" [127:33 - 127:34] ObjCMessageExpr=blah::124:1
521// CHECK-INSIDE_BLOCK: Punctuation: ";" [127:34 - 127:35] UnexposedStmt=
522// CHECK-INSIDE_BLOCK: Identifier: "Rdar8778404" [128:5 - 128:16] ObjCClassRef=Rdar8778404:120:12
523// CHECK-INSIDE_BLOCK: Punctuation: "*" [128:17 - 128:18] VarDecl=a:128:18 (Definition)
524// CHECK-INSIDE_BLOCK: Identifier: "a" [128:18 - 128:19] VarDecl=a:128:18 (Definition)
525// CHECK-INSIDE_BLOCK: Punctuation: "=" [128:20 - 128:21] VarDecl=a:128:18 (Definition)
526// CHECK-INSIDE_BLOCK: Identifier: "self" [128:22 - 128:26] DeclRefExpr=self:0:0
Douglas Gregorbdb2d502010-12-21 17:34:17 +0000527
528// RUN: c-index-test -test-annotate-tokens=%s:134:1:137:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' | FileCheck -check-prefix=CHECK-PROP-AFTER-METHOD %s
529// CHECK-PROP-AFTER-METHOD: Punctuation: "@" [134:1 - 134:2] ObjCInterfaceDecl=Rdar8062781:134:12
530// CHECK-PROP-AFTER-METHOD: Keyword: "interface" [134:2 - 134:11] ObjCInterfaceDecl=Rdar8062781:134:12
531// CHECK-PROP-AFTER-METHOD: Identifier: "Rdar8062781" [134:12 - 134:23] ObjCInterfaceDecl=Rdar8062781:134:12
532// CHECK-PROP-AFTER-METHOD: Punctuation: "+" [135:1 - 135:2] ObjCClassMethodDecl=getB:135:1
533// CHECK-PROP-AFTER-METHOD: Punctuation: "(" [135:3 - 135:4] ObjCClassMethodDecl=getB:135:1
534// CHECK-PROP-AFTER-METHOD: Identifier: "Foo" [135:4 - 135:7] ObjCClassRef=Foo:1:12
535// CHECK-PROP-AFTER-METHOD: Punctuation: "*" [135:7 - 135:8] ObjCClassMethodDecl=getB:135:1
536// CHECK-PROP-AFTER-METHOD: Punctuation: ")" [135:8 - 135:9] ObjCClassMethodDecl=getB:135:1
537// CHECK-PROP-AFTER-METHOD: Identifier: "getB" [135:9 - 135:13] ObjCClassMethodDecl=getB:135:1
538// CHECK-PROP-AFTER-METHOD: Punctuation: ";" [135:13 - 135:14] ObjCClassMethodDecl=getB:135:1
539// CHECK-PROP-AFTER-METHOD: Punctuation: "@" [136:1 - 136:2] ObjCPropertyDecl=blah:136:38
540// CHECK-PROP-AFTER-METHOD: Keyword: "property" [136:2 - 136:10] ObjCPropertyDecl=blah:136:38
541// CHECK-PROP-AFTER-METHOD: Punctuation: "(" [136:11 - 136:12] ObjCPropertyDecl=blah:136:38
542// CHECK-PROP-AFTER-METHOD: Identifier: "readonly" [136:12 - 136:20] ObjCPropertyDecl=blah:136:38
543// CHECK-PROP-AFTER-METHOD: Punctuation: "," [136:20 - 136:21] ObjCPropertyDecl=blah:136:38
544// CHECK-PROP-AFTER-METHOD: Identifier: "nonatomic" [136:22 - 136:31] ObjCPropertyDecl=blah:136:38
545// CHECK-PROP-AFTER-METHOD: Punctuation: ")" [136:31 - 136:32] ObjCPropertyDecl=blah:136:38
546// CHECK-PROP-AFTER-METHOD: Identifier: "Foo" [136:33 - 136:36] ObjCClassRef=Foo:1:12
547// CHECK-PROP-AFTER-METHOD: Punctuation: "*" [136:37 - 136:38] ObjCPropertyDecl=blah:136:38
548// CHECK-PROP-AFTER-METHOD: Identifier: "blah" [136:38 - 136:42] ObjCPropertyDecl=blah:136:38
549// CHECK-PROP-AFTER-METHOD: Punctuation: ";" [136:42 - 136:43] ObjCInterfaceDecl=Rdar8062781:134:12
550// CHECK-PROP-AFTER-METHOD: Punctuation: "@" [137:1 - 137:2] ObjCInterfaceDecl=Rdar8062781:134:12