blob: ff1778010b7554fda8cabeaa432b88780e71830c [file] [log] [blame]
Stephen Hines176edba2014-12-01 14:53:08 -08001// 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 Collingbournec1b5fa42011-05-13 20:54:45 +00009
David Chisnall7a7ee302012-01-16 17:27:18 +000010#if __has_feature(c_atomic)
11int has_atomic();
12#else
13int no_atomic();
14#endif
David Chisnall7a7ee302012-01-16 17:27:18 +000015// CHECK-1X: has_atomic
16// CHECK-NO-1X: no_atomic
17
Peter Collingbournec1b5fa42011-05-13 20:54:45 +000018#if __has_feature(c_static_assert)
19int has_static_assert();
20#else
21int no_static_assert();
22#endif
Peter Collingbournec1b5fa42011-05-13 20:54:45 +000023// CHECK-1X: has_static_assert
24// CHECK-NO-1X: no_static_assert
25
26#if __has_feature(c_generic_selections)
27int has_generic_selections();
28#else
29int no_generic_selections();
30#endif
Peter Collingbournec1b5fa42011-05-13 20:54:45 +000031// CHECK-1X: has_generic_selections
32// CHECK-NO-1X: no_generic_selections
Peter Collingbournefd5f6862011-10-14 23:44:46 +000033
34#if __has_feature(c_alignas)
35int has_alignas();
36#else
37int no_alignas();
38#endif
Peter Collingbournefd5f6862011-10-14 23:44:46 +000039// CHECK-1X: has_alignas
40// CHECK-NO-1X: no_alignas
Douglas Gregor5aa6dea2011-10-28 23:02:54 +000041
Stephen Hines0e2c34f2015-03-23 12:09:02 -070042#if __has_feature(c_alignof)
43int has_alignof();
44#else
45int no_alignof();
46#endif
47// CHECK-1X: has_alignof
48// CHECK-NO-1X: no_alignof
49
Richard Smithe6e68b52013-04-19 17:00:31 +000050#if __has_feature(c_thread_local)
51int has_thread_local();
52#else
53int no_thread_local();
54#endif
55
56// CHECK-1X: has_thread_local
57// CHECK-NO-1X: no_thread_local
58
Douglas Gregor5aa6dea2011-10-28 23:02:54 +000059#if __STDC_VERSION__ > 199901L
60int is_c1x();
61#else
62int is_not_c1x();
63#endif
64
65// CHECK-1X: is_c1x
66// CHECK-NO-1X: is_not_c1x