| 1 |
// RUN: %clang_cc1 -triple arm64-apple-tvos12.0 -fsyntax-only -verify %s |
| 2 |
|
| 3 |
void explicit(void) __attribute__((availability(tvos, introduced=11.0, deprecated=12.0))); // expected-note {{marked deprecated here}} |
| 4 |
void inferred(void) __attribute__((availability(ios, introduced=11.0, deprecated=12.0))); // expected-note {{marked deprecated here}} |
| 5 |
void explicitOverInferred(void) |
| 6 |
__attribute__((availability(ios, introduced=11.0, deprecated=12.0))) |
| 7 |
__attribute__((availability(tvos, introduced=11.0))); |
| 8 |
void explicitOverInferred2(void) |
| 9 |
__attribute__((availability(tvos, introduced=11.0))) |
| 10 |
__attribute__((availability(ios, introduced=11.0, deprecated=12.0))); |
| 11 |
|
| 12 |
void simpleUsage(void) { |
| 13 |
explicit(); // expected-warning{{'explicit' is deprecated: first deprecated in tvOS 12.0}} |
| 14 |
inferred(); // expected-warning{{'inferred' is deprecated: first deprecated in tvOS 12.0}} |
| 15 |
// ok, not deprecated for tvOS. |
| 16 |
explicitOverInferred(); |
| 17 |
explicitOverInferred2(); |
| 18 |
} |
| 19 |
|
| 20 |
#pragma clang attribute push (__attribute__((availability(tvos, introduced=11.0, deprecated=12.0))), apply_to=function) |
| 21 |
|
| 22 |
void explicitFromPragma(void); // expected-note {{marked deprecated here}} |
| 23 |
void explicitWinsOverExplicitFromPragma(void) __attribute__((availability(tvos, introduced=11.0))); |
| 24 |
void implicitLosesOverExplicitFromPragma(void) __attribute__((availability(ios, introduced=11.0))); // expected-note {{marked deprecated here}} |
| 25 |
|
| 26 |
#pragma clang attribute pop |
| 27 |
|
| 28 |
#pragma clang attribute push (__attribute__((availability(ios, introduced=11.0, deprecated=12.0))), apply_to=function) |
| 29 |
|
| 30 |
void implicitFromPragma(void); // expected-note {{marked deprecated here}} |
| 31 |
void explicitWinsOverImplicitFromPragma(void) __attribute__((availability(tvos, introduced=11.0))); |
| 32 |
void implicitWinsOverImplicitFromPragma(void) __attribute__((availability(ios, introduced=11.0))); |
| 33 |
|
| 34 |
#pragma clang attribute pop |
| 35 |
|
| 36 |
#pragma clang attribute push (__attribute__((availability(tvos, introduced=11.0, deprecated=12.0))), apply_to=function) |
| 37 |
#pragma clang attribute push (__attribute__((availability(ios, introduced=11.0, deprecated=11.3))), apply_to=function) |
| 38 |
|
| 39 |
void pragmaExplicitWinsOverPragmaImplicit(void); // expected-note {{marked deprecated here}} |
| 40 |
|
| 41 |
#pragma clang attribute pop |
| 42 |
#pragma clang attribute pop |
| 43 |
|
| 44 |
void pragmaUsage(void) { |
| 45 |
explicitFromPragma(); // expected-warning {{'explicitFromPragma' is deprecated: first deprecated in tvOS 12.0}} |
| 46 |
explicitWinsOverExplicitFromPragma(); // ok |
| 47 |
implicitLosesOverExplicitFromPragma(); // expected-warning {{'implicitLosesOverExplicitFromPragma' is deprecated: first deprecated in tvOS 12.0}} |
| 48 |
|
| 49 |
implicitFromPragma(); // expected-warning {{'implicitFromPragma' is deprecated: first deprecated in tvOS 12.0}} |
| 50 |
explicitWinsOverImplicitFromPragma(); // ok |
| 51 |
implicitWinsOverImplicitFromPragma(); // ok |
| 52 |
pragmaExplicitWinsOverPragmaImplicit(); // expected-warning {{'pragmaExplicitWinsOverPragmaImplicit' is deprecated: first deprecated in tvOS 12.0}} |
| 53 |
} |