xref: /minix3/external/bsd/llvm/dist/clang/test/Lexer/has_feature_c1x.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c89 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=iso9899:199409 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c99 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
4*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c11 %s -o - | FileCheck --check-prefix=CHECK-1X %s
5*0a6a1f1dSLionel Sambuc //
6*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu89 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
7*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu99 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
8*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu11 %s -o - | FileCheck --check-prefix=CHECK-1X %s
9f4a2713aSLionel Sambuc 
10f4a2713aSLionel Sambuc #if __has_feature(c_atomic)
11f4a2713aSLionel Sambuc int has_atomic();
12f4a2713aSLionel Sambuc #else
13f4a2713aSLionel Sambuc int no_atomic();
14f4a2713aSLionel Sambuc #endif
15f4a2713aSLionel Sambuc // CHECK-1X: has_atomic
16f4a2713aSLionel Sambuc // CHECK-NO-1X: no_atomic
17f4a2713aSLionel Sambuc 
18f4a2713aSLionel Sambuc #if __has_feature(c_static_assert)
19f4a2713aSLionel Sambuc int has_static_assert();
20f4a2713aSLionel Sambuc #else
21f4a2713aSLionel Sambuc int no_static_assert();
22f4a2713aSLionel Sambuc #endif
23f4a2713aSLionel Sambuc // CHECK-1X: has_static_assert
24f4a2713aSLionel Sambuc // CHECK-NO-1X: no_static_assert
25f4a2713aSLionel Sambuc 
26f4a2713aSLionel Sambuc #if __has_feature(c_generic_selections)
27f4a2713aSLionel Sambuc int has_generic_selections();
28f4a2713aSLionel Sambuc #else
29f4a2713aSLionel Sambuc int no_generic_selections();
30f4a2713aSLionel Sambuc #endif
31f4a2713aSLionel Sambuc // CHECK-1X: has_generic_selections
32f4a2713aSLionel Sambuc // CHECK-NO-1X: no_generic_selections
33f4a2713aSLionel Sambuc 
34f4a2713aSLionel Sambuc #if __has_feature(c_alignas)
35f4a2713aSLionel Sambuc int has_alignas();
36f4a2713aSLionel Sambuc #else
37f4a2713aSLionel Sambuc int no_alignas();
38f4a2713aSLionel Sambuc #endif
39f4a2713aSLionel Sambuc // CHECK-1X: has_alignas
40f4a2713aSLionel Sambuc // CHECK-NO-1X: no_alignas
41f4a2713aSLionel Sambuc 
42*0a6a1f1dSLionel Sambuc #if __has_feature(c_alignof)
43*0a6a1f1dSLionel Sambuc int has_alignof();
44*0a6a1f1dSLionel Sambuc #else
45*0a6a1f1dSLionel Sambuc int no_alignof();
46*0a6a1f1dSLionel Sambuc #endif
47*0a6a1f1dSLionel Sambuc // CHECK-1X: has_alignof
48*0a6a1f1dSLionel Sambuc // CHECK-NO-1X: no_alignof
49*0a6a1f1dSLionel Sambuc 
50f4a2713aSLionel Sambuc #if __has_feature(c_thread_local)
51f4a2713aSLionel Sambuc int has_thread_local();
52f4a2713aSLionel Sambuc #else
53f4a2713aSLionel Sambuc int no_thread_local();
54f4a2713aSLionel Sambuc #endif
55f4a2713aSLionel Sambuc 
56f4a2713aSLionel Sambuc // CHECK-1X: has_thread_local
57f4a2713aSLionel Sambuc // CHECK-NO-1X: no_thread_local
58f4a2713aSLionel Sambuc 
59f4a2713aSLionel Sambuc #if __STDC_VERSION__ > 199901L
60f4a2713aSLionel Sambuc int is_c1x();
61f4a2713aSLionel Sambuc #else
62f4a2713aSLionel Sambuc int is_not_c1x();
63f4a2713aSLionel Sambuc #endif
64f4a2713aSLionel Sambuc 
65f4a2713aSLionel Sambuc // CHECK-1X: is_c1x
66f4a2713aSLionel Sambuc // CHECK-NO-1X: is_not_c1x
67