1 // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-11 %s
2 // RUN: %clang_cc1 -E -triple armv7-apple-darwin -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-NO-TLS %s
3 // RUN: %clang_cc1 -E -triple x86_64-linux-gnu %s -o - | FileCheck --check-prefix=CHECK-NO-11 %s
4 // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++1y %s -o - | FileCheck --check-prefix=CHECK-1Y %s
6 #if __has_feature(cxx_atomic)
12 // CHECK-1Y: has_atomic
13 // CHECK-11: has_atomic
14 // CHECK-NO-11: no_atomic
16 #if __has_feature(cxx_lambdas)
22 // CHECK-1Y: has_lambdas
23 // CHECK-11: has_lambdas
24 // CHECK-NO-11: no_lambdas
27 #if __has_feature(cxx_nullptr)
33 // CHECK-1Y: has_nullptr
34 // CHECK-11: has_nullptr
35 // CHECK-NO-11: no_nullptr
38 #if __has_feature(cxx_decltype)
44 // CHECK-1Y: has_decltype
45 // CHECK-11: has_decltype
46 // CHECK-NO-11: no_decltype
49 #if __has_feature(cxx_decltype_incomplete_return_types)
50 int has_decltype_incomplete_return_types();
52 int no_decltype_incomplete_return_types();
55 // CHECK-1Y: has_decltype_incomplete_return_types
56 // CHECK-11: has_decltype_incomplete_return_types
57 // CHECK-NO-11: no_decltype_incomplete_return_types
60 #if __has_feature(cxx_auto_type)
66 // CHECK-1Y: has_auto_type
67 // CHECK-11: has_auto_type
68 // CHECK-NO-11: no_auto_type
71 #if __has_feature(cxx_trailing_return)
72 int has_trailing_return();
74 int no_trailing_return();
77 // CHECK-1Y: has_trailing_return
78 // CHECK-11: has_trailing_return
79 // CHECK-NO-11: no_trailing_return
82 #if __has_feature(cxx_attributes)
88 // CHECK-1Y: has_attributes
89 // CHECK-11: has_attributes
90 // CHECK-NO-11: no_attributes
93 #if __has_feature(cxx_static_assert)
94 int has_static_assert();
96 int no_static_assert();
99 // CHECK-1Y: has_static_assert
100 // CHECK-11: has_static_assert
101 // CHECK-NO-11: no_static_assert
103 #if __has_feature(cxx_deleted_functions)
104 int has_deleted_functions();
106 int no_deleted_functions();
109 // CHECK-1Y: has_deleted_functions
110 // CHECK-11: has_deleted_functions
111 // CHECK-NO-11: no_deleted_functions
113 #if __has_feature(cxx_defaulted_functions)
114 int has_defaulted_functions();
116 int no_defaulted_functions();
119 // CHECK-1Y: has_defaulted_functions
120 // CHECK-11: has_defaulted_functions
121 // CHECK-NO-11: no_defaulted_functions
123 #if __has_feature(cxx_rvalue_references)
124 int has_rvalue_references();
126 int no_rvalue_references();
129 // CHECK-1Y: has_rvalue_references
130 // CHECK-11: has_rvalue_references
131 // CHECK-NO-11: no_rvalue_references
134 #if __has_feature(cxx_variadic_templates)
135 int has_variadic_templates();
137 int no_variadic_templates();
140 // CHECK-1Y: has_variadic_templates
141 // CHECK-11: has_variadic_templates
142 // CHECK-NO-11: no_variadic_templates
145 #if __has_feature(cxx_inline_namespaces)
146 int has_inline_namespaces();
148 int no_inline_namespaces();
151 // CHECK-1Y: has_inline_namespaces
152 // CHECK-11: has_inline_namespaces
153 // CHECK-NO-11: no_inline_namespaces
156 #if __has_feature(cxx_range_for)
162 // CHECK-1Y: has_range_for
163 // CHECK-11: has_range_for
164 // CHECK-NO-11: no_range_for
167 #if __has_feature(cxx_reference_qualified_functions)
168 int has_reference_qualified_functions();
170 int no_reference_qualified_functions();
173 // CHECK-1Y: has_reference_qualified_functions
174 // CHECK-11: has_reference_qualified_functions
175 // CHECK-NO-11: no_reference_qualified_functions
177 #if __has_feature(cxx_default_function_template_args)
178 int has_default_function_template_args();
180 int no_default_function_template_args();
183 // CHECK-1Y: has_default_function_template_args
184 // CHECK-11: has_default_function_template_args
185 // CHECK-NO-11: no_default_function_template_args
187 #if __has_feature(cxx_noexcept)
193 // CHECK-1Y: has_noexcept
194 // CHECK-11: has_noexcept
195 // CHECK-NO-11: no_noexcept
197 #if __has_feature(cxx_override_control)
198 int has_override_control();
200 int no_override_control();
203 // CHECK-1Y: has_override_control
204 // CHECK-11: has_override_control
205 // CHECK-NO-11: no_override_control
207 #if __has_feature(cxx_alias_templates)
208 int has_alias_templates();
210 int no_alias_templates();
213 // CHECK-1Y: has_alias_templates
214 // CHECK-11: has_alias_templates
215 // CHECK-NO-11: no_alias_templates
217 #if __has_feature(cxx_implicit_moves)
218 int has_implicit_moves();
220 int no_implicit_moves();
223 // CHECK-1Y: has_implicit_moves
224 // CHECK-11: has_implicit_moves
225 // CHECK-NO-11: no_implicit_moves
227 #if __has_feature(cxx_alignas)
233 // CHECK-1Y: has_alignas
234 // CHECK-11: has_alignas
235 // CHECK-NO-11: no_alignas
237 #if __has_feature(cxx_alignof)
243 // CHECK-1Y: has_alignof
244 // CHECK-11: has_alignof
245 // CHECK-NO-11: no_alignof
247 #if __has_feature(cxx_raw_string_literals)
248 int has_raw_string_literals();
250 int no_raw_string_literals();
253 // CHECK-1Y: has_raw_string_literals
254 // CHECK-11: has_raw_string_literals
255 // CHECK-NO-11: no_raw_string_literals
257 #if __has_feature(cxx_unicode_literals)
258 int has_unicode_literals();
260 int no_unicode_literals();
263 // CHECK-1Y: has_unicode_literals
264 // CHECK-11: has_unicode_literals
265 // CHECK-NO-11: no_unicode_literals
267 #if __has_feature(cxx_constexpr)
273 // CHECK-1Y: has_constexpr
274 // CHECK-11: has_constexpr
275 // CHECK-NO-11: no_constexpr
277 #if __has_feature(cxx_generalized_initializers)
278 int has_generalized_initializers();
280 int no_generalized_initializers();
283 // CHECK-1Y: has_generalized_initializers
284 // CHECK-11: has_generalized_initializers
285 // CHECK-NO-11: no_generalized_initializers
287 #if __has_feature(cxx_unrestricted_unions)
288 int has_unrestricted_unions();
290 int no_unrestricted_unions();
293 // CHECK-1Y: has_unrestricted_unions
294 // CHECK-11: has_unrestricted_unions
295 // CHECK-NO-11: no_unrestricted_unions
297 #if __has_feature(cxx_user_literals)
298 int has_user_literals();
300 int no_user_literals();
303 // CHECK-1Y: has_user_literals
304 // CHECK-11: has_user_literals
305 // CHECK-NO-11: no_user_literals
307 #if __has_feature(cxx_local_type_template_args)
308 int has_local_type_template_args();
310 int no_local_type_template_args();
313 // CHECK-1Y: has_local_type_template_args
314 // CHECK-11: has_local_type_template_args
315 // CHECK-NO-11: no_local_type_template_args
317 #if __has_feature(cxx_inheriting_constructors)
318 int has_inheriting_constructors();
320 int no_inheriting_constructors();
323 // CHECK-1Y: has_inheriting_constructors
324 // CHECK-11: has_inheriting_constructors
325 // CHECK-NO-11: no_inheriting_constructors
327 #if __has_feature(cxx_thread_local)
328 int has_thread_local();
330 int no_thread_local();
333 // CHECK-1Y: has_thread_local
334 // CHECK-11: has_thread_local
335 // CHECK-NO-11: no_thread_local
336 // CHECK-NO-TLS: no_thread_local
338 // === C++1y features ===
340 #if __has_feature(cxx_binary_literals)
341 int has_binary_literals();
343 int no_binary_literals();
346 // CHECK-1Y: has_binary_literals
347 // CHECK-11: no_binary_literals
348 // CHECK-NO-11: no_binary_literals
350 #if __has_feature(cxx_aggregate_nsdmi)
351 int has_aggregate_nsdmi();
353 int no_aggregate_nsdmi();
356 // CHECK-1Y: has_aggregate_nsdmi
357 // CHECK-11: no_aggregate_nsdmi
358 // CHECK-NO-11: no_aggregate_nsdmi
360 #if __has_feature(cxx_return_type_deduction)
361 int has_return_type_deduction();
363 int no_return_type_deduction();
366 // CHECK-1Y: has_return_type_deduction
367 // CHECK-11: no_return_type_deduction
368 // CHECK-NO-11: no_return_type_deduction
370 #if __has_feature(cxx_contextual_conversions)
371 int has_contextual_conversions();
373 int no_contextual_conversions();
376 // CHECK-1Y: has_contextual_conversions
377 // CHECK-11: no_contextual_conversions
378 // CHECK-NO-11: no_contextual_conversions
380 #if __has_feature(cxx_relaxed_constexpr)
381 int has_relaxed_constexpr();
383 int no_relaxed_constexpr();
386 // CHECK-1Y: has_relaxed_constexpr
387 // CHECK-11: no_relaxed_constexpr
388 // CHECK-NO-11: no_relaxed_constexpr
390 #if __has_feature(cxx_variable_templates)
391 int has_variable_templates();
393 int no_variable_templates();
396 // CHECK-1Y: has_variable_templates
397 // CHECK-11: no_variable_templates
398 // CHECK-NO-11: no_variable_templates
400 #if __has_feature(cxx_init_captures)
401 int has_init_captures();
403 int no_init_captures();
406 // CHECK-1Y: has_init_captures
407 // CHECK-11: no_init_captures
408 // CHECK-NO-11: no_init_captures
410 #if __has_feature(cxx_decltype_auto)
411 int has_decltype_auto();
413 int no_decltype_auto();
416 // CHECK-1Y: has_decltype_auto
417 // CHECK-11: no_decltype_auto
418 // CHECK-NO-11: no_decltype_auto
420 #if __has_feature(cxx_generic_lambdas)
421 int has_generic_lambdas();
423 int no_generic_lambdas();
426 // CHECK-1Y: has_generic_lambdas
427 // CHECK-11: no_generic_lambdas
428 // CHECK-NO-11: no_generic_lambdas