Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [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 | c1b5fa4 | 2011-05-13 20:54:45 +0000 | [diff] [blame] | 9 | |
David Chisnall | 7a7ee30 | 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 |
David Chisnall | 7a7ee30 | 2012-01-16 17:27:18 +0000 | [diff] [blame] | 15 | // CHECK-1X: has_atomic |
| 16 | // CHECK-NO-1X: no_atomic |
| 17 | |
Peter Collingbourne | c1b5fa4 | 2011-05-13 20:54:45 +0000 | [diff] [blame] | 18 | #if __has_feature(c_static_assert) |
| 19 | int has_static_assert(); |
| 20 | #else |
| 21 | int no_static_assert(); |
| 22 | #endif |
Peter Collingbourne | c1b5fa4 | 2011-05-13 20:54:45 +0000 | [diff] [blame] | 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 |
Peter Collingbourne | c1b5fa4 | 2011-05-13 20:54:45 +0000 | [diff] [blame] | 31 | // CHECK-1X: has_generic_selections |
| 32 | // CHECK-NO-1X: no_generic_selections |
Peter Collingbourne | fd5f686 | 2011-10-14 23:44:46 +0000 | [diff] [blame] | 33 | |
| 34 | #if __has_feature(c_alignas) |
| 35 | int has_alignas(); |
| 36 | #else |
| 37 | int no_alignas(); |
| 38 | #endif |
Peter Collingbourne | fd5f686 | 2011-10-14 23:44:46 +0000 | [diff] [blame] | 39 | // CHECK-1X: has_alignas |
| 40 | // CHECK-NO-1X: no_alignas |
Douglas Gregor | 5aa6dea | 2011-10-28 23:02:54 +0000 | [diff] [blame] | 41 | |
Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame^] | 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 | |
Richard Smith | e6e68b5 | 2013-04-19 17:00:31 +0000 | [diff] [blame] | 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 | |
Douglas Gregor | 5aa6dea | 2011-10-28 23:02:54 +0000 | [diff] [blame] | 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 |