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