File: attr-availability-iosmac-infer-from-macos.c

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (58 lines) | stat: -rw-r--r-- 2,499 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// RUN: %clang_cc1 "-triple" "x86_64-apple-ios13.1-macabi" -isysroot %S/Inputs/MacOSX11.0.sdk -fsyntax-only -verify %s
// RUN: %clang_cc1 "-triple" "x86_64-apple-ios14-macabi" -isysroot %S/Inputs/MacOSX11.0.sdk -DIOS14 -fsyntax-only -verify %s

void f0(void) __attribute__((availability(macOS, introduced = 10.11)));
void f1(void) __attribute__((availability(macOS, introduced = 10.15)));
void f2(void) __attribute__(( // expected-note {{'f2' has been explicitly marked deprecated here}}
    availability(macOS, introduced = 10.11,
                 deprecated = 10.12)));
void f3(void)
    __attribute__((availability(macOS, introduced = 10.11, deprecated = 10.14)))
    __attribute__((availability(iOS, introduced = 11.0)));

void f4(void)
__attribute__((availability(macOS, introduced = 10, deprecated = 100000)));

void fAvail(void) __attribute__((availability(macOS, unavailable)));

void f16(void) __attribute__((availability(macOS, introduced = 11.0)));
#ifndef IOS14
// expected-note@-2 {{here}}
#endif

void fObs(void) __attribute__((availability(macOS, introduced = 10.11, obsoleted = 10.15))); // expected-note {{'fObs' has been explicitly marked unavailable here}}

void fAPItoDepr(void) __attribute__((availability(macOS, introduced = 10.11, deprecated = 100000)));

void dontRemapFutureVers(void) __attribute__((availability(macOS, introduced = 20)));

void usage(void) {
  f0();
  f1();
  f2(); // expected-warning {{'f2' is deprecated: first deprecated in macCatalyst 13.1}}
  f3();
  f4();
  fAvail();
  f16();
#ifndef IOS14
  // expected-warning@-2 {{'f16' is only available on macCatalyst 14.0 or newer}} expected-note@-2 {{enclose}}
#endif
  fObs(); // expected-error {{'fObs' is unavailable: obsoleted in macCatalyst 13.1}}
  fAPItoDepr();
  dontRemapFutureVers();
}

#ifdef IOS14

void f15_4(void) __attribute__((availability(macOS, introduced = 10.15, deprecated = 10.15.4))); // expected-note {{here}}
void f15_3(void) __attribute__((availability(macOS, introduced = 10.15, deprecated = 10.15.3))); // expected-note {{here}}
void f15_2(void) __attribute__((availability(macOS, introduced = 10.15, deprecated = 10.15.2))); // expected-note {{here}}

void usage16(void) {
  f15_2(); // expected-warning {{'f15_2' is deprecated: first deprecated in macCatalyst 13.3}}
  f15_3(); // expected-warning {{'f15_3' is deprecated: first deprecated in macCatalyst 13.3.1}}
  f15_4(); // expected-warning {{'f15_4' is deprecated: first deprecated in macCatalyst 13.4}}
  f16();
}

#endif