1 // RUN: %clang_cc1 "-triple" "x86_64-apple-ios13.1-macabi" -fsyntax-only -verify %s
2 // RUN: %clang_cc1 "-triple" "x86_64-apple-ios13.1-macabi" -fapplication-extension -D APPEXT -fsyntax-only -verify %s
6 #define maccatalyst maccatalyst_app_extension
7 #define macCatalyst maccatalyst_app_extension
8 #define ios ios_app_extension
12 void f0(int) __attribute__((availability(maccatalyst
,introduced
=2.0,deprecated
=9.1))); // expected-note {{'f0' has been explicitly marked deprecated here}}
13 void f1(int) __attribute__((availability(maccatalyst
,introduced
=2.1)));
14 void f2(int) __attribute__((availability(macCatalyst
,introduced
=2.0,deprecated
=9.0))); // expected-note {{'f2' has been explicitly marked deprecated here}}
15 void f3(int) __attribute__((availability(maccatalyst
,introduced
=3.0, obsoleted
=9.0))); // expected-note {{'f3' has been explicitly marked unavailable here}}
16 void f32(int) __attribute__((availability(maccatalyst
,introduced
=3.0, obsoleted
=9.0))); // expected-note {{'f32' has been explicitly marked unavailable here}}
19 void f5(int) __attribute__((availability(maccatalyst
,introduced
=2.0))) __attribute__((availability(maccatalyst
,deprecated
=9.0))); // expected-note {{'f5' has been explicitly marked deprecated here}}
20 void f6(int) __attribute__((availability(maccatalyst
,deprecated
=9.0))); // expected-note {{'f6' has been explicitly marked deprecated here}}
21 void f6(int) __attribute__((availability(macCatalyst
,introduced
=2.0)));
23 void f7(void) // expected-note {{'f7' has been explicitly marked deprecated here}}
24 __attribute__((availability(maccatalyst
,introduced
=3.0, deprecated
=4.0)))
25 __attribute__((availability(ios
,introduced
=2.0, deprecated
=5.0)));
27 void f8(void) // expected-note {{'f8' has been explicitly marked unavailable here}}
28 __attribute__((availability(maccatalyst
,introduced
=3.0, obsoleted
=4.0)))
29 __attribute__((availability(ios
,introduced
=2.0, obsoleted
=5.0)));
31 void f9(void) // expected-note {{'f9' has been explicitly marked unavailable here}}
32 __attribute__((availability(maccatalyst
,unavailable
)))
33 __attribute__((availability(ios
,introduced
=2.0)));
38 // expected-warning@-2 {{'f0' is deprecated: first deprecated in macCatalyst 9.1}}
40 // expected-warning@-4 {{'f0' is deprecated: first deprecated in macCatalyst (App Extension) 9.1}}
45 // expected-warning@-2 {{'f2' is deprecated: first deprecated in macCatalyst 9.0}}
47 // expected-warning@-4 {{'f2' is deprecated: first deprecated in macCatalyst (App Extension) 9.0}}
51 // expected-error@-2 {{'f3' is unavailable: obsoleted in macCatalyst 9.0}}
53 // expected-error@-4 {{'f3' is unavailable: obsoleted in macCatalyst (App Extension) 9.0}}
57 // expected-error@-2 {{'f32' is unavailable: obsoleted in macCatalyst 9.0}}
59 // expected-error@-4 {{'f32' is unavailable: obsoleted in macCatalyst (App Extension) 9.0}}
61 f5(0); // expected-warning{{'f5' is deprecated: first deprecated in macCatalyst}}
62 f6(0); // expected-warning{{'f6' is deprecated: first deprecated in macCatalyst}}
66 // expected-warning@-2 {{'f7' is deprecated: first deprecated in macCatalyst 4.0}}
68 // expected-warning@-4 {{'f7' is deprecated: first deprecated in macCatalyst (App Extension) 4.0}}
72 // expected-error@-2 {{'f8' is unavailable: obsoleted in macCatalyst 4.0}}
74 // expected-error@-4 {{'f8' is unavailable: obsoleted in macCatalyst (App Extension) 4.0}}
76 f9(); // expected-error {{'f9' is unavailable}}
79 // Don't inherit "deprecated"/"obsoleted" from iOS for Mac Catalyst.
82 __attribute__((availability(maccatalyst
,introduced
=3.0)))
83 __attribute__((availability(ios
,introduced
=2.0, deprecated
=5.0)));
86 __attribute__((availability(maccatalyst
,introduced
=3.0)))
87 __attribute__((availability(ios
,introduced
=2.0, obsoleted
=5.0)));
90 __attribute__((availability(maccatalyst
,introduced
=3.0)))
91 __attribute__((availability(ios
,unavailable
)));
94 __attribute__((availability(ios
,unavailable
)));
97 __attribute__((availability(maccatalyst
,introduced
=3.0)));
99 void dontInheritObsoletedDeprecated(void) {
106 // Inherit the ios availability when Mac Catalyst isn't given.
108 void f202(void) __attribute__((availability(ios
,introduced
=2.0, deprecated
=5.0))); // expected-note {{here}}
109 void f203(void) __attribute__((availability(ios
,introduced
=2.0, obsoleted
=5.0))); // expected-note {{here}}
110 void f204(void) __attribute__((availability(ios
,unavailable
))); // expected-note {{here}}
112 void inheritIosAvailability(void) {
115 // expected-warning@-2 {{'f202' is deprecated: first deprecated in macCatalyst 13.1}}
117 // expected-warning@-4 {{'f202' is deprecated: first deprecated in macCatalyst (App Extension) 13.1}}
121 // expected-error@-2 {{'f203' is unavailable: obsoleted in macCatalyst 13.1}}
123 // expected-error@-4 {{'f203' is unavailable: obsoleted in macCatalyst (App Extension) 13.1}}
127 // expected-error@-2 {{'f204' is unavailable: not available on macCatalyst}}
129 // expected-error@-4 {{'f204' is unavailable: not available on macCatalyst (App Extension)}}