2 // RUN: split-file %s %t
3 // RUN: sed -e "s@INPUT_DIR@%{/t:regex_replacement}@g" \
4 // RUN: %t/reference.output.json.in >> %t/reference.output.json
5 // RUN: %clang_cc1 -extract-api -triple arm64-apple-macosx -x objective-c-header %t/input.h -o %t/output.json -verify
7 // Generator version is not consistent across test runs, normalize it.
8 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
9 // RUN: %t/output.json >> %t/output-normalized.json
10 // RUN: diff %t/reference.output.json %t/output-normalized.json
14 @property(class) int myProtocolTypeProp;
15 @property int myProtocolInstanceProp;
19 @property(class) int myInterfaceTypeProp;
20 @property int myInterfaceInstanceProp;
23 @interface Interface (Category) <Protocol>
24 @property(class) int myCategoryTypeProp;
25 @property int myCategoryInstanceProp;
27 // expected-no-diagnostics
29 //--- reference.output.json.in
42 "architecture": "arm64",
57 "source": "c:objc(cs)Interface(cpy)myInterfaceTypeProp",
58 "target": "c:objc(cs)Interface",
59 "targetFallback": "Interface"
63 "source": "c:objc(cs)Interface(py)myInterfaceInstanceProp",
64 "target": "c:objc(cs)Interface",
65 "targetFallback": "Interface"
69 "source": "c:objc(cs)Interface(cpy)myCategoryTypeProp",
70 "target": "c:objc(cs)Interface",
71 "targetFallback": "Interface"
75 "source": "c:objc(cs)Interface(py)myCategoryInstanceProp",
76 "target": "c:objc(cs)Interface",
77 "targetFallback": "Interface"
81 "source": "c:objc(cs)Interface",
82 "target": "c:objc(pl)Protocol",
83 "targetFallback": "Protocol"
87 "source": "c:objc(pl)Protocol(cpy)myProtocolTypeProp",
88 "target": "c:objc(pl)Protocol",
89 "targetFallback": "Protocol"
93 "source": "c:objc(pl)Protocol(py)myProtocolInstanceProp",
94 "target": "c:objc(pl)Protocol",
95 "targetFallback": "Protocol"
100 "accessLevel": "public",
101 "declarationFragments": [
104 "spelling": "@interface"
111 "kind": "identifier",
112 "spelling": "Interface"
116 "interfaceLanguage": "objective-c",
117 "precise": "c:objc(cs)Interface"
120 "displayName": "Class",
121 "identifier": "objective-c.class"
128 "uri": "file://INPUT_DIR/input.h"
133 "kind": "identifier",
134 "spelling": "Interface"
139 "kind": "identifier",
140 "spelling": "Interface"
150 "accessLevel": "public",
151 "declarationFragments": [
154 "spelling": "@property"
169 "kind": "typeIdentifier",
170 "preciseIdentifier": "c:I",
178 "kind": "identifier",
179 "spelling": "myInterfaceTypeProp"
183 "interfaceLanguage": "objective-c",
184 "precise": "c:objc(cs)Interface(cpy)myInterfaceTypeProp"
187 "displayName": "Type Property",
188 "identifier": "objective-c.type.property"
195 "uri": "file://INPUT_DIR/input.h"
200 "kind": "identifier",
201 "spelling": "myInterfaceTypeProp"
206 "kind": "identifier",
207 "spelling": "myInterfaceTypeProp"
210 "title": "myInterfaceTypeProp"
214 "myInterfaceTypeProp"
218 "accessLevel": "public",
219 "declarationFragments": [
222 "spelling": "@property"
229 "kind": "typeIdentifier",
230 "preciseIdentifier": "c:I",
238 "kind": "identifier",
239 "spelling": "myInterfaceInstanceProp"
243 "interfaceLanguage": "objective-c",
244 "precise": "c:objc(cs)Interface(py)myInterfaceInstanceProp"
247 "displayName": "Instance Property",
248 "identifier": "objective-c.property"
255 "uri": "file://INPUT_DIR/input.h"
260 "kind": "identifier",
261 "spelling": "myInterfaceInstanceProp"
266 "kind": "identifier",
267 "spelling": "myInterfaceInstanceProp"
270 "title": "myInterfaceInstanceProp"
274 "myInterfaceInstanceProp"
278 "accessLevel": "public",
279 "declarationFragments": [
282 "spelling": "@property"
297 "kind": "typeIdentifier",
298 "preciseIdentifier": "c:I",
306 "kind": "identifier",
307 "spelling": "myCategoryTypeProp"
311 "interfaceLanguage": "objective-c",
312 "precise": "c:objc(cs)Interface(cpy)myCategoryTypeProp"
315 "displayName": "Type Property",
316 "identifier": "objective-c.type.property"
323 "uri": "file://INPUT_DIR/input.h"
328 "kind": "identifier",
329 "spelling": "myCategoryTypeProp"
334 "kind": "identifier",
335 "spelling": "myCategoryTypeProp"
338 "title": "myCategoryTypeProp"
346 "accessLevel": "public",
347 "declarationFragments": [
350 "spelling": "@property"
357 "kind": "typeIdentifier",
358 "preciseIdentifier": "c:I",
366 "kind": "identifier",
367 "spelling": "myCategoryInstanceProp"
371 "interfaceLanguage": "objective-c",
372 "precise": "c:objc(cs)Interface(py)myCategoryInstanceProp"
375 "displayName": "Instance Property",
376 "identifier": "objective-c.property"
383 "uri": "file://INPUT_DIR/input.h"
388 "kind": "identifier",
389 "spelling": "myCategoryInstanceProp"
394 "kind": "identifier",
395 "spelling": "myCategoryInstanceProp"
398 "title": "myCategoryInstanceProp"
402 "myCategoryInstanceProp"
406 "accessLevel": "public",
407 "declarationFragments": [
410 "spelling": "@protocol"
417 "kind": "identifier",
418 "spelling": "Protocol"
422 "interfaceLanguage": "objective-c",
423 "precise": "c:objc(pl)Protocol"
426 "displayName": "Protocol",
427 "identifier": "objective-c.protocol"
434 "uri": "file://INPUT_DIR/input.h"
439 "kind": "identifier",
440 "spelling": "Protocol"
445 "kind": "identifier",
446 "spelling": "Protocol"
456 "accessLevel": "public",
457 "declarationFragments": [
460 "spelling": "@property"
475 "kind": "typeIdentifier",
476 "preciseIdentifier": "c:I",
484 "kind": "identifier",
485 "spelling": "myProtocolTypeProp"
489 "interfaceLanguage": "objective-c",
490 "precise": "c:objc(pl)Protocol(cpy)myProtocolTypeProp"
493 "displayName": "Type Property",
494 "identifier": "objective-c.type.property"
501 "uri": "file://INPUT_DIR/input.h"
506 "kind": "identifier",
507 "spelling": "myProtocolTypeProp"
512 "kind": "identifier",
513 "spelling": "myProtocolTypeProp"
516 "title": "myProtocolTypeProp"
524 "accessLevel": "public",
525 "declarationFragments": [
528 "spelling": "@property"
535 "kind": "typeIdentifier",
536 "preciseIdentifier": "c:I",
544 "kind": "identifier",
545 "spelling": "myProtocolInstanceProp"
549 "interfaceLanguage": "objective-c",
550 "precise": "c:objc(pl)Protocol(py)myProtocolInstanceProp"
553 "displayName": "Instance Property",
554 "identifier": "objective-c.property"
561 "uri": "file://INPUT_DIR/input.h"
566 "kind": "identifier",
567 "spelling": "myProtocolInstanceProp"
572 "kind": "identifier",
573 "spelling": "myProtocolInstanceProp"
576 "title": "myProtocolInstanceProp"
580 "myProtocolInstanceProp"