brintos

brintos / llvm-project-archived public Read only

0
0
Text · 10.7 KiB · 9082ca8 Raw
482 lines · cpp
1// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-11 %s2// RUN: %clang_cc1 -E -triple armv7-apple-darwin -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-NO-TLS %s3// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++98 %s -o - | FileCheck --check-prefix=CHECK-NO-11 %s4// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++14 %s -o - | FileCheck --check-prefix=CHECK-14 %s5// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++1z %s -o - | FileCheck --check-prefix=CHECK-1Z %s6 7#if __has_feature(cxx_atomic)8int has_atomic();9#else10int no_atomic();11#endif12 13// CHECK-1Z: has_atomic14// CHECK-14: has_atomic15// CHECK-11: has_atomic16// CHECK-NO-11: no_atomic17 18#if __has_feature(cxx_lambdas)19int has_lambdas();20#else21int no_lambdas();22#endif23 24// CHECK-1Z: has_lambdas25// CHECK-14: has_lambdas26// CHECK-11: has_lambdas27// CHECK-NO-11: no_lambdas28 29 30#if __has_feature(cxx_nullptr)31int has_nullptr();32#else33int no_nullptr();34#endif35 36// CHECK-1Z: has_nullptr37// CHECK-14: has_nullptr38// CHECK-11: has_nullptr39// CHECK-NO-11: no_nullptr40 41 42#if __has_feature(cxx_decltype)43int has_decltype();44#else45int no_decltype();46#endif47 48// CHECK-1Z: has_decltype49// CHECK-14: has_decltype50// CHECK-11: has_decltype51// CHECK-NO-11: no_decltype52 53 54#if __has_feature(cxx_decltype_incomplete_return_types)55int has_decltype_incomplete_return_types();56#else57int no_decltype_incomplete_return_types();58#endif59 60// CHECK-1Z: has_decltype_incomplete_return_types61// CHECK-14: has_decltype_incomplete_return_types62// CHECK-11: has_decltype_incomplete_return_types63// CHECK-NO-11: no_decltype_incomplete_return_types64 65 66#if __has_feature(cxx_auto_type)67int has_auto_type();68#else69int no_auto_type();70#endif71 72// CHECK-1Z: has_auto_type73// CHECK-14: has_auto_type74// CHECK-11: has_auto_type75// CHECK-NO-11: no_auto_type76 77 78#if __has_feature(cxx_trailing_return)79int has_trailing_return();80#else81int no_trailing_return();82#endif83 84// CHECK-1Z: has_trailing_return85// CHECK-14: has_trailing_return86// CHECK-11: has_trailing_return87// CHECK-NO-11: no_trailing_return88 89 90#if __has_feature(cxx_attributes)91int has_attributes();92#else93int no_attributes();94#endif95 96// CHECK-1Z: has_attributes97// CHECK-14: has_attributes98// CHECK-11: has_attributes99// CHECK-NO-11: no_attributes100 101 102#if __has_feature(cxx_static_assert)103int has_static_assert();104#else105int no_static_assert();106#endif107 108// CHECK-1Z: has_static_assert109// CHECK-14: has_static_assert110// CHECK-11: has_static_assert111// CHECK-NO-11: no_static_assert112 113#if __has_feature(cxx_deleted_functions)114int has_deleted_functions();115#else116int no_deleted_functions();117#endif118 119// CHECK-1Z: has_deleted_functions120// CHECK-14: has_deleted_functions121// CHECK-11: has_deleted_functions122// CHECK-NO-11: no_deleted_functions123 124#if __has_feature(cxx_defaulted_functions)125int has_defaulted_functions();126#else127int no_defaulted_functions();128#endif129 130// CHECK-1Z: has_defaulted_functions131// CHECK-14: has_defaulted_functions132// CHECK-11: has_defaulted_functions133// CHECK-NO-11: no_defaulted_functions134 135#if __has_feature(cxx_rvalue_references)136int has_rvalue_references();137#else138int no_rvalue_references();139#endif140 141// CHECK-1Z: has_rvalue_references142// CHECK-14: has_rvalue_references143// CHECK-11: has_rvalue_references144// CHECK-NO-11: no_rvalue_references145 146 147#if __has_feature(cxx_variadic_templates)148int has_variadic_templates();149#else150int no_variadic_templates();151#endif152 153// CHECK-1Z: has_variadic_templates154// CHECK-14: has_variadic_templates155// CHECK-11: has_variadic_templates156// CHECK-NO-11: no_variadic_templates157 158 159#if __has_feature(cxx_inline_namespaces)160int has_inline_namespaces();161#else162int no_inline_namespaces();163#endif164 165// CHECK-1Z: has_inline_namespaces166// CHECK-14: has_inline_namespaces167// CHECK-11: has_inline_namespaces168// CHECK-NO-11: no_inline_namespaces169 170 171#if __has_feature(cxx_range_for)172int has_range_for();173#else174int no_range_for();175#endif176 177// CHECK-1Z: has_range_for178// CHECK-14: has_range_for179// CHECK-11: has_range_for180// CHECK-NO-11: no_range_for181 182 183#if __has_feature(cxx_reference_qualified_functions)184int has_reference_qualified_functions();185#else186int no_reference_qualified_functions();187#endif188 189// CHECK-1Z: has_reference_qualified_functions190// CHECK-14: has_reference_qualified_functions191// CHECK-11: has_reference_qualified_functions192// CHECK-NO-11: no_reference_qualified_functions193 194#if __has_feature(cxx_default_function_template_args)195int has_default_function_template_args();196#else197int no_default_function_template_args();198#endif199 200// CHECK-1Z: has_default_function_template_args201// CHECK-14: has_default_function_template_args202// CHECK-11: has_default_function_template_args203// CHECK-NO-11: no_default_function_template_args204 205#if __has_feature(cxx_noexcept)206int has_noexcept();207#else208int no_noexcept();209#endif210 211// CHECK-1Z: has_noexcept212// CHECK-14: has_noexcept213// CHECK-11: has_noexcept214// CHECK-NO-11: no_noexcept215 216#if __has_feature(cxx_override_control)217int has_override_control();218#else219int no_override_control();220#endif221 222// CHECK-1Z: has_override_control223// CHECK-14: has_override_control224// CHECK-11: has_override_control225// CHECK-NO-11: no_override_control226 227#if __has_feature(cxx_alias_templates)228int has_alias_templates();229#else230int no_alias_templates();231#endif232 233// CHECK-1Z: has_alias_templates234// CHECK-14: has_alias_templates235// CHECK-11: has_alias_templates236// CHECK-NO-11: no_alias_templates237 238#if __has_feature(cxx_implicit_moves)239int has_implicit_moves();240#else241int no_implicit_moves();242#endif243 244// CHECK-1Z: has_implicit_moves245// CHECK-14: has_implicit_moves246// CHECK-11: has_implicit_moves247// CHECK-NO-11: no_implicit_moves248 249#if __has_feature(cxx_alignas)250int has_alignas();251#else252int no_alignas();253#endif254 255// CHECK-1Z: has_alignas256// CHECK-14: has_alignas257// CHECK-11: has_alignas258// CHECK-NO-11: no_alignas259 260#if __has_feature(cxx_alignof)261int has_alignof();262#else263int no_alignof();264#endif265 266// CHECK-1Z: has_alignof267// CHECK-14: has_alignof268// CHECK-11: has_alignof269// CHECK-NO-11: no_alignof270 271#if __has_feature(cxx_raw_string_literals)272int has_raw_string_literals();273#else274int no_raw_string_literals();275#endif276 277// CHECK-1Z: has_raw_string_literals278// CHECK-14: has_raw_string_literals279// CHECK-11: has_raw_string_literals280// CHECK-NO-11: no_raw_string_literals281 282#if __has_feature(cxx_unicode_literals)283int has_unicode_literals();284#else285int no_unicode_literals();286#endif287 288// CHECK-1Z: has_unicode_literals289// CHECK-14: has_unicode_literals290// CHECK-11: has_unicode_literals291// CHECK-NO-11: no_unicode_literals292 293#if __has_feature(cxx_constexpr)294int has_constexpr();295#else296int no_constexpr();297#endif298 299// CHECK-1Z: has_constexpr300// CHECK-14: has_constexpr301// CHECK-11: has_constexpr302// CHECK-NO-11: no_constexpr303 304#if __has_feature(cxx_constexpr_string_builtins)305int has_constexpr_string_builtins();306#else307int no_constexpr_string_builtins();308#endif309 310// CHECK-1Z: has_constexpr_string_builtins311// CHECK-14: has_constexpr_string_builtins312// CHECK-11: has_constexpr_string_builtins313// CHECK-NO-11: no_constexpr_string_builtins314 315#if __has_feature(cxx_generalized_initializers)316int has_generalized_initializers();317#else318int no_generalized_initializers();319#endif320 321// CHECK-1Z: has_generalized_initializers322// CHECK-14: has_generalized_initializers323// CHECK-11: has_generalized_initializers324// CHECK-NO-11: no_generalized_initializers325 326#if __has_feature(cxx_unrestricted_unions)327int has_unrestricted_unions();328#else329int no_unrestricted_unions();330#endif331 332// CHECK-1Z: has_unrestricted_unions333// CHECK-14: has_unrestricted_unions334// CHECK-11: has_unrestricted_unions335// CHECK-NO-11: no_unrestricted_unions336 337#if __has_feature(cxx_user_literals)338int has_user_literals();339#else340int no_user_literals();341#endif342 343// CHECK-1Z: has_user_literals344// CHECK-14: has_user_literals345// CHECK-11: has_user_literals346// CHECK-NO-11: no_user_literals347 348#if __has_feature(cxx_local_type_template_args)349int has_local_type_template_args();350#else351int no_local_type_template_args();352#endif353 354// CHECK-1Z: has_local_type_template_args355// CHECK-14: has_local_type_template_args356// CHECK-11: has_local_type_template_args357// CHECK-NO-11: no_local_type_template_args358 359#if __has_feature(cxx_inheriting_constructors)360int has_inheriting_constructors();361#else362int no_inheriting_constructors();363#endif364 365// CHECK-1Z: has_inheriting_constructors366// CHECK-14: has_inheriting_constructors367// CHECK-11: has_inheriting_constructors368// CHECK-NO-11: no_inheriting_constructors369 370#if __has_feature(cxx_thread_local)371int has_thread_local();372#else373int no_thread_local();374#endif375 376// CHECK-1Z: has_thread_local377// CHECK-14: has_thread_local378// CHECK-11: has_thread_local379// CHECK-NO-11: no_thread_local380// CHECK-NO-TLS: no_thread_local381 382// === C++14 features ===383 384#if __has_feature(cxx_binary_literals)385int has_binary_literals();386#else387int no_binary_literals();388#endif389 390// CHECK-1Z: has_binary_literals391// CHECK-14: has_binary_literals392// CHECK-11: no_binary_literals393// CHECK-NO-11: no_binary_literals394 395#if __has_feature(cxx_aggregate_nsdmi)396int has_aggregate_nsdmi();397#else398int no_aggregate_nsdmi();399#endif400 401// CHECK-1Z: has_aggregate_nsdmi402// CHECK-14: has_aggregate_nsdmi403// CHECK-11: no_aggregate_nsdmi404// CHECK-NO-11: no_aggregate_nsdmi405 406#if __has_feature(cxx_return_type_deduction)407int has_return_type_deduction();408#else409int no_return_type_deduction();410#endif411 412// CHECK-1Z: has_return_type_deduction413// CHECK-14: has_return_type_deduction414// CHECK-11: no_return_type_deduction415// CHECK-NO-11: no_return_type_deduction416 417#if __has_feature(cxx_contextual_conversions)418int has_contextual_conversions();419#else420int no_contextual_conversions();421#endif422 423// CHECK-1Z: has_contextual_conversions424// CHECK-14: has_contextual_conversions425// CHECK-11: no_contextual_conversions426// CHECK-NO-11: no_contextual_conversions427 428#if __has_feature(cxx_relaxed_constexpr)429int has_relaxed_constexpr();430#else431int no_relaxed_constexpr();432#endif433 434// CHECK-1Z: has_relaxed_constexpr435// CHECK-14: has_relaxed_constexpr436// CHECK-11: no_relaxed_constexpr437// CHECK-NO-11: no_relaxed_constexpr438 439#if __has_feature(cxx_variable_templates)440int has_variable_templates();441#else442int no_variable_templates();443#endif444 445// CHECK-1Z: has_variable_templates446// CHECK-14: has_variable_templates447// CHECK-11: no_variable_templates448// CHECK-NO-11: no_variable_templates449 450#if __has_feature(cxx_init_captures)451int has_init_captures();452#else453int no_init_captures();454#endif455 456// CHECK-1Z: has_init_captures457// CHECK-14: has_init_captures458// CHECK-11: no_init_captures459// CHECK-NO-11: no_init_captures460 461#if __has_feature(cxx_decltype_auto)462int has_decltype_auto();463#else464int no_decltype_auto();465#endif466 467// CHECK-1Z: has_decltype_auto468// CHECK-14: has_decltype_auto469// CHECK-11: no_decltype_auto470// CHECK-NO-11: no_decltype_auto471 472#if __has_feature(cxx_generic_lambdas)473int has_generic_lambdas();474#else475int no_generic_lambdas();476#endif477 478// CHECK-1Z: has_generic_lambdas479// CHECK-14: has_generic_lambdas480// CHECK-11: no_generic_lambdas481// CHECK-NO-11: no_generic_lambdas482