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)));
29 ///expected-no-diagnostics
31 //--- reference.output.json.in
42 "name": "Availability",
44 "architecture": "arm64",
59 "accessLevel": "public",
60 "declarationFragments": [
62 "kind": "typeIdentifier",
63 "preciseIdentifier": "c:v",
79 "functionSignature": {
82 "kind": "typeIdentifier",
83 "preciseIdentifier": "c:v",
89 "interfaceLanguage": "c",
93 "displayName": "Function",
94 "identifier": "c.func"
101 "uri": "file://INPUT_DIR/input.h"
106 "kind": "identifier",
112 "kind": "identifier",
123 "accessLevel": "public",
127 "introducedVersion": {
134 "declarationFragments": [
136 "kind": "typeIdentifier",
137 "preciseIdentifier": "c:v",
145 "kind": "identifier",
153 "functionSignature": {
156 "kind": "typeIdentifier",
157 "preciseIdentifier": "c:v",
163 "interfaceLanguage": "c",
167 "displayName": "Function",
168 "identifier": "c.func"
175 "uri": "file://INPUT_DIR/input.h"
180 "kind": "identifier",
186 "kind": "identifier",
197 "accessLevel": "public",
200 "deprecatedVersion": {
206 "introducedVersion": {
211 "obsoletedVersion": {
218 "declarationFragments": [
220 "kind": "typeIdentifier",
221 "preciseIdentifier": "c:v",
229 "kind": "identifier",
237 "functionSignature": {
240 "kind": "typeIdentifier",
241 "preciseIdentifier": "c:v",
247 "interfaceLanguage": "c",
251 "displayName": "Function",
252 "identifier": "c.func"
259 "uri": "file://INPUT_DIR/input.h"
264 "kind": "identifier",
270 "kind": "identifier",
281 "accessLevel": "public",
284 "deprecatedVersion": {
290 "introducedVersion": {
295 "obsoletedVersion": {
303 "introducedVersion": {
311 "introducedVersion": {
318 "declarationFragments": [
320 "kind": "typeIdentifier",
321 "preciseIdentifier": "c:v",
329 "kind": "identifier",
337 "functionSignature": {
340 "kind": "typeIdentifier",
341 "preciseIdentifier": "c:v",
347 "interfaceLanguage": "c",
351 "displayName": "Function",
352 "identifier": "c.func"
359 "uri": "file://INPUT_DIR/input.h"
364 "kind": "identifier",
370 "kind": "identifier",
381 "accessLevel": "public",
385 "isUnconditionallyDeprecated": true
389 "introducedVersion": {
396 "declarationFragments": [
398 "kind": "typeIdentifier",
399 "preciseIdentifier": "c:v",
407 "kind": "identifier",
415 "functionSignature": {
418 "kind": "typeIdentifier",
419 "preciseIdentifier": "c:v",
425 "interfaceLanguage": "c",
429 "displayName": "Function",
430 "identifier": "c.func"
437 "uri": "file://INPUT_DIR/input.h"
442 "kind": "identifier",
448 "kind": "identifier",