blob: 40d651dff533144f7e35325f364224d4e1945742 [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -E -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-0X %s
Daniel Dunbar9fde9c42010-06-29 16:52:24 +00002// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-0X %s
Sean Hunt4ef4c6b2010-01-13 08:31:49 +00003
David Chisnall7a7ee302012-01-16 17:27:18 +00004#if __has_feature(cxx_atomic)
5int has_atomic();
6#else
7int no_atomic();
8#endif
9
10// CHECK-0X: has_atomic
11// CHECK-NO-0X: no_atomic
12
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000013#if __has_feature(cxx_lambdas)
Douglas Gregorc78e2592011-01-26 15:36:03 +000014int has_lambdas();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000015#else
16int no_lambdas();
17#endif
18
Douglas Gregor7c07e962012-02-23 03:02:32 +000019// CHECK-0X: has_lambdas
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000020// CHECK-NO-0X: no_lambdas
21
22
23#if __has_feature(cxx_nullptr)
Sean Hunt12484512010-01-13 08:58:42 +000024int has_nullptr();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000025#else
26int no_nullptr();
27#endif
28
Douglas Gregor84ee2ee2011-05-21 23:15:46 +000029// CHECK-0X: has_nullptr
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000030// CHECK-NO-0X: no_nullptr
31
32
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000033#if __has_feature(cxx_decltype)
Sean Hunt12484512010-01-13 08:58:42 +000034int has_decltype();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000035#else
36int no_decltype();
37#endif
38
Sean Hunt12484512010-01-13 08:58:42 +000039// CHECK-0X: has_decltype
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000040// CHECK-NO-0X: no_decltype
41
42
43#if __has_feature(cxx_auto_type)
Douglas Gregorc78e2592011-01-26 15:36:03 +000044int has_auto_type();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000045#else
46int no_auto_type();
47#endif
48
Richard Smith738291e2011-02-20 12:13:05 +000049// CHECK-0X: has_auto_type
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000050// CHECK-NO-0X: no_auto_type
51
52
Richard Smith6a4e73c2011-04-03 14:12:46 +000053#if __has_feature(cxx_trailing_return)
54int has_trailing_return();
55#else
56int no_trailing_return();
57#endif
58
59// CHECK-0X: has_trailing_return
60// CHECK-NO-0X: no_trailing_return
61
62
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000063#if __has_feature(cxx_attributes)
Douglas Gregorc78e2592011-01-26 15:36:03 +000064int has_attributes();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000065#else
66int no_attributes();
67#endif
68
Douglas Gregorc78e2592011-01-26 15:36:03 +000069// CHECK-0X: has_attributes
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000070// CHECK-NO-0X: no_attributes
71
72
73#if __has_feature(cxx_static_assert)
Sean Hunt12484512010-01-13 08:58:42 +000074int has_static_assert();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000075#else
76int no_static_assert();
77#endif
78
Sean Hunt12484512010-01-13 08:58:42 +000079// CHECK-0X: has_static_assert
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000080// CHECK-NO-0X: no_static_assert
81
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000082#if __has_feature(cxx_deleted_functions)
Douglas Gregorc78e2592011-01-26 15:36:03 +000083int has_deleted_functions();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000084#else
85int no_deleted_functions();
86#endif
87
Douglas Gregorc78e2592011-01-26 15:36:03 +000088// CHECK-0X: has_deleted_functions
89// CHECK-NO-0X: no_deleted_functions
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000090
Douglas Gregorf695a692011-11-01 01:19:34 +000091#if __has_feature(cxx_defaulted_functions)
92int has_defaulted_functions();
93#else
94int no_defaulted_functions();
95#endif
96
97// CHECK-0X: has_defaulted_functions
98// CHECK-NO-0X: no_defaulted_functions
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000099
100#if __has_feature(cxx_rvalue_references)
Douglas Gregorc78e2592011-01-26 15:36:03 +0000101int has_rvalue_references();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +0000102#else
103int no_rvalue_references();
104#endif
105
Douglas Gregorc78e2592011-01-26 15:36:03 +0000106// CHECK-0X: has_rvalue_references
107// CHECK-NO-0X: no_rvalue_references
Sean Hunt4ef4c6b2010-01-13 08:31:49 +0000108
109
110#if __has_feature(cxx_variadic_templates)
Douglas Gregorc78e2592011-01-26 15:36:03 +0000111int has_variadic_templates();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +0000112#else
113int no_variadic_templates();
114#endif
115
Douglas Gregorc78e2592011-01-26 15:36:03 +0000116// CHECK-0X: has_variadic_templates
117// CHECK-NO-0X: no_variadic_templates
Sebastian Redlf6c09772010-08-31 23:28:47 +0000118
119
120#if __has_feature(cxx_inline_namespaces)
Douglas Gregorc78e2592011-01-26 15:36:03 +0000121int has_inline_namespaces();
Sebastian Redlf6c09772010-08-31 23:28:47 +0000122#else
123int no_inline_namespaces();
124#endif
125
Douglas Gregorc78e2592011-01-26 15:36:03 +0000126// CHECK-0X: has_inline_namespaces
127// CHECK-NO-0X: no_inline_namespaces
Douglas Gregor56209ff2011-01-26 21:25:54 +0000128
Richard Smitha391a462011-04-15 15:14:40 +0000129
130#if __has_feature(cxx_range_for)
131int has_range_for();
132#else
133int no_range_for();
134#endif
135
136// CHECK-0X: has_range_for
137// CHECK-NO-0X: no_range_for
138
139
Douglas Gregor56209ff2011-01-26 21:25:54 +0000140#if __has_feature(cxx_reference_qualified_functions)
141int has_reference_qualified_functions();
142#else
143int no_reference_qualified_functions();
144#endif
145
146// CHECK-0X: has_reference_qualified_functions
147// CHECK-NO-0X: no_reference_qualified_functions
148
Douglas Gregor07508002011-02-05 20:35:30 +0000149#if __has_feature(cxx_default_function_template_args)
150int has_default_function_template_args();
151#else
152int no_default_function_template_args();
153#endif
154
155// CHECK-0X: has_default_function_template_args
156// CHECK-NO-0X: no_default_function_template_args
157
Sebastian Redl4561ecd2011-03-15 21:17:12 +0000158#if __has_feature(cxx_noexcept)
159int has_noexcept();
160#else
161int no_noexcept();
162#endif
163
164// CHECK-0X: has_noexcept
165// CHECK-NO-0X: no_noexcept
166
Anders Carlssonc8b9f792011-03-25 15:04:23 +0000167#if __has_feature(cxx_override_control)
168int has_override_control();
169#else
170int no_override_control();
171#endif
172
173// CHECK-0X: has_override_control
174// CHECK-NO-0X: no_override_control
Richard Smith3e4c6c42011-05-05 21:57:07 +0000175
176#if __has_feature(cxx_alias_templates)
177int has_alias_templates();
178#else
179int no_alias_templates();
180#endif
181
182// CHECK-0X: has_alias_templates
183// CHECK-NO-0X: no_alias_templates
Sebastian Redl74e611a2011-09-04 18:14:28 +0000184
185#if __has_feature(cxx_implicit_moves)
186int has_implicit_moves();
187#else
188int no_implicit_moves();
189#endif
190
191// CHECK-0X: has_implicit_moves
192// CHECK-NO-0X: no_implicit_moves
Peter Collingbournefd5f6862011-10-14 23:44:46 +0000193
194#if __has_feature(cxx_alignas)
195int has_alignas();
196#else
197int no_alignas();
198#endif
199
200// CHECK-0X: has_alignas
201// CHECK-NO-0X: no_alignas
Douglas Gregor172b2212011-11-01 01:23:44 +0000202
203#if __has_feature(cxx_raw_string_literals)
204int has_raw_string_literals();
205#else
206int no_raw_string_literals();
207#endif
208
209// CHECK-0X: has_raw_string_literals
210// CHECK-NO-0X: no_raw_string_literals
211
212#if __has_feature(cxx_unicode_literals)
213int has_unicode_literals();
214#else
215int no_unicode_literals();
216#endif
217
218// CHECK-0X: has_unicode_literals
219// CHECK-NO-0X: no_unicode_literals
Richard Smithb5216aa2012-02-14 22:56:17 +0000220
221#if __has_feature(cxx_constexpr)
222int has_constexpr();
223#else
224int no_constexpr();
225#endif
226
227// CHECK-0X: has_constexpr
228// CHECK-NO-0X: no_constexpr
Sebastian Redld1dc3aa2012-02-25 20:51:27 +0000229
230#if __has_feature(cxx_generalized_initializers)
231int has_generalized_initializers();
232#else
233int no_generalized_initializers();
234#endif
235
236// CHECK-0X: has_generalized_initializers
237// CHECK-NO-0X: no_generalized_initializers
Richard Smithec92bc72012-03-03 23:51:05 +0000238
239#if __has_feature(cxx_unrestricted_unions)
240int has_unrestricted_unions();
241#else
242int no_unrestricted_unions();
243#endif
244
245// CHECK-0X: has_unrestricted_unions
246// CHECK-NO-0X: no_unrestricted_unions