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 -extract-api -x objective-c-header -target arm64-apple-macosx \
6 // RUN: %t/input.h -o %t/output.json | FileCheck -allow-empty %s
8 // Generator version is not consistent across test runs, normalize it.
9 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
10 // RUN: %t/output.json >> %t/output-normalized.json
11 // RUN: diff %t/reference.output.json %t/output-normalized.json
14 // CHECK-NOT: warning:
19 @interface Super <Protocol>
20 @property(readonly, getter=getProperty) unsigned Property;
21 + (id)getWithProperty:(unsigned) Property;
22 - (void)setProperty:(unsigned) Property andOtherThing: (unsigned) Thing;
25 @interface Derived : Super {
31 //--- reference.output.json.in
44 "architecture": "arm64",
59 "source": "c:objc(cs)Super(cm)getWithProperty:",
60 "target": "c:objc(cs)Super",
61 "targetFallback": "Super"
65 "source": "c:objc(cs)Super(im)setProperty:andOtherThing:",
66 "target": "c:objc(cs)Super",
67 "targetFallback": "Super"
71 "source": "c:objc(cs)Super(py)Property",
72 "target": "c:objc(cs)Super",
73 "targetFallback": "Super"
77 "source": "c:objc(cs)Super",
78 "target": "c:objc(pl)Protocol",
79 "targetFallback": "Protocol"
83 "source": "c:objc(cs)Derived@Ivar",
84 "target": "c:objc(cs)Derived",
85 "targetFallback": "Derived"
89 "source": "c:objc(cs)Derived(im)getIvar",
90 "target": "c:objc(cs)Derived",
91 "targetFallback": "Derived"
94 "kind": "inheritsFrom",
95 "source": "c:objc(cs)Derived",
96 "target": "c:objc(cs)Super",
97 "targetFallback": "Super"
102 "accessLevel": "public",
103 "declarationFragments": [
106 "spelling": "@interface"
113 "kind": "identifier",
118 "interfaceLanguage": "objective-c",
119 "precise": "c:objc(cs)Super"
122 "displayName": "Class",
123 "identifier": "objective-c.class"
130 "uri": "file://INPUT_DIR/input.h"
135 "kind": "identifier",
141 "kind": "identifier",
152 "accessLevel": "public",
153 "declarationFragments": [
167 "kind": "identifier",
168 "spelling": "getWithProperty:"
175 "kind": "typeIdentifier",
176 "preciseIdentifier": "c:i",
177 "spelling": "unsigned int"
184 "kind": "internalParam",
185 "spelling": "Property"
192 "functionSignature": {
195 "declarationFragments": [
201 "kind": "typeIdentifier",
202 "preciseIdentifier": "c:i",
203 "spelling": "unsigned int"
210 "kind": "internalParam",
211 "spelling": "Property"
225 "interfaceLanguage": "objective-c",
226 "precise": "c:objc(cs)Super(cm)getWithProperty:"
229 "displayName": "Type Method",
230 "identifier": "objective-c.type.method"
237 "uri": "file://INPUT_DIR/input.h"
242 "kind": "identifier",
243 "spelling": "getWithProperty:"
252 "kind": "identifier",
253 "spelling": "getWithProperty:"
256 "title": "getWithProperty:"
264 "accessLevel": "public",
265 "declarationFragments": [
271 "kind": "typeIdentifier",
272 "preciseIdentifier": "c:v",
280 "kind": "identifier",
281 "spelling": "setProperty:"
288 "kind": "typeIdentifier",
289 "preciseIdentifier": "c:i",
290 "spelling": "unsigned int"
297 "kind": "internalParam",
298 "spelling": "Property"
305 "kind": "identifier",
306 "spelling": "andOtherThing:"
313 "kind": "typeIdentifier",
314 "preciseIdentifier": "c:i",
315 "spelling": "unsigned int"
322 "kind": "internalParam",
330 "functionSignature": {
333 "declarationFragments": [
339 "kind": "typeIdentifier",
340 "preciseIdentifier": "c:i",
341 "spelling": "unsigned int"
348 "kind": "internalParam",
349 "spelling": "Property"
355 "declarationFragments": [
361 "kind": "typeIdentifier",
362 "preciseIdentifier": "c:i",
363 "spelling": "unsigned int"
370 "kind": "internalParam",
379 "kind": "typeIdentifier",
380 "preciseIdentifier": "c:v",
386 "interfaceLanguage": "objective-c",
387 "precise": "c:objc(cs)Super(im)setProperty:andOtherThing:"
390 "displayName": "Instance Method",
391 "identifier": "objective-c.method"
398 "uri": "file://INPUT_DIR/input.h"
403 "kind": "identifier",
404 "spelling": "setProperty:andOtherThing:"
413 "kind": "identifier",
414 "spelling": "setProperty:andOtherThing:"
417 "title": "setProperty:andOtherThing:"
421 "setProperty:andOtherThing:"
425 "accessLevel": "public",
426 "declarationFragments": [
429 "spelling": "@property"
437 "spelling": "readonly"
452 "kind": "identifier",
453 "spelling": "getProperty"
460 "kind": "typeIdentifier",
461 "preciseIdentifier": "c:i",
462 "spelling": "unsigned int"
469 "kind": "identifier",
470 "spelling": "Property"
474 "interfaceLanguage": "objective-c",
475 "precise": "c:objc(cs)Super(py)Property"
478 "displayName": "Instance Property",
479 "identifier": "objective-c.property"
486 "uri": "file://INPUT_DIR/input.h"
491 "kind": "identifier",
492 "spelling": "Property"
497 "kind": "identifier",
498 "spelling": "Property"
509 "accessLevel": "public",
510 "declarationFragments": [
513 "spelling": "@interface"
520 "kind": "identifier",
521 "spelling": "Derived"
528 "kind": "typeIdentifier",
529 "preciseIdentifier": "c:objc(cs)Super",
534 "interfaceLanguage": "objective-c",
535 "precise": "c:objc(cs)Derived"
538 "displayName": "Class",
539 "identifier": "objective-c.class"
546 "uri": "file://INPUT_DIR/input.h"
551 "kind": "identifier",
552 "spelling": "Derived"
557 "kind": "identifier",
558 "spelling": "Derived"
568 "accessLevel": "public",
569 "declarationFragments": [
571 "kind": "typeIdentifier",
572 "preciseIdentifier": "c:C",
580 "kind": "identifier",
589 "interfaceLanguage": "objective-c",
590 "precise": "c:objc(cs)Derived@Ivar"
593 "displayName": "Instance Variable",
594 "identifier": "objective-c.ivar"
601 "uri": "file://INPUT_DIR/input.h"
606 "kind": "identifier",
612 "kind": "identifier",
624 "accessLevel": "public",
625 "declarationFragments": [
631 "kind": "typeIdentifier",
632 "preciseIdentifier": "c:C",
640 "kind": "identifier",
641 "spelling": "getIvar"
648 "functionSignature": {
651 "kind": "typeIdentifier",
652 "preciseIdentifier": "c:C",
658 "interfaceLanguage": "objective-c",
659 "precise": "c:objc(cs)Derived(im)getIvar"
662 "displayName": "Instance Method",
663 "identifier": "objective-c.method"
670 "uri": "file://INPUT_DIR/input.h"
675 "kind": "identifier",
676 "spelling": "getIvar"
685 "kind": "identifier",
686 "spelling": "getIvar"