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 \
6 // RUN: -target arm64-apple-macosx \
7 // RUN: %t/myclass_1.h \
8 // RUN: %t/input.h -o %t/output.json | FileCheck -allow-empty %s
10 // Generator version is not consistent across test runs, normalize it.
11 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
12 // RUN: %t/output.json >> %t/output-normalized.json
13 // RUN: diff %t/reference.output.json %t/output-normalized.json
16 // CHECK-NOT: warning:
20 #import "Foundation.h"
22 @interface MyClass1 (MyCategory1)
26 @interface NSString (Category1)
30 @interface NSString (Category2)
31 -(void) StringMethod2;
42 //--- reference.output.json.in
55 "architecture": "arm64",
70 "source": "c:objc(cs)MyClass1(im)SomeMethod",
71 "target": "c:objc(cs)MyClass1",
72 "targetFallback": "MyClass1"
75 "kind": "extensionTo",
76 "source": "c:objc(cy)NSString@Category1",
77 "target": "c:objc(cs)NSString",
78 "targetFallback": "NSString"
82 "source": "c:objc(cs)NSString(im)StringMethod",
83 "target": "c:objc(cy)NSString@Category1",
84 "targetFallback": "Category1"
87 "kind": "extensionTo",
88 "source": "c:objc(cy)NSString@Category2",
89 "target": "c:objc(cs)NSString",
90 "targetFallback": "NSString"
94 "source": "c:objc(cs)NSString(im)StringMethod2",
95 "target": "c:objc(cy)NSString@Category2",
96 "targetFallback": "Category2"
101 "accessLevel": "public",
102 "declarationFragments": [
105 "spelling": "@interface"
112 "kind": "identifier",
113 "spelling": "MyClass1"
117 "interfaceLanguage": "objective-c",
118 "precise": "c:objc(cs)MyClass1"
121 "displayName": "Class",
122 "identifier": "objective-c.class"
129 "uri": "file://INPUT_DIR/myclass_1.h"
134 "kind": "identifier",
135 "spelling": "MyClass1"
140 "kind": "identifier",
141 "spelling": "MyClass1"
151 "accessLevel": "public",
152 "declarationFragments": [
158 "kind": "typeIdentifier",
159 "preciseIdentifier": "c:I",
167 "kind": "identifier",
168 "spelling": "SomeMethod"
175 "functionSignature": {
178 "kind": "typeIdentifier",
179 "preciseIdentifier": "c:I",
185 "interfaceLanguage": "objective-c",
186 "precise": "c:objc(cs)MyClass1(im)SomeMethod"
189 "displayName": "Instance Method",
190 "identifier": "objective-c.method"
197 "uri": "file://INPUT_DIR/input.h"
202 "kind": "identifier",
203 "spelling": "SomeMethod"
212 "kind": "identifier",
213 "spelling": "SomeMethod"
216 "title": "SomeMethod"
224 "accessLevel": "public",
226 "interfaceLanguage": "objective-c",
227 "precise": "c:objc(cy)NSString@Category1"
230 "displayName": "Module Extension",
231 "identifier": "objective-c.module.extension"
235 "accessLevel": "public",
236 "declarationFragments": [
239 "spelling": "@interface"
246 "kind": "typeIdentifier",
247 "preciseIdentifier": "c:objc(cs)NSString",
248 "spelling": "NSString"
255 "kind": "identifier",
256 "spelling": "Category1"
264 "interfaceLanguage": "objective-c",
265 "precise": "c:objc(cy)NSString@Category1"
268 "displayName": "Class Extension",
269 "identifier": "objective-c.class.extension"
276 "uri": "file://INPUT_DIR/input.h"
281 "kind": "identifier",
282 "spelling": "Category1"
287 "kind": "identifier",
288 "spelling": "Category1"
291 "title": "NSString (Category1)"
298 "accessLevel": "public",
299 "declarationFragments": [
305 "kind": "typeIdentifier",
306 "preciseIdentifier": "c:v",
314 "kind": "identifier",
315 "spelling": "StringMethod"
322 "functionSignature": {
325 "kind": "typeIdentifier",
326 "preciseIdentifier": "c:v",
332 "interfaceLanguage": "objective-c",
333 "precise": "c:objc(cs)NSString(im)StringMethod"
336 "displayName": "Instance Method",
337 "identifier": "objective-c.method"
344 "uri": "file://INPUT_DIR/input.h"
349 "kind": "identifier",
350 "spelling": "StringMethod"
359 "kind": "identifier",
360 "spelling": "StringMethod"
363 "title": "StringMethod"
371 "accessLevel": "public",
372 "declarationFragments": [
375 "spelling": "@interface"
382 "kind": "typeIdentifier",
383 "preciseIdentifier": "c:objc(cs)NSString",
384 "spelling": "NSString"
391 "kind": "identifier",
392 "spelling": "Category2"
400 "interfaceLanguage": "objective-c",
401 "precise": "c:objc(cy)NSString@Category2"
404 "displayName": "Class Extension",
405 "identifier": "objective-c.class.extension"
412 "uri": "file://INPUT_DIR/input.h"
417 "kind": "identifier",
418 "spelling": "Category2"
423 "kind": "identifier",
424 "spelling": "Category2"
427 "title": "NSString (Category2)"
434 "accessLevel": "public",
435 "declarationFragments": [
441 "kind": "typeIdentifier",
442 "preciseIdentifier": "c:v",
450 "kind": "identifier",
451 "spelling": "StringMethod2"
458 "functionSignature": {
461 "kind": "typeIdentifier",
462 "preciseIdentifier": "c:v",
468 "interfaceLanguage": "objective-c",
469 "precise": "c:objc(cs)NSString(im)StringMethod2"
472 "displayName": "Instance Method",
473 "identifier": "objective-c.method"
480 "uri": "file://INPUT_DIR/input.h"
485 "kind": "identifier",
486 "spelling": "StringMethod2"
495 "kind": "identifier",
496 "spelling": "StringMethod2"
499 "title": "StringMethod2"