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:
20 @interface MyInterface
21 @property(copy, readwrite) id<MyProtocol> obj1;
22 @property(readwrite) id<MyProtocol> *obj2;
24 //--- reference.output.json.in
37 "architecture": "arm64",
52 "source": "c:objc(cs)MyInterface(py)obj1",
53 "target": "c:objc(cs)MyInterface",
54 "targetFallback": "MyInterface"
58 "source": "c:objc(cs)MyInterface(py)obj2",
59 "target": "c:objc(cs)MyInterface",
60 "targetFallback": "MyInterface"
65 "accessLevel": "public",
66 "declarationFragments": [
69 "spelling": "@interface"
77 "spelling": "MyInterface"
81 "interfaceLanguage": "objective-c",
82 "precise": "c:objc(cs)MyInterface"
85 "displayName": "Class",
86 "identifier": "objective-c.class"
93 "uri": "file://INPUT_DIR/input.h"
99 "spelling": "MyInterface"
104 "kind": "identifier",
105 "spelling": "MyInterface"
108 "title": "MyInterface"
115 "accessLevel": "public",
116 "declarationFragments": [
119 "spelling": "@property"
135 "spelling": "readwrite"
142 "kind": "typeIdentifier",
143 "preciseIdentifier": "c:Qoobjc(pl)MyProtocol",
144 "spelling": "id<MyProtocol>"
151 "kind": "identifier",
156 "interfaceLanguage": "objective-c",
157 "precise": "c:objc(cs)MyInterface(py)obj1"
160 "displayName": "Instance Property",
161 "identifier": "objective-c.property"
168 "uri": "file://INPUT_DIR/input.h"
173 "kind": "identifier",
179 "kind": "identifier",
191 "accessLevel": "public",
192 "declarationFragments": [
195 "spelling": "@property"
203 "spelling": "readwrite"
210 "kind": "typeIdentifier",
211 "preciseIdentifier": "c:Qoobjc(pl)MyProtocol",
212 "spelling": "id<MyProtocol>"
219 "kind": "identifier",
224 "interfaceLanguage": "objective-c",
225 "precise": "c:objc(cs)MyInterface(py)obj2"
228 "displayName": "Instance Property",
229 "identifier": "objective-c.property"
236 "uri": "file://INPUT_DIR/input.h"
241 "kind": "identifier",
247 "kind": "identifier",
259 "accessLevel": "public",
260 "declarationFragments": [
263 "spelling": "@protocol"
270 "kind": "identifier",
271 "spelling": "MyProtocol"
275 "interfaceLanguage": "objective-c",
276 "precise": "c:objc(pl)MyProtocol"
279 "displayName": "Protocol",
280 "identifier": "objective-c.protocol"
287 "uri": "file://INPUT_DIR/input.h"
292 "kind": "identifier",
293 "spelling": "MyProtocol"
298 "kind": "identifier",
299 "spelling": "MyProtocol"
302 "title": "MyProtocol"