67 lines · c
1// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c89 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s2// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=iso9899:199409 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s3// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c99 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s4// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c11 %s -o - | FileCheck --check-prefix=CHECK-1X %s5//6// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu89 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s7// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu99 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s8// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu11 %s -o - | FileCheck --check-prefix=CHECK-1X %s9 10#if __has_feature(c_atomic)11int has_atomic();12#else13int no_atomic();14#endif15// CHECK-1X: has_atomic16// CHECK-NO-1X: no_atomic17 18#if __has_feature(c_static_assert)19int has_static_assert();20#else21int no_static_assert();22#endif23// CHECK-1X: has_static_assert24// CHECK-NO-1X: no_static_assert25 26#if __has_feature(c_generic_selections)27int has_generic_selections();28#else29int no_generic_selections();30#endif31// CHECK-1X: has_generic_selections32// CHECK-NO-1X: no_generic_selections33 34#if __has_feature(c_alignas)35int has_alignas();36#else37int no_alignas();38#endif39// CHECK-1X: has_alignas40// CHECK-NO-1X: no_alignas41 42#if __has_feature(c_alignof)43int has_alignof();44#else45int no_alignof();46#endif47// CHECK-1X: has_alignof48// CHECK-NO-1X: no_alignof49 50#if __has_feature(c_thread_local)51int has_thread_local();52#else53int no_thread_local();54#endif55 56// CHECK-1X: has_thread_local57// CHECK-NO-1X: no_thread_local58 59#if __STDC_VERSION__ > 199901L60int is_c1x();61#else62int is_not_c1x();63#endif64 65// CHECK-1X: is_c1x66// CHECK-NO-1X: is_not_c1x67