Peter Collingbourne | c1b5fa4 | 2011-05-13 20:54:45 +0000 | [diff] [blame] | 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 | |
David Chisnall | 7a7ee30 | 2012-01-16 17:27:18 +0000 | [diff] [blame] | 4 | #if __has_feature(c_atomic) |
| 5 | int has_atomic(); |
| 6 | #else |
| 7 | int no_atomic(); |
| 8 | #endif |
| 9 | |
| 10 | // CHECK-1X: has_atomic |
| 11 | // CHECK-NO-1X: no_atomic |
| 12 | |
Peter Collingbourne | c1b5fa4 | 2011-05-13 20:54:45 +0000 | [diff] [blame] | 13 | #if __has_feature(c_static_assert) |
| 14 | int has_static_assert(); |
| 15 | #else |
| 16 | int 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) |
| 23 | int has_generic_selections(); |
| 24 | #else |
| 25 | int no_generic_selections(); |
| 26 | #endif |
| 27 | |
| 28 | // CHECK-1X: has_generic_selections |
| 29 | // CHECK-NO-1X: no_generic_selections |
Peter Collingbourne | fd5f686 | 2011-10-14 23:44:46 +0000 | [diff] [blame] | 30 | |
| 31 | #if __has_feature(c_alignas) |
| 32 | int has_alignas(); |
| 33 | #else |
| 34 | int no_alignas(); |
| 35 | #endif |
| 36 | |
| 37 | // CHECK-1X: has_alignas |
| 38 | // CHECK-NO-1X: no_alignas |
Douglas Gregor | 5aa6dea | 2011-10-28 23:02:54 +0000 | [diff] [blame] | 39 | |
Richard Smith | e6e68b5 | 2013-04-19 17:00:31 +0000 | [diff] [blame^] | 40 | #if __has_feature(c_thread_local) |
| 41 | int has_thread_local(); |
| 42 | #else |
| 43 | int no_thread_local(); |
| 44 | #endif |
| 45 | |
| 46 | // CHECK-1X: has_thread_local |
| 47 | // CHECK-NO-1X: no_thread_local |
| 48 | |
Douglas Gregor | 5aa6dea | 2011-10-28 23:02:54 +0000 | [diff] [blame] | 49 | #if __STDC_VERSION__ > 199901L |
| 50 | int is_c1x(); |
| 51 | #else |
| 52 | int is_not_c1x(); |
| 53 | #endif |
| 54 | |
| 55 | // CHECK-1X: is_c1x |
| 56 | // CHECK-NO-1X: is_not_c1x |