1 // RUN: %clang_cc1 -fsyntax-only -Wunguarded-availability -Wno-unsupported-availability-guard -triple x86_64-apple-macosx10.10.0 -verify %s
5 if (@available(macos 10.12, *)) {}
6 else if (@available(macos 10.11, *)) {}
9 (void)__builtin_available(ios 8, macos 10.10, *);
11 (void)@available(macos 10.11); // expected-error{{must handle potential future platforms with '*'}}
12 (void)@available(macos 10.11, macos 10.11, *); // expected-error{{version for 'macos' already specified}}
14 (void)@available(erik_os 10.11, *); // expected-error{{unrecognized platform name erik_os}}
16 (void)@available(erik_os 10.10, hat_os 1.0, *); // expected-error 2 {{unrecognized platform name}}
18 (void)@available(); // expected-error{{expected a platform name here}}
19 (void)@available(macos 10.10,); // expected-error{{expected a platform name here}}
20 (void)@available(macos); // expected-error{{expected a version}}
21 (void)@available; // expected-error{{expected '('}}
24 void prettyPlatformNames() {
25 (void)@available(iOS 8, tvOS 10, watchOS 3, macOS 10.11, *);
26 (void)__builtin_available(iOSApplicationExtension 8, tvOSApplicationExtension 10,
27 watchOSApplicationExtension 3, macOSApplicationExtension 10.11, *);
30 #if __has_builtin(__builtin_available)
32 // expected-error@-1 {{expected}}