blob: cba329cfb5501aaa2f73e9620afc325b33c1f200 [file] [log] [blame]
Richard Smithab506ad2014-10-20 23:26:58 +00001// 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 Collingbourned5d410f2011-05-13 20:54:45 +00009
David Chisnallfa35df62012-01-16 17:27:18 +000010#if __has_feature(c_atomic)
11int has_atomic();
12#else
13int no_atomic();
14#endif
15
16// CHECK-1X: has_atomic
17// CHECK-NO-1X: no_atomic
18
Peter Collingbourned5d410f2011-05-13 20:54:45 +000019#if __has_feature(c_static_assert)
20int has_static_assert();
21#else
22int 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)
29int has_generic_selections();
30#else
31int no_generic_selections();
32#endif
33
34// CHECK-1X: has_generic_selections
35// CHECK-NO-1X: no_generic_selections
Peter Collingbourne60188eb2011-10-14 23:44:46 +000036
37#if __has_feature(c_alignas)
38int has_alignas();
39#else
40int no_alignas();
41#endif
42
43// CHECK-1X: has_alignas
44// CHECK-NO-1X: no_alignas
Douglas Gregor2c4542d2011-10-28 23:02:54 +000045
Richard Smith25b555a2013-04-19 17:00:31 +000046#if __has_feature(c_thread_local)
47int has_thread_local();
48#else
49int no_thread_local();
50#endif
51
52// CHECK-1X: has_thread_local
53// CHECK-NO-1X: no_thread_local
54
Douglas Gregor2c4542d2011-10-28 23:02:54 +000055#if __STDC_VERSION__ > 199901L
56int is_c1x();
57#else
58int is_not_c1x();
59#endif
60
61// CHECK-1X: is_c1x
62// CHECK-NO-1X: is_not_c1x