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:
19 #define MACRO_FUN(x) x x
20 #define FUN(x, y, z) x + y + z
21 #define FUNC99(x, ...)
24 //--- reference.output.json.in
37 "architecture": "arm64",
52 "accessLevel": "public",
53 "declarationFragments": [
68 "interfaceLanguage": "objective-c",
69 "precise": "c:input.h@8@macro@HELLO"
72 "displayName": "Macro",
73 "identifier": "objective-c.macro"
80 "uri": "file://INPUT_DIR/input.h"
102 "accessLevel": "public",
103 "declarationFragments": [
106 "spelling": "#define"
113 "kind": "identifier",
118 "interfaceLanguage": "objective-c",
119 "precise": "c:input.h@24@macro@WORLD"
122 "displayName": "Macro",
123 "identifier": "objective-c.macro"
130 "uri": "file://INPUT_DIR/input.h"
135 "kind": "identifier",
141 "kind": "identifier",
152 "accessLevel": "public",
153 "declarationFragments": [
156 "spelling": "#define"
163 "kind": "identifier",
164 "spelling": "MACRO_FUN"
171 "kind": "internalParam",
180 "interfaceLanguage": "objective-c",
181 "precise": "c:input.h@40@macro@MACRO_FUN"
184 "displayName": "Macro",
185 "identifier": "objective-c.macro"
192 "uri": "file://INPUT_DIR/input.h"
197 "kind": "identifier",
198 "spelling": "MACRO_FUN"
203 "kind": "identifier",
204 "spelling": "MACRO_FUN"
214 "accessLevel": "public",
215 "declarationFragments": [
218 "spelling": "#define"
225 "kind": "identifier",
233 "kind": "internalParam",
241 "kind": "internalParam",
249 "kind": "internalParam",
258 "interfaceLanguage": "objective-c",
259 "precise": "c:input.h@65@macro@FUN"
262 "displayName": "Macro",
263 "identifier": "objective-c.macro"
270 "uri": "file://INPUT_DIR/input.h"
275 "kind": "identifier",
281 "kind": "identifier",
292 "accessLevel": "public",
293 "declarationFragments": [
296 "spelling": "#define"
303 "kind": "identifier",
311 "kind": "internalParam",
320 "interfaceLanguage": "objective-c",
321 "precise": "c:input.h@96@macro@FUNC99"
324 "displayName": "Macro",
325 "identifier": "objective-c.macro"
332 "uri": "file://INPUT_DIR/input.h"
337 "kind": "identifier",
343 "kind": "identifier",
354 "accessLevel": "public",
355 "declarationFragments": [
358 "spelling": "#define"
365 "kind": "identifier",
373 "kind": "internalParam",
382 "interfaceLanguage": "objective-c",
383 "precise": "c:input.h@119@macro@FUNGNU"
386 "displayName": "Macro",
387 "identifier": "objective-c.macro"
394 "uri": "file://INPUT_DIR/input.h"
399 "kind": "identifier",
405 "kind": "identifier",