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
13 // CHECK-NOT: warning:
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
45 "name": "Availability",
47 "architecture": "arm64",
62 "accessLevel": "public",
63 "declarationFragments": [
65 "kind": "typeIdentifier",
66 "preciseIdentifier": "c:v",
82 "functionSignature": {
85 "kind": "typeIdentifier",
86 "preciseIdentifier": "c:v",
92 "interfaceLanguage": "c",
96 "displayName": "Function",
97 "identifier": "c.func"
104 "uri": "file://INPUT_DIR/input.h"
109 "kind": "identifier",
115 "kind": "identifier",
126 "accessLevel": "public",
130 "introducedVersion": {
137 "declarationFragments": [
139 "kind": "typeIdentifier",
140 "preciseIdentifier": "c:v",
148 "kind": "identifier",
156 "functionSignature": {
159 "kind": "typeIdentifier",
160 "preciseIdentifier": "c:v",
166 "interfaceLanguage": "c",
170 "displayName": "Function",
171 "identifier": "c.func"
178 "uri": "file://INPUT_DIR/input.h"
183 "kind": "identifier",
189 "kind": "identifier",
200 "accessLevel": "public",
203 "deprecatedVersion": {
209 "introducedVersion": {
214 "obsoletedVersion": {
221 "declarationFragments": [
223 "kind": "typeIdentifier",
224 "preciseIdentifier": "c:v",
232 "kind": "identifier",
240 "functionSignature": {
243 "kind": "typeIdentifier",
244 "preciseIdentifier": "c:v",
250 "interfaceLanguage": "c",
254 "displayName": "Function",
255 "identifier": "c.func"
262 "uri": "file://INPUT_DIR/input.h"
267 "kind": "identifier",
273 "kind": "identifier",
284 "accessLevel": "public",
287 "deprecatedVersion": {
293 "introducedVersion": {
298 "obsoletedVersion": {
306 "introducedVersion": {
314 "introducedVersion": {
321 "declarationFragments": [
323 "kind": "typeIdentifier",
324 "preciseIdentifier": "c:v",
332 "kind": "identifier",
340 "functionSignature": {
343 "kind": "typeIdentifier",
344 "preciseIdentifier": "c:v",
350 "interfaceLanguage": "c",
354 "displayName": "Function",
355 "identifier": "c.func"
362 "uri": "file://INPUT_DIR/input.h"
367 "kind": "identifier",
373 "kind": "identifier",
384 "accessLevel": "public",
388 "isUnconditionallyDeprecated": true
392 "introducedVersion": {
400 "isUnconditionallyUnavailable": true
403 "declarationFragments": [
405 "kind": "typeIdentifier",
406 "preciseIdentifier": "c:v",
414 "kind": "identifier",
422 "functionSignature": {
425 "kind": "typeIdentifier",
426 "preciseIdentifier": "c:v",
432 "interfaceLanguage": "c",
436 "displayName": "Function",
437 "identifier": "c.func"
444 "uri": "file://INPUT_DIR/input.h"
449 "kind": "identifier",
455 "kind": "identifier",