2 // RUN: %clang_cc1 -extract-api --pretty-sgf --emit-sgf-symbol-labels-for-testing \
3 // RUN: -x objective-c-header -triple arm64-apple-macosx %s -o %t/output.symbols.json -verify
8 // RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix SUPER
9 @interface Super <Protocol>
10 // SUPER: "!testRelLabel": "conformsTo $ c:objc(cs)Super $ c:objc(pl)Protocol"
11 // SUPER-LABEL: "!testLabel": "c:objc(cs)Super"
12 // SUPER: "accessLevel": "public",
13 // SUPER: "declarationFragments": [
15 // SUPER-NEXT: "kind": "keyword",
16 // SUPER-NEXT: "spelling": "@interface"
19 // SUPER-NEXT: "kind": "text",
20 // SUPER-NEXT: "spelling": " "
23 // SUPER-NEXT: "kind": "identifier",
24 // SUPER-NEXT: "spelling": "Super"
28 // SUPER-NEXT: "displayName": "Class",
29 // SUPER-NEXT: "identifier": "objective-c.class"
31 // SUPER: "title": "Super"
32 // SUPER: "pathComponents": [
33 // SUPER-NEXT: "Super"
36 // RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix PROP
37 @property(readonly, getter=getProperty) unsigned Property;
38 // PROP: "!testRelLabel": "memberOf $ c:objc(cs)Super(py)Property $ c:objc(cs)Super"
39 // PROP: "!testLabel": "c:objc(cs)Super(py)Property"
40 // PROP: "accessLevel": "public",
41 // PROP: "declarationFragments": [
43 // PROP-NEXT: "kind": "keyword",
44 // PROP-NEXT: "spelling": "@property"
47 // PROP-NEXT: "kind": "text",
48 // PROP-NEXT: "spelling": " ("
51 // PROP-NEXT: "kind": "keyword",
52 // PROP-NEXT: "spelling": "readonly"
55 // PROP-NEXT: "kind": "text",
56 // PROP-NEXT: "spelling": ", "
59 // PROP-NEXT: "kind": "keyword",
60 // PROP-NEXT: "spelling": "getter"
63 // PROP-NEXT: "kind": "text",
64 // PROP-NEXT: "spelling": "="
67 // PROP-NEXT: "kind": "identifier",
68 // PROP-NEXT: "spelling": "getProperty"
71 // PROP-NEXT: "kind": "text",
72 // PROP-NEXT: "spelling": ") "
75 // PROP-NEXT: "kind": "typeIdentifier",
76 // PROP-NEXT: "preciseIdentifier": "c:i",
77 // PROP-NEXT: "spelling": "unsigned int"
80 // PROP-NEXT: "kind": "text",
81 // PROP-NEXT: "spelling": " "
84 // PROP-NEXT: "kind": "identifier",
85 // PROP-NEXT: "spelling": "Property"
88 // PROP-NEXT: "kind": "text",
89 // PROP-NEXT: "spelling": ";"
93 // PROP-NEXT: "displayName": "Instance Property",
94 // PROP-NEXT: "identifier": "objective-c.property"
96 // PROP: "title": "Property"
97 // PROP: "pathComponents": [
98 // PROP-NEXT: "Super",
99 // PROP-NEXT: "Property"
102 // RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix GET
103 + (id)getWithProperty:(unsigned) Property;
104 // GET: "!testRelLabel": "memberOf $ c:objc(cs)Super(cm)getWithProperty: $ c:objc(cs)Super"
105 // GET-LABEL: "!testLabel": "c:objc(cs)Super(cm)getWithProperty:"
106 // GET: "accessLevel": "public",
107 // GET: "declarationFragments": [
109 // GET-NEXT: "kind": "text",
110 // GET-NEXT: "spelling": "+ ("
113 // GET-NEXT: "kind": "keyword",
114 // GET-NEXT: "spelling": "id"
117 // GET-NEXT: "kind": "text",
118 // GET-NEXT: "spelling": ") "
121 // GET-NEXT: "kind": "identifier",
122 // GET-NEXT: "spelling": "getWithProperty:"
125 // GET-NEXT: "kind": "text",
126 // GET-NEXT: "spelling": "("
129 // GET-NEXT: "kind": "typeIdentifier",
130 // GET-NEXT: "preciseIdentifier": "c:i",
131 // GET-NEXT: "spelling": "unsigned int"
134 // GET-NEXT: "kind": "text",
135 // GET-NEXT: "spelling": ") "
138 // GET-NEXT: "kind": "internalParam",
139 // GET-NEXT: "spelling": "Property"
142 // GET-NEXT: "kind": "text",
143 // GET-NEXT: "spelling": ";"
146 // GET: "functionSignature": {
147 // GET-NEXT: "parameters": [
149 // GET-NEXT: "declarationFragments": [
151 // GET-NEXT: "kind": "text",
152 // GET-NEXT: "spelling": "("
155 // GET-NEXT: "kind": "typeIdentifier",
156 // GET-NEXT: "preciseIdentifier": "c:i",
157 // GET-NEXT: "spelling": "unsigned int"
160 // GET-NEXT: "kind": "text",
161 // GET-NEXT: "spelling": ") "
164 // GET-NEXT: "kind": "internalParam",
165 // GET-NEXT: "spelling": "Property"
168 // GET-NEXT: "name": "Property"
171 // GET-NEXT: "returns": [
173 // GET-NEXT: "kind": "keyword",
174 // GET-NEXT: "spelling": "id"
179 // GET-NEXT: "displayName": "Type Method",
180 // GET-NEXT: "identifier": "objective-c.type.method"
182 // GET: "title": "getWithProperty:"
183 // GET: "pathComponents": [
184 // GET-NEXT: "Super",
185 // GET-NEXT: "getWithProperty:"
188 // RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix SET
189 - (void)setProperty:(unsigned) Property andOtherThing: (unsigned) Thing;
190 // SET: "!testRelLabel": "memberOf $ c:objc(cs)Super(im)setProperty:andOtherThing: $ c:objc(cs)Super"
191 // SET-LABEL: "!testLabel": "c:objc(cs)Super(im)setProperty:andOtherThing:"
192 // SET: "accessLevel": "public",
193 // SET: "declarationFragments": [
195 // SET-NEXT: "kind": "text",
196 // SET-NEXT: "spelling": "- ("
199 // SET-NEXT: "kind": "typeIdentifier",
200 // SET-NEXT: "preciseIdentifier": "c:v",
201 // SET-NEXT: "spelling": "void"
204 // SET-NEXT: "kind": "text",
205 // SET-NEXT: "spelling": ") "
208 // SET-NEXT: "kind": "identifier",
209 // SET-NEXT: "spelling": "setProperty:"
212 // SET-NEXT: "kind": "text",
213 // SET-NEXT: "spelling": "("
216 // SET-NEXT: "kind": "typeIdentifier",
217 // SET-NEXT: "preciseIdentifier": "c:i",
218 // SET-NEXT: "spelling": "unsigned int"
221 // SET-NEXT: "kind": "text",
222 // SET-NEXT: "spelling": ") "
225 // SET-NEXT: "kind": "internalParam",
226 // SET-NEXT: "spelling": "Property"
229 // SET-NEXT: "kind": "text",
230 // SET-NEXT: "spelling": " "
233 // SET-NEXT: "kind": "identifier",
234 // SET-NEXT: "spelling": "andOtherThing:"
237 // SET-NEXT: "kind": "text",
238 // SET-NEXT: "spelling": "("
241 // SET-NEXT: "kind": "typeIdentifier",
242 // SET-NEXT: "preciseIdentifier": "c:i",
243 // SET-NEXT: "spelling": "unsigned int"
246 // SET-NEXT: "kind": "text",
247 // SET-NEXT: "spelling": ") "
250 // SET-NEXT: "kind": "internalParam",
251 // SET-NEXT: "spelling": "Thing"
254 // SET-NEXT: "kind": "text",
255 // SET-NEXT: "spelling": ";"
258 // SET: "functionSignature": {
259 // SET-NEXT: "parameters": [
261 // SET-NEXT: "declarationFragments": [
263 // SET-NEXT: "kind": "text",
264 // SET-NEXT: "spelling": "("
267 // SET-NEXT: "kind": "typeIdentifier",
268 // SET-NEXT: "preciseIdentifier": "c:i",
269 // SET-NEXT: "spelling": "unsigned int"
272 // SET-NEXT: "kind": "text",
273 // SET-NEXT: "spelling": ") "
276 // SET-NEXT: "kind": "internalParam",
277 // SET-NEXT: "spelling": "Property"
280 // SET-NEXT: "name": "Property"
283 // SET-NEXT: "declarationFragments": [
285 // SET-NEXT: "kind": "text",
286 // SET-NEXT: "spelling": "("
289 // SET-NEXT: "kind": "typeIdentifier",
290 // SET-NEXT: "preciseIdentifier": "c:i",
291 // SET-NEXT: "spelling": "unsigned int"
294 // SET-NEXT: "kind": "text",
295 // SET-NEXT: "spelling": ") "
298 // SET-NEXT: "kind": "internalParam",
299 // SET-NEXT: "spelling": "Thing"
302 // SET-NEXT: "name": "Thing"
305 // SET-NEXT: "returns": [
307 // SET-NEXT: "kind": "typeIdentifier",
308 // SET-NEXT: "preciseIdentifier": "c:v",
309 // SET-NEXT: "spelling": "void"
314 // SET-NEXT: "displayName": "Instance Method",
315 // SET-NEXT: "identifier": "objective-c.method"
317 // SET: "title": "setProperty:andOtherThing:"
320 // RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix DERIVED
321 @interface Derived : Super {
322 // DERIVED: "!testRelLabel": "inheritsFrom $ c:objc(cs)Derived $ c:objc(cs)Super"
324 // RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix IVAR
326 // IVAR: "!testRelLabel": "memberOf $ c:objc(cs)Derived@Ivar $ c:objc(cs)Derived"
327 // IVAR-LABEL: "!testLabel": "c:objc(cs)Derived@Ivar"
328 // IVAR: "accessLevel": "public",
329 // IVAR: "declarationFragments": [
331 // IVAR-NEXT: "kind": "typeIdentifier",
332 // IVAR-NEXT: "preciseIdentifier": "c:C",
333 // IVAR-NEXT: "spelling": "char"
336 // IVAR-NEXT: "kind": "text",
337 // IVAR-NEXT: "spelling": " "
340 // IVAR-NEXT: "kind": "identifier",
341 // IVAR-NEXT: "spelling": "Ivar"
344 // IVAR-NEXT: "kind": "text",
345 // IVAR-NEXT: "spelling": ";"
349 // IVAR-NEXT: "displayName": "Instance Variable",
350 // IVAR-NEXT: "identifier": "objective-c.ivar"
352 // IVAR: "title": "Ivar"
353 // IVAR: "pathComponents": [
354 // IVAR-NEXT: "Derived",
360 // expected-no-diagnostics