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 --product-name=Macros -target arm64-apple-macosx \
6 // RUN: -x objective-c-header %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:
18 #define FUNC_GEN(NAME, ...) void NAME(__VA_ARGS__);
20 FUNC_GEN(bar
, const int *, unsigned);
22 // Undefining a not previously defined macro should not result in a crash.
25 //--- reference.output.json.in
38 "architecture": "arm64",
53 "accessLevel": "public",
54 "declarationFragments": [
56 "kind": "typeIdentifier",
57 "preciseIdentifier": "c:v",
73 "functionSignature": {
76 "kind": "typeIdentifier",
77 "preciseIdentifier": "c:v",
83 "interfaceLanguage": "objective-c",
87 "displayName": "Function",
88 "identifier": "objective-c.func"
95 "uri": "file://INPUT_DIR/input.h"
100 "kind": "identifier",
106 "kind": "identifier",
117 "accessLevel": "public",
118 "declarationFragments": [
120 "kind": "typeIdentifier",
121 "preciseIdentifier": "c:v",
129 "kind": "identifier",
145 "kind": "typeIdentifier",
146 "preciseIdentifier": "c:I",
154 "kind": "internalParam",
162 "kind": "typeIdentifier",
163 "preciseIdentifier": "c:i",
164 "spelling": "unsigned int"
171 "kind": "internalParam",
179 "functionSignature": {
182 "declarationFragments": [
192 "kind": "typeIdentifier",
193 "preciseIdentifier": "c:I",
201 "kind": "internalParam",
208 "declarationFragments": [
210 "kind": "typeIdentifier",
211 "preciseIdentifier": "c:i",
212 "spelling": "unsigned int"
219 "kind": "internalParam",
228 "kind": "typeIdentifier",
229 "preciseIdentifier": "c:v",
235 "interfaceLanguage": "objective-c",
236 "precise": "c:@F@bar"
239 "displayName": "Function",
240 "identifier": "objective-c.func"
247 "uri": "file://INPUT_DIR/input.h"
252 "kind": "identifier",
258 "kind": "identifier",
269 "accessLevel": "public",
270 "declarationFragments": [
273 "spelling": "#define"
280 "kind": "identifier",
285 "interfaceLanguage": "objective-c",
286 "precise": "c:input.h@8@macro@HELLO"
289 "displayName": "Macro",
290 "identifier": "objective-c.macro"
297 "uri": "file://INPUT_DIR/input.h"
302 "kind": "identifier",
308 "kind": "identifier",