54 lines · plain
1// RUN: %clang_cc1 -triple arm64-apple-tvos12.0 -fsyntax-only -verify %s2 3void explicit(void) __attribute__((availability(tvos, introduced=11.0, deprecated=12.0))); // expected-note {{marked deprecated here}}4void inferred(void) __attribute__((availability(ios, introduced=11.0, deprecated=12.0))); // expected-note {{marked deprecated here}}5void explicitOverInferred(void)6__attribute__((availability(ios, introduced=11.0, deprecated=12.0)))7__attribute__((availability(tvos, introduced=11.0)));8void explicitOverInferred2(void)9__attribute__((availability(tvos, introduced=11.0)))10__attribute__((availability(ios, introduced=11.0, deprecated=12.0)));11 12void 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 22void explicitFromPragma(void); // expected-note {{marked deprecated here}}23void explicitWinsOverExplicitFromPragma(void) __attribute__((availability(tvos, introduced=11.0)));24void implicitLosesOverExplicitFromPragma(void) __attribute__((availability(ios, introduced=11.0))); // expected-note {{marked deprecated here}}25 26#pragma clang attribute pop27 28#pragma clang attribute push (__attribute__((availability(ios, introduced=11.0, deprecated=12.0))), apply_to=function)29 30void implicitFromPragma(void); // expected-note {{marked deprecated here}}31void explicitWinsOverImplicitFromPragma(void) __attribute__((availability(tvos, introduced=11.0)));32void implicitWinsOverImplicitFromPragma(void) __attribute__((availability(ios, introduced=11.0)));33 34#pragma clang attribute pop35 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 39void pragmaExplicitWinsOverPragmaImplicit(void); // expected-note {{marked deprecated here}}40 41#pragma clang attribute pop42#pragma clang attribute pop43 44void pragmaUsage(void) {45 explicitFromPragma(); // expected-warning {{'explicitFromPragma' is deprecated: first deprecated in tvOS 12.0}}46 explicitWinsOverExplicitFromPragma(); // ok47 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(); // ok51 implicitWinsOverImplicitFromPragma(); // ok52 pragmaExplicitWinsOverPragmaImplicit(); // expected-warning {{'pragmaExplicitWinsOverPragmaImplicit' is deprecated: first deprecated in tvOS 12.0}}53}54