150
|
1 // RUN: %clang_cc1 -triple arm64-apple-tvos12.0 -fsyntax-only -verify %s
|
|
2
|
236
|
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)
|
150
|
6 __attribute__((availability(ios, introduced=11.0, deprecated=12.0)))
|
|
7 __attribute__((availability(tvos, introduced=11.0)));
|
236
|
8 void explicitOverInferred2(void)
|
150
|
9 __attribute__((availability(tvos, introduced=11.0)))
|
|
10 __attribute__((availability(ios, introduced=11.0, deprecated=12.0)));
|
|
11
|
236
|
12 void simpleUsage(void) {
|
150
|
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
|
236
|
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}}
|
150
|
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
|
236
|
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)));
|
150
|
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
|
236
|
39 void pragmaExplicitWinsOverPragmaImplicit(void); // expected-note {{marked deprecated here}}
|
150
|
40
|
|
41 #pragma clang attribute pop
|
|
42 #pragma clang attribute pop
|
|
43
|
236
|
44 void pragmaUsage(void) {
|
150
|
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 }
|