• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -fsyntax-only -fapplication-extension %s -verify
2 // RUN: %clang_cc1 -triple armv7-apple-ios9.0 -fsyntax-only -fapplication-extension %s -verify
3 // RUN: %clang_cc1 -triple arm64-apple-tvos3.0 -fsyntax-only -fapplication-extension -DTVOS=1 -verify %s
4 // RUN: %clang_cc1 -triple arm64-apple-tvos3.0 -fsyntax-only -fapplication-extension -verify %s
5 
6 #if __has_feature(attribute_availability_app_extension)
7  __attribute__((availability(macosx_app_extension,unavailable)))
8 #ifndef TVOS
9  __attribute__((availability(ios_app_extension,unavailable)))
10 #else
11  __attribute__((availability(tvos_app_extension,unavailable)))
12 #endif
13 #endif
14 void f0(int); // expected-note {{'f0' has been explicitly marked unavailable here}}
15 
16 __attribute__((availability(macosx,unavailable)))
17 #ifndef TVOS
18 __attribute__((availability(ios,unavailable)))
19 #else
20   __attribute__((availability(tvos,unavailable)))
21 #endif
22 void f1(int); // expected-note {{'f1' has been explicitly marked unavailable here}}
23 
24 #if __has_feature(attribute_availability_app_extension)
25  __attribute__((availability(macOSApplicationExtension,unavailable)))
26 #ifndef TVOS
27  __attribute__((availability(iOSApplicationExtension,unavailable)))
28 #else
29  __attribute__((availability(tvOSApplicationExtension,unavailable)))
30 #endif
31 #endif
32 void f2(int); // expected-note {{'f2' has been explicitly marked unavailable here}}
33 
test()34 void test() {
35   f0(1); // expected-error {{'f0' is unavailable: not available on}}
36   f1(1); // expected-error {{'f1' is unavailable}}
37   f2(2); // expected-error {{'f2' is unavailable: not available on}}
38 }
39 
40