brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 44bdb11 Raw
68 lines · c
1// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin-simulator -verify %s2 3#if !__is_target_arch(x86_64) || !__is_target_arch(X86_64)4  #error "mismatching arch"5#endif6 7#if __is_target_arch(arm64)8  #error "mismatching arch"9#endif10 11// Silently ignore invalid archs. This will ensure that older compilers will12// accept headers that support new arches/vendors/os variants.13#if __is_target_arch(foo)14  #error "invalid arch"15#endif16 17#if !__is_target_vendor(apple) || !__is_target_vendor(APPLE)18  #error "mismatching vendor"19#endif20 21#if __is_target_vendor(unknown)22  #error "mismatching vendor"23#endif24 25#if __is_target_vendor(foo)26  #error "invalid vendor"27#endif28 29#if !__is_target_os(darwin) || !__is_target_os(DARWIN)30  #error "mismatching os"31#endif32 33#if __is_target_os(ios)34  #error "mismatching os"35#endif36 37#if __is_target_os(foo)38  #error "invalid os"39#endif40 41#if !__is_target_environment(simulator) || !__is_target_environment(SIMULATOR)42  #error "mismatching environment"43#endif44 45#if __is_target_environment(unknown)46  #error "mismatching environment"47#endif48 49#if __is_target_environment(foo)50  #error "invalid environment"51#endif52 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"55#endif56 57#if __is_target_arch(11) // expected-error {{builtin feature check macro requires a parenthesized identifier}}58  #error "invalid arch"59#endif60 61#if __is_target_arch x86 // expected-error{{missing '(' after '__is_target_arch'}}62  #error "invalid arch"63#endif64 65#if __is_target_arch ( x86  // expected-error {{unterminated function-like macro invocation}}66  #error "invalid arch"67#endif // expected-error@-2 {{expected value in expression}}68