annotate clang/test/SemaObjC/attr-availability-priority.m @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents c4bab56944e8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -triple arm64-apple-tvos12.0 -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
3 void explicit(void) __attribute__((availability(tvos, introduced=11.0, deprecated=12.0))); // expected-note {{marked deprecated here}}
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
4 void inferred(void) __attribute__((availability(ios, introduced=11.0, deprecated=12.0))); // expected-note {{marked deprecated here}}
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
5 void explicitOverInferred(void)
150
anatofuz
parents:
diff changeset
6 __attribute__((availability(ios, introduced=11.0, deprecated=12.0)))
anatofuz
parents:
diff changeset
7 __attribute__((availability(tvos, introduced=11.0)));
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
8 void explicitOverInferred2(void)
150
anatofuz
parents:
diff changeset
9 __attribute__((availability(tvos, introduced=11.0)))
anatofuz
parents:
diff changeset
10 __attribute__((availability(ios, introduced=11.0, deprecated=12.0)));
anatofuz
parents:
diff changeset
11
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
12 void simpleUsage(void) {
150
anatofuz
parents:
diff changeset
13 explicit(); // expected-warning{{'explicit' is deprecated: first deprecated in tvOS 12.0}}
anatofuz
parents:
diff changeset
14 inferred(); // expected-warning{{'inferred' is deprecated: first deprecated in tvOS 12.0}}
anatofuz
parents:
diff changeset
15 // ok, not deprecated for tvOS.
anatofuz
parents:
diff changeset
16 explicitOverInferred();
anatofuz
parents:
diff changeset
17 explicitOverInferred2();
anatofuz
parents:
diff changeset
18 }
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 #pragma clang attribute push (__attribute__((availability(tvos, introduced=11.0, deprecated=12.0))), apply_to=function)
anatofuz
parents:
diff changeset
21
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
22 void explicitFromPragma(void); // expected-note {{marked deprecated here}}
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
23 void explicitWinsOverExplicitFromPragma(void) __attribute__((availability(tvos, introduced=11.0)));
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
24 void implicitLosesOverExplicitFromPragma(void) __attribute__((availability(ios, introduced=11.0))); // expected-note {{marked deprecated here}}
150
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 #pragma clang attribute pop
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 #pragma clang attribute push (__attribute__((availability(ios, introduced=11.0, deprecated=12.0))), apply_to=function)
anatofuz
parents:
diff changeset
29
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
30 void implicitFromPragma(void); // expected-note {{marked deprecated here}}
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
31 void explicitWinsOverImplicitFromPragma(void) __attribute__((availability(tvos, introduced=11.0)));
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
32 void implicitWinsOverImplicitFromPragma(void) __attribute__((availability(ios, introduced=11.0)));
150
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 #pragma clang attribute pop
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 #pragma clang attribute push (__attribute__((availability(tvos, introduced=11.0, deprecated=12.0))), apply_to=function)
anatofuz
parents:
diff changeset
37 #pragma clang attribute push (__attribute__((availability(ios, introduced=11.0, deprecated=11.3))), apply_to=function)
anatofuz
parents:
diff changeset
38
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
39 void pragmaExplicitWinsOverPragmaImplicit(void); // expected-note {{marked deprecated here}}
150
anatofuz
parents:
diff changeset
40
anatofuz
parents:
diff changeset
41 #pragma clang attribute pop
anatofuz
parents:
diff changeset
42 #pragma clang attribute pop
anatofuz
parents:
diff changeset
43
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
44 void pragmaUsage(void) {
150
anatofuz
parents:
diff changeset
45 explicitFromPragma(); // expected-warning {{'explicitFromPragma' is deprecated: first deprecated in tvOS 12.0}}
anatofuz
parents:
diff changeset
46 explicitWinsOverExplicitFromPragma(); // ok
anatofuz
parents:
diff changeset
47 implicitLosesOverExplicitFromPragma(); // expected-warning {{'implicitLosesOverExplicitFromPragma' is deprecated: first deprecated in tvOS 12.0}}
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 implicitFromPragma(); // expected-warning {{'implicitFromPragma' is deprecated: first deprecated in tvOS 12.0}}
anatofuz
parents:
diff changeset
50 explicitWinsOverImplicitFromPragma(); // ok
anatofuz
parents:
diff changeset
51 implicitWinsOverImplicitFromPragma(); // ok
anatofuz
parents:
diff changeset
52 pragmaExplicitWinsOverPragmaImplicit(); // expected-warning {{'pragmaExplicitWinsOverPragmaImplicit' is deprecated: first deprecated in tvOS 12.0}}
anatofuz
parents:
diff changeset
53 }