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/input.h -o %t/output.json | FileCheck -allow-empty %s
9 // Generator version is not consistent across test runs, normalize it.
10 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
11 // RUN: %t/output.json >> %t/output-normalized.json
12 // RUN: diff %t/reference.output.json %t/output-normalized.json
15 // CHECK-NOT: warning:
18 #import "Foundation.h"
21 @interface NSString (Category1)
26 @interface NSString (Category2)
34 //--- reference.output.json.in
47 "architecture": "arm64",
61 "kind": "extensionTo",
62 "source": "c:objc(cy)NSString@Category1",
63 "target": "c:objc(cs)NSString",
64 "targetFallback": "NSString"
68 "source": "c:objc(cs)NSString(im)method1",
69 "target": "c:objc(cy)NSString@Category1",
70 "targetFallback": "Category1"
73 "kind": "extensionTo",
74 "source": "c:objc(cy)NSString@Category2",
75 "target": "c:objc(cs)NSString",
76 "targetFallback": "NSString"
80 "source": "c:objc(cs)NSString(im)method2",
81 "target": "c:objc(cy)NSString@Category2",
82 "targetFallback": "Category2"
87 "accessLevel": "public",
89 "interfaceLanguage": "objective-c",
90 "precise": "c:objc(cy)NSString@Category1"
93 "displayName": "Module Extension",
94 "identifier": "objective-c.module.extension"
98 "accessLevel": "public",
99 "declarationFragments": [
102 "spelling": "@interface"
109 "kind": "typeIdentifier",
110 "preciseIdentifier": "c:objc(cs)NSString",
111 "spelling": "NSString"
118 "kind": "identifier",
119 "spelling": "Category1"
139 "text": "Doc comment 1"
144 "interfaceLanguage": "objective-c",
145 "precise": "c:objc(cy)NSString@Category1"
148 "displayName": "Class Extension",
149 "identifier": "objective-c.class.extension"
156 "uri": "file://INPUT_DIR/input.h"
161 "kind": "identifier",
162 "spelling": "Category1"
167 "kind": "identifier",
168 "spelling": "Category1"
171 "title": "NSString (Category1)"
178 "accessLevel": "public",
179 "declarationFragments": [
185 "kind": "typeIdentifier",
186 "preciseIdentifier": "c:v",
194 "kind": "identifier",
195 "spelling": "method1"
202 "functionSignature": {
205 "kind": "typeIdentifier",
206 "preciseIdentifier": "c:v",
212 "interfaceLanguage": "objective-c",
213 "precise": "c:objc(cs)NSString(im)method1"
216 "displayName": "Instance Method",
217 "identifier": "objective-c.method"
224 "uri": "file://INPUT_DIR/input.h"
229 "kind": "identifier",
230 "spelling": "method1"
239 "kind": "identifier",
240 "spelling": "method1"
251 "accessLevel": "public",
252 "declarationFragments": [
255 "spelling": "@interface"
262 "kind": "typeIdentifier",
263 "preciseIdentifier": "c:objc(cs)NSString",
264 "spelling": "NSString"
271 "kind": "identifier",
272 "spelling": "Category2"
292 "text": "Doc comment 2"
297 "interfaceLanguage": "objective-c",
298 "precise": "c:objc(cy)NSString@Category2"
301 "displayName": "Class Extension",
302 "identifier": "objective-c.class.extension"
309 "uri": "file://INPUT_DIR/input.h"
314 "kind": "identifier",
315 "spelling": "Category2"
320 "kind": "identifier",
321 "spelling": "Category2"
324 "title": "NSString (Category2)"
331 "accessLevel": "public",
332 "declarationFragments": [
338 "kind": "typeIdentifier",
339 "preciseIdentifier": "c:v",
347 "kind": "identifier",
348 "spelling": "method2"
355 "functionSignature": {
358 "kind": "typeIdentifier",
359 "preciseIdentifier": "c:v",
365 "interfaceLanguage": "objective-c",
366 "precise": "c:objc(cs)NSString(im)method2"
369 "displayName": "Instance Method",
370 "identifier": "objective-c.method"
377 "uri": "file://INPUT_DIR/input.h"
382 "kind": "identifier",
383 "spelling": "method2"
392 "kind": "identifier",
393 "spelling": "method2"