1 // RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin-simulator -verify %s
3 #if !__is_target_arch(x86_64) || !__is_target_arch(X86_64)
4 #error "mismatching arch"
7 #if __is_target_arch(arm64)
8 #error "mismatching arch"
11 // Silently ignore invalid archs. This will ensure that older compilers will
12 // accept headers that support new arches/vendors/os variants.
13 #if __is_target_arch(foo)
17 #if !__is_target_vendor(apple) || !__is_target_vendor(APPLE)
18 #error "mismatching vendor"
21 #if __is_target_vendor(unknown)
22 #error "mismatching vendor"
25 #if __is_target_vendor(foo)
26 #error "invalid vendor"
29 #if !__is_target_os(darwin) || !__is_target_os(DARWIN)
30 #error "mismatching os"
33 #if __is_target_os(ios)
34 #error "mismatching os"
37 #if __is_target_os(foo)
41 #if !__is_target_environment(simulator) || !__is_target_environment(SIMULATOR)
42 #error "mismatching environment"
45 #if __is_target_environment(unknown)
46 #error "mismatching environment"
49 #if __is_target_environment(foo)
50 #error "invalid environment"
53 #if !__has_builtin(__is_target_arch) || !__has_builtin(__is_target_os) || !__has_builtin(__is_target_vendor) || !__has_builtin(__is_target_environment)
54 #error "has builtin doesn't work"
57 #if __is_target_arch(11) // expected-error {{builtin feature check macro requires a parenthesized identifier}}
61 #if __is_target_arch x86 // expected-error{{missing '(' after '__is_target_arch'}}
65 #if __is_target_arch ( x86 // expected-error {{unterminated function-like macro invocation}}
67 #endif // expected-error@-2 {{expected value in expression}}