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 void test() { 25 f0(1); // expected-error {{'f0' is unavailable: not available on}} 26 f1(1); // expected-error {{'f1' is unavailable}} 27 } 28 29