[AMDGPU][AsmParser][NFC] Get rid of custom default operand handlers.
[llvm-project.git] / clang / test / ExtractAPI / availability.c
blob0c8cd3629f3fdeec5096070c413b3ac9cdd79148
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_cc1 -extract-api --product-name=Availability -triple arm64-apple-macosx -x c-header %t/input.h -o %t/output.json -verify
7 // Generator version is not consistent across test runs, normalize it.
8 // RUN: sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g" \
9 // RUN: %t/output.json >> %t/output-normalized.json
10 // RUN: diff %t/reference.output.json %t/output-normalized.json
12 // CHECK-NOT: error:
13 // CHECK-NOT: warning:
15 //--- input.h
16 void a(void);
18 void b(void) __attribute__((availability(macos, introduced=12.0)));
20 void c(void) __attribute__((availability(macos, introduced=11.0, deprecated=12.0, obsoleted=20.0)));
22 void d(void) __attribute__((availability(macos, introduced=11.0, deprecated=12.0, obsoleted=20.0))) __attribute__((availability(ios, introduced=13.0)));
24 void e(void) __attribute__((deprecated)) __attribute__((availability(macos, introduced=11.0)));
26 void f(void) __attribute__((unavailable)) __attribute__((availability(macos, introduced=11.0)));
28 void d(void) __attribute__((availability(tvos, introduced=15.0)));
30 void e(void) __attribute__((availability(tvos, unavailable)));
32 ///expected-no-diagnostics
34 //--- reference.output.json.in
36 "metadata": {
37 "formatVersion": {
38 "major": 0,
39 "minor": 5,
40 "patch": 3
42 "generator": "?"
44 "module": {
45 "name": "Availability",
46 "platform": {
47 "architecture": "arm64",
48 "operatingSystem": {
49 "minimumVersion": {
50 "major": 11,
51 "minor": 0,
52 "patch": 0
54 "name": "macosx"
56 "vendor": "apple"
59 "relationships": [],
60 "symbols": [
62 "accessLevel": "public",
63 "declarationFragments": [
65 "kind": "typeIdentifier",
66 "preciseIdentifier": "c:v",
67 "spelling": "void"
70 "kind": "text",
71 "spelling": " "
74 "kind": "identifier",
75 "spelling": "a"
78 "kind": "text",
79 "spelling": "();"
82 "functionSignature": {
83 "returns": [
85 "kind": "typeIdentifier",
86 "preciseIdentifier": "c:v",
87 "spelling": "void"
91 "identifier": {
92 "interfaceLanguage": "c",
93 "precise": "c:@F@a"
95 "kind": {
96 "displayName": "Function",
97 "identifier": "c.func"
99 "location": {
100 "position": {
101 "character": 6,
102 "line": 1
104 "uri": "file://INPUT_DIR/input.h"
106 "names": {
107 "navigator": [
109 "kind": "identifier",
110 "spelling": "a"
113 "subHeading": [
115 "kind": "identifier",
116 "spelling": "a"
119 "title": "a"
121 "pathComponents": [
126 "accessLevel": "public",
127 "availability": [
129 "domain": "macos",
130 "introducedVersion": {
131 "major": 12,
132 "minor": 0,
133 "patch": 0
137 "declarationFragments": [
139 "kind": "typeIdentifier",
140 "preciseIdentifier": "c:v",
141 "spelling": "void"
144 "kind": "text",
145 "spelling": " "
148 "kind": "identifier",
149 "spelling": "b"
152 "kind": "text",
153 "spelling": "();"
156 "functionSignature": {
157 "returns": [
159 "kind": "typeIdentifier",
160 "preciseIdentifier": "c:v",
161 "spelling": "void"
165 "identifier": {
166 "interfaceLanguage": "c",
167 "precise": "c:@F@b"
169 "kind": {
170 "displayName": "Function",
171 "identifier": "c.func"
173 "location": {
174 "position": {
175 "character": 6,
176 "line": 3
178 "uri": "file://INPUT_DIR/input.h"
180 "names": {
181 "navigator": [
183 "kind": "identifier",
184 "spelling": "b"
187 "subHeading": [
189 "kind": "identifier",
190 "spelling": "b"
193 "title": "b"
195 "pathComponents": [
200 "accessLevel": "public",
201 "availability": [
203 "deprecatedVersion": {
204 "major": 12,
205 "minor": 0,
206 "patch": 0
208 "domain": "macos",
209 "introducedVersion": {
210 "major": 11,
211 "minor": 0,
212 "patch": 0
214 "obsoletedVersion": {
215 "major": 20,
216 "minor": 0,
217 "patch": 0
221 "declarationFragments": [
223 "kind": "typeIdentifier",
224 "preciseIdentifier": "c:v",
225 "spelling": "void"
228 "kind": "text",
229 "spelling": " "
232 "kind": "identifier",
233 "spelling": "c"
236 "kind": "text",
237 "spelling": "();"
240 "functionSignature": {
241 "returns": [
243 "kind": "typeIdentifier",
244 "preciseIdentifier": "c:v",
245 "spelling": "void"
249 "identifier": {
250 "interfaceLanguage": "c",
251 "precise": "c:@F@c"
253 "kind": {
254 "displayName": "Function",
255 "identifier": "c.func"
257 "location": {
258 "position": {
259 "character": 6,
260 "line": 5
262 "uri": "file://INPUT_DIR/input.h"
264 "names": {
265 "navigator": [
267 "kind": "identifier",
268 "spelling": "c"
271 "subHeading": [
273 "kind": "identifier",
274 "spelling": "c"
277 "title": "c"
279 "pathComponents": [
284 "accessLevel": "public",
285 "availability": [
287 "deprecatedVersion": {
288 "major": 12,
289 "minor": 0,
290 "patch": 0
292 "domain": "macos",
293 "introducedVersion": {
294 "major": 11,
295 "minor": 0,
296 "patch": 0
298 "obsoletedVersion": {
299 "major": 20,
300 "minor": 0,
301 "patch": 0
305 "domain": "ios",
306 "introducedVersion": {
307 "major": 13,
308 "minor": 0,
309 "patch": 0
313 "domain": "tvos",
314 "introducedVersion": {
315 "major": 15,
316 "minor": 0,
317 "patch": 0
321 "declarationFragments": [
323 "kind": "typeIdentifier",
324 "preciseIdentifier": "c:v",
325 "spelling": "void"
328 "kind": "text",
329 "spelling": " "
332 "kind": "identifier",
333 "spelling": "d"
336 "kind": "text",
337 "spelling": "();"
340 "functionSignature": {
341 "returns": [
343 "kind": "typeIdentifier",
344 "preciseIdentifier": "c:v",
345 "spelling": "void"
349 "identifier": {
350 "interfaceLanguage": "c",
351 "precise": "c:@F@d"
353 "kind": {
354 "displayName": "Function",
355 "identifier": "c.func"
357 "location": {
358 "position": {
359 "character": 6,
360 "line": 7
362 "uri": "file://INPUT_DIR/input.h"
364 "names": {
365 "navigator": [
367 "kind": "identifier",
368 "spelling": "d"
371 "subHeading": [
373 "kind": "identifier",
374 "spelling": "d"
377 "title": "d"
379 "pathComponents": [
384 "accessLevel": "public",
385 "availability": [
387 "domain": "*",
388 "isUnconditionallyDeprecated": true
391 "domain": "macos",
392 "introducedVersion": {
393 "major": 11,
394 "minor": 0,
395 "patch": 0
399 "domain": "tvos",
400 "isUnconditionallyUnavailable": true
403 "declarationFragments": [
405 "kind": "typeIdentifier",
406 "preciseIdentifier": "c:v",
407 "spelling": "void"
410 "kind": "text",
411 "spelling": " "
414 "kind": "identifier",
415 "spelling": "e"
418 "kind": "text",
419 "spelling": "();"
422 "functionSignature": {
423 "returns": [
425 "kind": "typeIdentifier",
426 "preciseIdentifier": "c:v",
427 "spelling": "void"
431 "identifier": {
432 "interfaceLanguage": "c",
433 "precise": "c:@F@e"
435 "kind": {
436 "displayName": "Function",
437 "identifier": "c.func"
439 "location": {
440 "position": {
441 "character": 6,
442 "line": 9
444 "uri": "file://INPUT_DIR/input.h"
446 "names": {
447 "navigator": [
449 "kind": "identifier",
450 "spelling": "e"
453 "subHeading": [
455 "kind": "identifier",
456 "spelling": "e"
459 "title": "e"
461 "pathComponents": [