has_feature_c1x.c revision 634189d729595b340205dd8a5216ba3122c7a2ab
1// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -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_atomic)
5int has_atomic();
6#else
7int no_atomic();
8#endif
9
10// CHECK-1X: has_atomic
11// CHECK-NO-1X: no_atomic
12
13#if __has_feature(c_static_assert)
14int has_static_assert();
15#else
16int no_static_assert();
17#endif
18
19// CHECK-1X: has_static_assert
20// CHECK-NO-1X: no_static_assert
21
22#if __has_feature(c_generic_selections)
23int has_generic_selections();
24#else
25int no_generic_selections();
26#endif
27
28// CHECK-1X: has_generic_selections
29// CHECK-NO-1X: no_generic_selections
30
31#if __has_feature(c_alignas)
32int has_alignas();
33#else
34int no_alignas();
35#endif
36
37// CHECK-1X: has_alignas
38// CHECK-NO-1X: no_alignas
39
40#if __has_feature(c_thread_local)
41int has_thread_local();
42#else
43int no_thread_local();
44#endif
45
46// CHECK-1X: has_thread_local
47// CHECK-NO-1X: no_thread_local
48
49#if __STDC_VERSION__ > 199901L
50int is_c1x();
51#else
52int is_not_c1x();
53#endif
54
55// CHECK-1X: is_c1x
56// CHECK-NO-1X: is_not_c1x
57