Richard Smith | ab506ad | 2014-10-20 23:26:58 +0000 | [diff] [blame^] | 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 |
Peter Collingbourne | d5d410f | 2011-05-13 20:54:45 +0000 | [diff] [blame] | 9 | |
David Chisnall | fa35df6 | 2012-01-16 17:27:18 +0000 | [diff] [blame] | 10 | #if __has_feature(c_atomic) |
| 11 | int has_atomic(); |
| 12 | #else |
| 13 | int no_atomic(); |
| 14 | #endif |
| 15 | |
| 16 | // CHECK-1X: has_atomic |
| 17 | // CHECK-NO-1X: no_atomic |
| 18 | |
Peter Collingbourne | d5d410f | 2011-05-13 20:54:45 +0000 | [diff] [blame] | 19 | #if __has_feature(c_static_assert) |
| 20 | int has_static_assert(); |
| 21 | #else |
| 22 | int no_static_assert(); |
| 23 | #endif |
| 24 | |
| 25 | // CHECK-1X: has_static_assert |
| 26 | // CHECK-NO-1X: no_static_assert |
| 27 | |
| 28 | #if __has_feature(c_generic_selections) |
| 29 | int has_generic_selections(); |
| 30 | #else |
| 31 | int no_generic_selections(); |
| 32 | #endif |
| 33 | |
| 34 | // CHECK-1X: has_generic_selections |
| 35 | // CHECK-NO-1X: no_generic_selections |
Peter Collingbourne | 60188eb | 2011-10-14 23:44:46 +0000 | [diff] [blame] | 36 | |
| 37 | #if __has_feature(c_alignas) |
| 38 | int has_alignas(); |
| 39 | #else |
| 40 | int no_alignas(); |
| 41 | #endif |
| 42 | |
| 43 | // CHECK-1X: has_alignas |
| 44 | // CHECK-NO-1X: no_alignas |
Douglas Gregor | 2c4542d | 2011-10-28 23:02:54 +0000 | [diff] [blame] | 45 | |
Richard Smith | 25b555a | 2013-04-19 17:00:31 +0000 | [diff] [blame] | 46 | #if __has_feature(c_thread_local) |
| 47 | int has_thread_local(); |
| 48 | #else |
| 49 | int no_thread_local(); |
| 50 | #endif |
| 51 | |
| 52 | // CHECK-1X: has_thread_local |
| 53 | // CHECK-NO-1X: no_thread_local |
| 54 | |
Douglas Gregor | 2c4542d | 2011-10-28 23:02:54 +0000 | [diff] [blame] | 55 | #if __STDC_VERSION__ > 199901L |
| 56 | int is_c1x(); |
| 57 | #else |
| 58 | int is_not_c1x(); |
| 59 | #endif |
| 60 | |
| 61 | // CHECK-1X: is_c1x |
| 62 | // CHECK-NO-1X: is_not_c1x |