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:
22 @interface Interface (Category) <Protocol>
23 @property int Property;
24 - (void)InstanceMethod;
28 //--- reference.output.json.in
41 "architecture": "arm64",
56 "source": "c:objc(cs)Interface(im)InstanceMethod",
57 "target": "c:objc(cs)Interface",
58 "targetFallback": "Interface"
62 "source": "c:objc(cs)Interface(cm)ClassMethod",
63 "target": "c:objc(cs)Interface",
64 "targetFallback": "Interface"
68 "source": "c:objc(cs)Interface(py)Property",
69 "target": "c:objc(cs)Interface",
70 "targetFallback": "Interface"
74 "source": "c:objc(cs)Interface",
75 "target": "c:objc(pl)Protocol",
76 "targetFallback": "Protocol"
81 "accessLevel": "public",
82 "declarationFragments": [
85 "spelling": "@interface"
93 "spelling": "Interface"
97 "interfaceLanguage": "objective-c",
98 "precise": "c:objc(cs)Interface"
101 "displayName": "Class",
102 "identifier": "objective-c.class"
109 "uri": "file://INPUT_DIR/input.h"
114 "kind": "identifier",
115 "spelling": "Interface"
120 "kind": "identifier",
121 "spelling": "Interface"
131 "accessLevel": "public",
132 "declarationFragments": [
138 "kind": "typeIdentifier",
139 "preciseIdentifier": "c:v",
147 "kind": "identifier",
148 "spelling": "InstanceMethod"
155 "functionSignature": {
158 "kind": "typeIdentifier",
159 "preciseIdentifier": "c:v",
165 "interfaceLanguage": "objective-c",
166 "precise": "c:objc(cs)Interface(im)InstanceMethod"
169 "displayName": "Instance Method",
170 "identifier": "objective-c.method"
177 "uri": "file://INPUT_DIR/input.h"
182 "kind": "identifier",
183 "spelling": "InstanceMethod"
192 "kind": "identifier",
193 "spelling": "InstanceMethod"
196 "title": "InstanceMethod"
204 "accessLevel": "public",
205 "declarationFragments": [
211 "kind": "typeIdentifier",
212 "preciseIdentifier": "c:v",
220 "kind": "identifier",
221 "spelling": "ClassMethod"
228 "functionSignature": {
231 "kind": "typeIdentifier",
232 "preciseIdentifier": "c:v",
238 "interfaceLanguage": "objective-c",
239 "precise": "c:objc(cs)Interface(cm)ClassMethod"
242 "displayName": "Type Method",
243 "identifier": "objective-c.type.method"
250 "uri": "file://INPUT_DIR/input.h"
255 "kind": "identifier",
256 "spelling": "ClassMethod"
265 "kind": "identifier",
266 "spelling": "ClassMethod"
269 "title": "ClassMethod"
277 "accessLevel": "public",
278 "declarationFragments": [
281 "spelling": "@property"
305 "spelling": "unsafe_unretained"
313 "spelling": "readwrite"
320 "kind": "typeIdentifier",
321 "preciseIdentifier": "c:I",
329 "kind": "identifier",
330 "spelling": "Property"
334 "interfaceLanguage": "objective-c",
335 "precise": "c:objc(cs)Interface(py)Property"
338 "displayName": "Instance Property",
339 "identifier": "objective-c.property"
346 "uri": "file://INPUT_DIR/input.h"
351 "kind": "identifier",
352 "spelling": "Property"
357 "kind": "identifier",
358 "spelling": "Property"