[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Sema / attr-availability-iosmac-infer-from-macos.c
blob12c6d59b61ac2b072b845a022c0fe792dc4e9469
1 // RUN: %clang_cc1 "-triple" "x86_64-apple-ios13.1-macabi" -isysroot %S/Inputs/MacOSX11.0.sdk -fsyntax-only -verify %s
2 // RUN: %clang_cc1 "-triple" "x86_64-apple-ios14-macabi" -isysroot %S/Inputs/MacOSX11.0.sdk -DIOS14 -fsyntax-only -verify %s
4 void f0(void) __attribute__((availability(macOS, introduced = 10.11)));
5 void f1(void) __attribute__((availability(macOS, introduced = 10.15)));
6 void f2(void) __attribute__(( // expected-note {{'f2' has been explicitly marked deprecated here}}
7 availability(macOS, introduced = 10.11,
8 deprecated = 10.12)));
9 void f3(void)
10 __attribute__((availability(macOS, introduced = 10.11, deprecated = 10.14)))
11 __attribute__((availability(iOS, introduced = 11.0)));
13 void f4(void)
14 __attribute__((availability(macOS, introduced = 10, deprecated = 100000)));
16 void fAvail(void) __attribute__((availability(macOS, unavailable)));
18 void f16(void) __attribute__((availability(macOS, introduced = 11.0)));
19 #ifndef IOS14
20 // expected-note@-2 {{here}}
21 #endif
23 void fObs(void) __attribute__((availability(macOS, introduced = 10.11, obsoleted = 10.15))); // expected-note {{'fObs' has been explicitly marked unavailable here}}
25 void fAPItoDepr(void) __attribute__((availability(macOS, introduced = 10.11, deprecated = 100000)));
27 void dontRemapFutureVers(void) __attribute__((availability(macOS, introduced = 20)));
29 void usage(void) {
30 f0();
31 f1();
32 f2(); // expected-warning {{'f2' is deprecated: first deprecated in macCatalyst 13.1}}
33 f3();
34 f4();
35 fAvail();
36 f16();
37 #ifndef IOS14
38 // expected-warning@-2 {{'f16' is only available on macCatalyst 14.0 or newer}} expected-note@-2 {{enclose}}
39 #endif
40 fObs(); // expected-error {{'fObs' is unavailable: obsoleted in macCatalyst 13.1}}
41 fAPItoDepr();
42 dontRemapFutureVers();
45 #ifdef IOS14
47 void f15_4(void) __attribute__((availability(macOS, introduced = 10.15, deprecated = 10.15.4))); // expected-note {{here}}
48 void f15_3(void) __attribute__((availability(macOS, introduced = 10.15, deprecated = 10.15.3))); // expected-note {{here}}
49 void f15_2(void) __attribute__((availability(macOS, introduced = 10.15, deprecated = 10.15.2))); // expected-note {{here}}
51 void usage16(void) {
52 f15_2(); // expected-warning {{'f15_2' is deprecated: first deprecated in macCatalyst 13.3}}
53 f15_3(); // expected-warning {{'f15_3' is deprecated: first deprecated in macCatalyst 13.3.1}}
54 f15_4(); // expected-warning {{'f15_4' is deprecated: first deprecated in macCatalyst 13.4}}
55 f16();
58 #endif