blob: ce399d34c6f2b89b4a8d3ca6f45d42b9a6d9d5c5 [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
Douglas Gregor81d34662010-04-20 15:39:42 +000012// RUN: c-index-test -test-annotate-tokens=%s:1:1:10:5 %s | FileCheck %s
Douglas Gregor98146a62010-03-09 13:06:04 +000013// CHECK: Punctuation: "@" [1:1 - 1:2]
14// CHECK: Identifier: "interface" [1:2 - 1:11]
15// CHECK: Identifier: "Foo" [1:12 - 1:15] ObjCInterfaceDecl=Foo:1:12
16// CHECK: Punctuation: "-" [2:1 - 2:2] ObjCInstanceMethodDecl=compare::2:1
17// CHECK: Punctuation: "(" [2:3 - 2:4]
18// CHECK: Keyword: "int" [2:4 - 2:7]
19// CHECK: Punctuation: ")" [2:7 - 2:8]
20// CHECK: Identifier: "compare" [2:8 - 2:15]
21// CHECK: Punctuation: ":" [2:15 - 2:16]
22// CHECK: Punctuation: "(" [2:16 - 2:17]
23// CHECK: Identifier: "Foo" [2:17 - 2:20] ObjCClassRef=Foo:1:12
24// CHECK: Punctuation: "*" [2:20 - 2:21]
25// CHECK: Punctuation: ")" [2:21 - 2:22]
26// CHECK: Identifier: "other" [2:22 - 2:27] ParmDecl=other:2:22 (Definition)
27// CHECK: Punctuation: ";" [2:27 - 2:28]
28// CHECK: Punctuation: "@" [3:1 - 3:2]
29// CHECK: Identifier: "end" [3:2 - 3:5]
Douglas Gregore0610a42010-03-09 20:57:01 +000030// CHECK: Punctuation: "@" [5:1 - 5:2] ObjCImplementationDecl=Foo:5:1 (Definition)
31// CHECK: Identifier: "implementation" [5:2 - 5:16]
32// CHECK: Identifier: "Foo" [5:17 - 5:20]
33// CHECK: Punctuation: "-" [6:1 - 6:2] ObjCInstanceMethodDecl=compare::6:1 (Definition)
34// CHECK: Punctuation: "(" [6:3 - 6:4]
35// CHECK: Keyword: "int" [6:4 - 6:7]
36// CHECK: Punctuation: ")" [6:7 - 6:8]
37// CHECK: Identifier: "compare" [6:8 - 6:15]
38// CHECK: Punctuation: ":" [6:15 - 6:16]
39// CHECK: Punctuation: "(" [6:16 - 6:17]
40// CHECK: Identifier: "Foo" [6:17 - 6:20] ObjCClassRef=Foo:1:12
41// CHECK: Punctuation: "*" [6:20 - 6:21]
42// CHECK: Punctuation: ")" [6:21 - 6:22]
43// CHECK: Identifier: "other" [6:22 - 6:27] ParmDecl=other:6:22 (Definition)
44// CHECK: Punctuation: "{" [6:28 - 6:29]
45// CHECK: Keyword: "return" [7:3 - 7:9]
46// CHECK: Literal: "0" [7:10 - 7:11]
47// CHECK: Punctuation: ";" [7:11 - 7:12]
Douglas Gregor81d34662010-04-20 15:39:42 +000048// CHECK: Punctuation: "(" [8:3 - 8:4]
49// CHECK: Keyword: "void" [8:4 - 8:8]
50// CHECK: Punctuation: ")" [8:8 - 8:9]
51// CHECK: Punctuation: "@" [8:9 - 8:10]
52// CHECK: Identifier: "encode" [8:10 - 8:16]
53// CHECK: Punctuation: "(" [8:16 - 8:17]
54// CHECK: Identifier: "Foo" [8:17 - 8:20] ObjCClassRef=Foo:1:12
55// CHECK: Punctuation: ")" [8:20 - 8:21]
56// CHECK: Punctuation: ";" [8:21 - 8:22]
57// CHECK: Punctuation: "}" [9:1 - 9:2]
58// CHECK: Punctuation: "@" [10:1 - 10:2]
59// CHECK: Identifier: "end" [10:2 - 10:5]