[AMDGPU][AsmParser][NFC] Get rid of custom default operand handlers.
[llvm-project.git] / clang / test / ExtractAPI / macros.c
blobc8df9ec8a9daa8ae03a86ef657dcb75a55012a65
1 // RUN: rm -rf %t
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
13 // CHECK-NOT: error:
14 // CHECK-NOT: warning:
16 //--- input.h
17 #define HELLO 1
18 #define WORLD 2
19 #define MACRO_FUN(x) x x
20 #define FUN(x, y, z) x + y + z
21 #define FUNC99(x, ...)
22 #define FUNGNU(x...)
24 //--- reference.output.json.in
26 "metadata": {
27 "formatVersion": {
28 "major": 0,
29 "minor": 5,
30 "patch": 3
32 "generator": "?"
34 "module": {
35 "name": "Macros",
36 "platform": {
37 "architecture": "arm64",
38 "operatingSystem": {
39 "minimumVersion": {
40 "major": 11,
41 "minor": 0,
42 "patch": 0
44 "name": "macosx"
46 "vendor": "apple"
49 "relationships": [],
50 "symbols": [
52 "accessLevel": "public",
53 "declarationFragments": [
55 "kind": "keyword",
56 "spelling": "#define"
59 "kind": "text",
60 "spelling": " "
63 "kind": "identifier",
64 "spelling": "HELLO"
67 "identifier": {
68 "interfaceLanguage": "objective-c",
69 "precise": "c:input.h@8@macro@HELLO"
71 "kind": {
72 "displayName": "Macro",
73 "identifier": "objective-c.macro"
75 "location": {
76 "position": {
77 "character": 9,
78 "line": 1
80 "uri": "file://INPUT_DIR/input.h"
82 "names": {
83 "navigator": [
85 "kind": "identifier",
86 "spelling": "HELLO"
89 "subHeading": [
91 "kind": "identifier",
92 "spelling": "HELLO"
95 "title": "HELLO"
97 "pathComponents": [
98 "HELLO"
102 "accessLevel": "public",
103 "declarationFragments": [
105 "kind": "keyword",
106 "spelling": "#define"
109 "kind": "text",
110 "spelling": " "
113 "kind": "identifier",
114 "spelling": "WORLD"
117 "identifier": {
118 "interfaceLanguage": "objective-c",
119 "precise": "c:input.h@24@macro@WORLD"
121 "kind": {
122 "displayName": "Macro",
123 "identifier": "objective-c.macro"
125 "location": {
126 "position": {
127 "character": 9,
128 "line": 2
130 "uri": "file://INPUT_DIR/input.h"
132 "names": {
133 "navigator": [
135 "kind": "identifier",
136 "spelling": "WORLD"
139 "subHeading": [
141 "kind": "identifier",
142 "spelling": "WORLD"
145 "title": "WORLD"
147 "pathComponents": [
148 "WORLD"
152 "accessLevel": "public",
153 "declarationFragments": [
155 "kind": "keyword",
156 "spelling": "#define"
159 "kind": "text",
160 "spelling": " "
163 "kind": "identifier",
164 "spelling": "MACRO_FUN"
167 "kind": "text",
168 "spelling": "("
171 "kind": "internalParam",
172 "spelling": "x"
175 "kind": "text",
176 "spelling": ")"
179 "identifier": {
180 "interfaceLanguage": "objective-c",
181 "precise": "c:input.h@40@macro@MACRO_FUN"
183 "kind": {
184 "displayName": "Macro",
185 "identifier": "objective-c.macro"
187 "location": {
188 "position": {
189 "character": 9,
190 "line": 3
192 "uri": "file://INPUT_DIR/input.h"
194 "names": {
195 "navigator": [
197 "kind": "identifier",
198 "spelling": "MACRO_FUN"
201 "subHeading": [
203 "kind": "identifier",
204 "spelling": "MACRO_FUN"
207 "title": "MACRO_FUN"
209 "pathComponents": [
210 "MACRO_FUN"
214 "accessLevel": "public",
215 "declarationFragments": [
217 "kind": "keyword",
218 "spelling": "#define"
221 "kind": "text",
222 "spelling": " "
225 "kind": "identifier",
226 "spelling": "FUN"
229 "kind": "text",
230 "spelling": "("
233 "kind": "internalParam",
234 "spelling": "x"
237 "kind": "text",
238 "spelling": ", "
241 "kind": "internalParam",
242 "spelling": "y"
245 "kind": "text",
246 "spelling": ", "
249 "kind": "internalParam",
250 "spelling": "z"
253 "kind": "text",
254 "spelling": ")"
257 "identifier": {
258 "interfaceLanguage": "objective-c",
259 "precise": "c:input.h@65@macro@FUN"
261 "kind": {
262 "displayName": "Macro",
263 "identifier": "objective-c.macro"
265 "location": {
266 "position": {
267 "character": 9,
268 "line": 4
270 "uri": "file://INPUT_DIR/input.h"
272 "names": {
273 "navigator": [
275 "kind": "identifier",
276 "spelling": "FUN"
279 "subHeading": [
281 "kind": "identifier",
282 "spelling": "FUN"
285 "title": "FUN"
287 "pathComponents": [
288 "FUN"
292 "accessLevel": "public",
293 "declarationFragments": [
295 "kind": "keyword",
296 "spelling": "#define"
299 "kind": "text",
300 "spelling": " "
303 "kind": "identifier",
304 "spelling": "FUNC99"
307 "kind": "text",
308 "spelling": "("
311 "kind": "internalParam",
312 "spelling": "x"
315 "kind": "text",
316 "spelling": ", ...)"
319 "identifier": {
320 "interfaceLanguage": "objective-c",
321 "precise": "c:input.h@96@macro@FUNC99"
323 "kind": {
324 "displayName": "Macro",
325 "identifier": "objective-c.macro"
327 "location": {
328 "position": {
329 "character": 9,
330 "line": 5
332 "uri": "file://INPUT_DIR/input.h"
334 "names": {
335 "navigator": [
337 "kind": "identifier",
338 "spelling": "FUNC99"
341 "subHeading": [
343 "kind": "identifier",
344 "spelling": "FUNC99"
347 "title": "FUNC99"
349 "pathComponents": [
350 "FUNC99"
354 "accessLevel": "public",
355 "declarationFragments": [
357 "kind": "keyword",
358 "spelling": "#define"
361 "kind": "text",
362 "spelling": " "
365 "kind": "identifier",
366 "spelling": "FUNGNU"
369 "kind": "text",
370 "spelling": "("
373 "kind": "internalParam",
374 "spelling": "x"
377 "kind": "text",
378 "spelling": "...)"
381 "identifier": {
382 "interfaceLanguage": "objective-c",
383 "precise": "c:input.h@119@macro@FUNGNU"
385 "kind": {
386 "displayName": "Macro",
387 "identifier": "objective-c.macro"
389 "location": {
390 "position": {
391 "character": 9,
392 "line": 6
394 "uri": "file://INPUT_DIR/input.h"
396 "names": {
397 "navigator": [
399 "kind": "identifier",
400 "spelling": "FUNGNU"
403 "subHeading": [
405 "kind": "identifier",
406 "spelling": "FUNGNU"
409 "title": "FUNGNU"
411 "pathComponents": [
412 "FUNGNU"