annotate clang/test/Index/c-index-getCursor-test.m @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: c-index-test -write-pch %t.ast -arch x86_64 -mmacosx-version-min=10.6 -fblocks -x objective-c %s
anatofuz
parents:
diff changeset
2 // RUN: c-index-test -test-file-scan %t.ast %s > %t 2>&1 && FileCheck --input-file=%t %s
anatofuz
parents:
diff changeset
3 @interface Foo
anatofuz
parents:
diff changeset
4 {
anatofuz
parents:
diff changeset
5 }
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 - foo;
anatofuz
parents:
diff changeset
8 + fooC;
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 @end
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 @interface Bar : Foo
anatofuz
parents:
diff changeset
13 {
anatofuz
parents:
diff changeset
14 }
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 @end
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 @interface Foo (FooCat)
anatofuz
parents:
diff changeset
19 - (int) catMethodWithFloat:(float) fArg;
anatofuz
parents:
diff changeset
20 - (float) floatMethod;
anatofuz
parents:
diff changeset
21 @end
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 @protocol Proto
anatofuz
parents:
diff changeset
24 - pMethod;
anatofuz
parents:
diff changeset
25 @end
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 @protocol SubP <Proto>
anatofuz
parents:
diff changeset
28 - spMethod;
anatofuz
parents:
diff changeset
29 @end
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 @interface Baz : Bar <SubP>
anatofuz
parents:
diff changeset
32 {
anatofuz
parents:
diff changeset
33 int _anIVar;
anatofuz
parents:
diff changeset
34 }
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 - (Foo *) bazMethod;
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 @end
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 enum {
anatofuz
parents:
diff changeset
41 someEnum
anatofuz
parents:
diff changeset
42 };
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 int main (int argc, const char * argv[]) {
anatofuz
parents:
diff changeset
45 Baz * bee;
anatofuz
parents:
diff changeset
46 id a = [bee foo];
anatofuz
parents:
diff changeset
47 id <SubP> c = [Foo fooC];
anatofuz
parents:
diff changeset
48 id <Proto> d;
anatofuz
parents:
diff changeset
49 d = c;
anatofuz
parents:
diff changeset
50 [d pMethod];
anatofuz
parents:
diff changeset
51 [bee catMethodWithFloat:[bee floatMethod]];
anatofuz
parents:
diff changeset
52 main(someEnum, (const char **)bee);
anatofuz
parents:
diff changeset
53 }
anatofuz
parents:
diff changeset
54
anatofuz
parents:
diff changeset
55 #define CONCAT(X, Y) X##Y
anatofuz
parents:
diff changeset
56
anatofuz
parents:
diff changeset
57 void f() {
anatofuz
parents:
diff changeset
58 int CONCAT(my,_var);
anatofuz
parents:
diff changeset
59 }
anatofuz
parents:
diff changeset
60 #undef CONCAT
anatofuz
parents:
diff changeset
61
anatofuz
parents:
diff changeset
62 // CHECK: [1:1 - 3:1] Invalid Cursor => NoDeclFound
anatofuz
parents:
diff changeset
63 // CHECK: [3:1 - 7:1] ObjCInterfaceDecl=Foo:3:12
anatofuz
parents:
diff changeset
64 // CHECK: [7:1 - 7:7] ObjCInstanceMethodDecl=foo:7:3
anatofuz
parents:
diff changeset
65 // CHECK: [7:7 - 8:1] ObjCInterfaceDecl=Foo:3:12
anatofuz
parents:
diff changeset
66 // CHECK: [8:1 - 8:8] ObjCClassMethodDecl=fooC:8:3
anatofuz
parents:
diff changeset
67 // CHECK: [8:8 - 10:5] ObjCInterfaceDecl=Foo:3:12
anatofuz
parents:
diff changeset
68 // CHECK: [10:5 - 12:1] Invalid Cursor => NoDeclFound
anatofuz
parents:
diff changeset
69 // CHECK: [12:1 - 12:18] ObjCInterfaceDecl=Bar:12:12
anatofuz
parents:
diff changeset
70 // CHECK: [12:18 - 12:21] ObjCSuperClassRef=Foo:3:12
anatofuz
parents:
diff changeset
71 // CHECK: [12:21 - 16:5] ObjCInterfaceDecl=Bar:12:12
anatofuz
parents:
diff changeset
72 // CHECK: [16:5 - 18:1] Invalid Cursor => NoDeclFound
anatofuz
parents:
diff changeset
73 // CHECK: [18:1 - 18:12] ObjCCategoryDecl=FooCat:18:12
anatofuz
parents:
diff changeset
74 // CHECK: [18:12 - 18:15] ObjCClassRef=Foo:3:12
anatofuz
parents:
diff changeset
75 // CHECK: [18:15 - 19:1] ObjCCategoryDecl=FooCat:18:12
anatofuz
parents:
diff changeset
76 // CHECK: [19:1 - 19:29] ObjCInstanceMethodDecl=catMethodWithFloat::19:9
anatofuz
parents:
diff changeset
77 // CHECK: [19:29 - 19:40] ParmDecl=fArg:19:36 (Definition)
anatofuz
parents:
diff changeset
78 // CHECK: [19:40 - 19:41] ObjCInstanceMethodDecl=catMethodWithFloat::19:9
anatofuz
parents:
diff changeset
79 // CHECK: [19:41 - 20:1] ObjCCategoryDecl=FooCat:18:12
anatofuz
parents:
diff changeset
80 // CHECK: [20:1 - 20:23] ObjCInstanceMethodDecl=floatMethod:20:11
anatofuz
parents:
diff changeset
81 // CHECK: [20:23 - 21:5] ObjCCategoryDecl=FooCat:18:12
anatofuz
parents:
diff changeset
82 // CHECK: [21:5 - 23:1] Invalid Cursor => NoDeclFound
anatofuz
parents:
diff changeset
83 // CHECK: [23:1 - 24:1] ObjCProtocolDecl=Proto:23:11 (Definition)
anatofuz
parents:
diff changeset
84 // CHECK: [24:1 - 24:11] ObjCInstanceMethodDecl=pMethod:24:3
anatofuz
parents:
diff changeset
85 // CHECK: [24:11 - 25:5] ObjCProtocolDecl=Proto:23:11 (Definition)
anatofuz
parents:
diff changeset
86 // CHECK: [25:5 - 27:1] Invalid Cursor => NoDeclFound
anatofuz
parents:
diff changeset
87 // CHECK: [27:1 - 27:17] ObjCProtocolDecl=SubP:27:11 (Definition)
anatofuz
parents:
diff changeset
88 // CHECK: [27:17 - 27:22] ObjCProtocolRef=Proto:23:1
anatofuz
parents:
diff changeset
89 // CHECK: [27:22 - 28:1] ObjCProtocolDecl=SubP:27:11 (Definition)
anatofuz
parents:
diff changeset
90 // CHECK: [28:1 - 28:12] ObjCInstanceMethodDecl=spMethod:28:3
anatofuz
parents:
diff changeset
91 // CHECK: [28:12 - 29:5] ObjCProtocolDecl=SubP:27:11 (Definition)
anatofuz
parents:
diff changeset
92 // CHECK: [29:5 - 31:1] Invalid Cursor => NoDeclFound
anatofuz
parents:
diff changeset
93 // CHECK: [31:1 - 31:18] ObjCInterfaceDecl=Baz:31:12
anatofuz
parents:
diff changeset
94 // CHECK: [31:18 - 31:21] ObjCSuperClassRef=Bar:12:12
anatofuz
parents:
diff changeset
95 // CHECK: [31:21 - 31:23] ObjCInterfaceDecl=Baz:31:12
anatofuz
parents:
diff changeset
96 // CHECK: [31:23 - 31:27] ObjCProtocolRef=SubP:27:1
anatofuz
parents:
diff changeset
97 // CHECK: [31:27 - 33:5] ObjCInterfaceDecl=Baz:31:12
anatofuz
parents:
diff changeset
98 // CHECK: [33:5 - 33:16] ObjCIvarDecl=_anIVar:33:9 (Definition)
anatofuz
parents:
diff changeset
99 // CHECK: [33:16 - 36:1] ObjCInterfaceDecl=Baz:31:12
anatofuz
parents:
diff changeset
100 // CHECK: [36:1 - 36:4] ObjCInstanceMethodDecl=bazMethod:36:1
anatofuz
parents:
diff changeset
101 // CHECK: [36:4 - 36:7] ObjCClassRef=Foo:3:12
anatofuz
parents:
diff changeset
102 // CHECK: [36:7 - 36:21] ObjCInstanceMethodDecl=bazMethod:36:1
anatofuz
parents:
diff changeset
103 // CHECK: [36:21 - 38:5] ObjCInterfaceDecl=Baz:31:12
anatofuz
parents:
diff changeset
104 // CHECK: [38:5 - 40:1] Invalid Cursor => NoDeclFound
anatofuz
parents:
diff changeset
105 // CHECK: [40:1 - 41:3] EnumDecl=:40:1 (Definition)
anatofuz
parents:
diff changeset
106 // CHECK: [41:3 - 41:11] EnumConstantDecl=someEnum:41:3 (Definition)
anatofuz
parents:
diff changeset
107 // CHECK: [41:11 - 42:2] EnumDecl=:40:1 (Definition)
anatofuz
parents:
diff changeset
108 // CHECK: [42:2 - 44:1] Invalid Cursor => NoDeclFound
anatofuz
parents:
diff changeset
109 // CHECK: [44:1 - 44:11] FunctionDecl=main:44:5 (Definition)
anatofuz
parents:
diff changeset
110 // CHECK: [44:11 - 44:19] ParmDecl=argc:44:15 (Definition)
anatofuz
parents:
diff changeset
111 // CHECK: [44:19 - 44:21] FunctionDecl=main:44:5 (Definition)
anatofuz
parents:
diff changeset
112 // CHECK: [44:21 - 44:40] ParmDecl=argv:44:34 (Definition)
anatofuz
parents:
diff changeset
113 // CHECK: [44:40 - 44:42] FunctionDecl=main:44:5 (Definition)
anatofuz
parents:
diff changeset
114 // CHECK: [44:42 - 45:2] CompoundStmt=
anatofuz
parents:
diff changeset
115 // CHECK: [45:2 - 45:5] ObjCClassRef=Baz:31:12
anatofuz
parents:
diff changeset
116 // CHECK: [45:5 - 45:11] VarDecl=bee:45:8 (Definition)
anatofuz
parents:
diff changeset
117 // CHECK: [45:11 - 45:12] DeclStmt=
anatofuz
parents:
diff changeset
118 // CHECK: [45:12 - 46:2] CompoundStmt=
anatofuz
parents:
diff changeset
119 // CHECK: [46:2 - 46:4] TypeRef=id:0:0
anatofuz
parents:
diff changeset
120 // CHECK: [46:4 - 46:9] VarDecl=a:46:5 (Definition)
anatofuz
parents:
diff changeset
121 // CHECK: [46:9 - 46:10] ObjCMessageExpr=foo:7:3
anatofuz
parents:
diff changeset
122 // CHECK: [46:10 - 46:13] DeclRefExpr=bee:45:8
anatofuz
parents:
diff changeset
123 // CHECK: [46:13 - 46:18] ObjCMessageExpr=foo:7:3
anatofuz
parents:
diff changeset
124 // CHECK: [46:18 - 46:19] DeclStmt=
anatofuz
parents:
diff changeset
125 // CHECK: [46:19 - 47:2] CompoundStmt=
anatofuz
parents:
diff changeset
126 // CHECK: [47:2 - 47:4] TypeRef=id:0:0
anatofuz
parents:
diff changeset
127 // CHECK: [47:4 - 47:6] VarDecl=c:47:12 (Definition)
anatofuz
parents:
diff changeset
128 // CHECK: [47:6 - 47:10] ObjCProtocolRef=SubP:27:1
anatofuz
parents:
diff changeset
129 // CHECK: [47:10 - 47:16] VarDecl=c:47:12 (Definition)
anatofuz
parents:
diff changeset
130 // CHECK: [47:16 - 47:17] ObjCMessageExpr=fooC:8:3
anatofuz
parents:
diff changeset
131 // CHECK: [47:17 - 47:20] ObjCClassRef=Foo:3:12
anatofuz
parents:
diff changeset
132 // CHECK: [47:20 - 47:26] ObjCMessageExpr=fooC:8:3
anatofuz
parents:
diff changeset
133 // CHECK: [47:26 - 47:27] DeclStmt=
anatofuz
parents:
diff changeset
134 // CHECK: [47:27 - 48:2] CompoundStmt=
anatofuz
parents:
diff changeset
135 // CHECK: [48:2 - 48:4] TypeRef=id:0:0
anatofuz
parents:
diff changeset
136 // CHECK: [48:4 - 48:6] VarDecl=d:48:13 (Definition)
anatofuz
parents:
diff changeset
137 // CHECK: [48:6 - 48:11] ObjCProtocolRef=Proto:23:1
anatofuz
parents:
diff changeset
138 // CHECK: [48:11 - 48:14] VarDecl=d:48:13 (Definition)
anatofuz
parents:
diff changeset
139 // CHECK: [48:14 - 48:15] DeclStmt=
anatofuz
parents:
diff changeset
140 // CHECK: [48:15 - 49:2] CompoundStmt=
anatofuz
parents:
diff changeset
141 // CHECK: [49:2 - 49:3] DeclRefExpr=d:48:13
anatofuz
parents:
diff changeset
142 // CHECK: [49:3 - 49:6] BinaryOperator=
anatofuz
parents:
diff changeset
143 // CHECK: [49:6 - 49:7] DeclRefExpr=c:47:12
anatofuz
parents:
diff changeset
144 // CHECK: [49:7 - 50:2] CompoundStmt=
anatofuz
parents:
diff changeset
145 // CHECK: [50:2 - 50:3] ObjCMessageExpr=pMethod:24:3
anatofuz
parents:
diff changeset
146 // CHECK: [50:3 - 50:4] DeclRefExpr=d:48:13
anatofuz
parents:
diff changeset
147 // CHECK: [50:4 - 50:13] ObjCMessageExpr=pMethod:24:3
anatofuz
parents:
diff changeset
148 // CHECK: [50:13 - 51:2] CompoundStmt=
anatofuz
parents:
diff changeset
149 // CHECK: [51:2 - 51:3] ObjCMessageExpr=catMethodWithFloat::19:9
anatofuz
parents:
diff changeset
150 // CHECK: [51:3 - 51:6] DeclRefExpr=bee:45:8
anatofuz
parents:
diff changeset
151 // CHECK: [51:6 - 51:26] ObjCMessageExpr=catMethodWithFloat::19:9
anatofuz
parents:
diff changeset
152 // CHECK: [51:26 - 51:27] ObjCMessageExpr=floatMethod:20:1
anatofuz
parents:
diff changeset
153 // CHECK: [51:27 - 51:30] DeclRefExpr=bee:45:8
anatofuz
parents:
diff changeset
154 // CHECK: [51:30 - 51:43] ObjCMessageExpr=floatMethod:20:1
anatofuz
parents:
diff changeset
155 // CHECK: [51:43 - 51:44] ObjCMessageExpr=catMethodWithFloat::19:9
anatofuz
parents:
diff changeset
156 // CHECK: [51:44 - 52:3] CompoundStmt=
anatofuz
parents:
diff changeset
157 // CHECK: [52:3 - 52:7] DeclRefExpr=main:44:5
anatofuz
parents:
diff changeset
158 // CHECK: [52:7 - 52:8] CallExpr=main:44:5
anatofuz
parents:
diff changeset
159 // CHECK: [52:8 - 52:16] DeclRefExpr=someEnum:41:3
anatofuz
parents:
diff changeset
160 // CHECK: [52:16 - 52:18] CallExpr=main:44:5
anatofuz
parents:
diff changeset
161 // CHECK: [52:18 - 52:33] CStyleCastExpr=
anatofuz
parents:
diff changeset
162 // CHECK: [52:33 - 52:36] DeclRefExpr=bee:45:8
anatofuz
parents:
diff changeset
163 // CHECK: [52:36 - 52:37] CallExpr=main:44:5
anatofuz
parents:
diff changeset
164 // CHECK: [52:37 - 53:2] CompoundStmt=
anatofuz
parents:
diff changeset
165 // CHECK: [55:9 - 55:26] macro definition=CONCAT
anatofuz
parents:
diff changeset
166 // CHECK: [57:1 - 57:10] FunctionDecl=f:57:6 (Definition)
anatofuz
parents:
diff changeset
167 // CHECK: [58:4 - 58:8] VarDecl=my_var:58:8 (Definition)
anatofuz
parents:
diff changeset
168 // CHECK: [58:8 - 58:15] macro expansion=CONCAT:55:9
anatofuz
parents:
diff changeset
169 // REQUIRES: x86-registered-target