has_feature_c1x.c revision 5aa6dea4efe19f4c2e6600364123fb8899ec4af7
1// RUN: %clang_cc1 -E -std=c1x %s -o - | FileCheck --check-prefix=CHECK-1X %s 2// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s 3 4#if __has_feature(c_static_assert) 5int has_static_assert(); 6#else 7int no_static_assert(); 8#endif 9 10// CHECK-1X: has_static_assert 11// CHECK-NO-1X: no_static_assert 12 13#if __has_feature(c_generic_selections) 14int has_generic_selections(); 15#else 16int no_generic_selections(); 17#endif 18 19// CHECK-1X: has_generic_selections 20// CHECK-NO-1X: no_generic_selections 21 22#if __has_feature(c_alignas) 23int has_alignas(); 24#else 25int no_alignas(); 26#endif 27 28// CHECK-1X: has_alignas 29// CHECK-NO-1X: no_alignas 30 31#if __STDC_VERSION__ > 199901L 32int is_c1x(); 33#else 34int is_not_c1x(); 35#endif 36 37// CHECK-1X: is_c1x 38// CHECK-NO-1X: is_not_c1x 39