| OLD | NEW |
| 1 // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++11 %s -o - | FileCheck --
check-prefix=CHECK-11 %s | 1 // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++11 %s -o - | FileCheck --
check-prefix=CHECK-0X %s |
| 2 // RUN: %clang_cc1 -E -triple armv7-apple-darwin -std=c++11 %s -o - | FileCheck
--check-prefix=CHECK-NO-TLS %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-prefi
x=CHECK-NO-11 %s | 3 // RUN: %clang_cc1 -E -triple x86_64-linux-gnu %s -o - | FileCheck --check-prefi
x=CHECK-NO-0X %s |
| 4 // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++1y %s -o - | FileCheck --
check-prefix=CHECK-1Y %s | |
| 5 | 4 |
| 6 #if __has_feature(cxx_atomic) | 5 #if __has_feature(cxx_atomic) |
| 7 int has_atomic(); | 6 int has_atomic(); |
| 8 #else | 7 #else |
| 9 int no_atomic(); | 8 int no_atomic(); |
| 10 #endif | 9 #endif |
| 11 | 10 |
| 12 // CHECK-1Y: has_atomic | 11 // CHECK-0X: has_atomic |
| 13 // CHECK-11: has_atomic | 12 // CHECK-NO-0X: no_atomic |
| 14 // CHECK-NO-11: no_atomic | |
| 15 | 13 |
| 16 #if __has_feature(cxx_lambdas) | 14 #if __has_feature(cxx_lambdas) |
| 17 int has_lambdas(); | 15 int has_lambdas(); |
| 18 #else | 16 #else |
| 19 int no_lambdas(); | 17 int no_lambdas(); |
| 20 #endif | 18 #endif |
| 21 | 19 |
| 22 // CHECK-1Y: has_lambdas | 20 // CHECK-0X: has_lambdas |
| 23 // CHECK-11: has_lambdas | 21 // CHECK-NO-0X: no_lambdas |
| 24 // CHECK-NO-11: no_lambdas | |
| 25 | 22 |
| 26 | 23 |
| 27 #if __has_feature(cxx_nullptr) | 24 #if __has_feature(cxx_nullptr) |
| 28 int has_nullptr(); | 25 int has_nullptr(); |
| 29 #else | 26 #else |
| 30 int no_nullptr(); | 27 int no_nullptr(); |
| 31 #endif | 28 #endif |
| 32 | 29 |
| 33 // CHECK-1Y: has_nullptr | 30 // CHECK-0X: has_nullptr |
| 34 // CHECK-11: has_nullptr | 31 // CHECK-NO-0X: no_nullptr |
| 35 // CHECK-NO-11: no_nullptr | |
| 36 | 32 |
| 37 | 33 |
| 38 #if __has_feature(cxx_decltype) | 34 #if __has_feature(cxx_decltype) |
| 39 int has_decltype(); | 35 int has_decltype(); |
| 40 #else | 36 #else |
| 41 int no_decltype(); | 37 int no_decltype(); |
| 42 #endif | 38 #endif |
| 43 | 39 |
| 44 // CHECK-1Y: has_decltype | 40 // CHECK-0X: has_decltype |
| 45 // CHECK-11: has_decltype | 41 // CHECK-NO-0X: no_decltype |
| 46 // CHECK-NO-11: no_decltype | |
| 47 | 42 |
| 48 | 43 |
| 49 #if __has_feature(cxx_decltype_incomplete_return_types) | 44 #if __has_feature(cxx_decltype_incomplete_return_types) |
| 50 int has_decltype_incomplete_return_types(); | 45 int has_decltype_incomplete_return_types(); |
| 51 #else | 46 #else |
| 52 int no_decltype_incomplete_return_types(); | 47 int no_decltype_incomplete_return_types(); |
| 53 #endif | 48 #endif |
| 54 | 49 |
| 55 // CHECK-1Y: has_decltype_incomplete_return_types | 50 // CHECK-0X: has_decltype_incomplete_return_types |
| 56 // CHECK-11: has_decltype_incomplete_return_types | 51 // CHECK-NO-0X: no_decltype_incomplete_return_types |
| 57 // CHECK-NO-11: no_decltype_incomplete_return_types | |
| 58 | 52 |
| 59 | 53 |
| 60 #if __has_feature(cxx_auto_type) | 54 #if __has_feature(cxx_auto_type) |
| 61 int has_auto_type(); | 55 int has_auto_type(); |
| 62 #else | 56 #else |
| 63 int no_auto_type(); | 57 int no_auto_type(); |
| 64 #endif | 58 #endif |
| 65 | 59 |
| 66 // CHECK-1Y: has_auto_type | 60 // CHECK-0X: has_auto_type |
| 67 // CHECK-11: has_auto_type | 61 // CHECK-NO-0X: no_auto_type |
| 68 // CHECK-NO-11: no_auto_type | |
| 69 | 62 |
| 70 | 63 |
| 71 #if __has_feature(cxx_trailing_return) | 64 #if __has_feature(cxx_trailing_return) |
| 72 int has_trailing_return(); | 65 int has_trailing_return(); |
| 73 #else | 66 #else |
| 74 int no_trailing_return(); | 67 int no_trailing_return(); |
| 75 #endif | 68 #endif |
| 76 | 69 |
| 77 // CHECK-1Y: has_trailing_return | 70 // CHECK-0X: has_trailing_return |
| 78 // CHECK-11: has_trailing_return | 71 // CHECK-NO-0X: no_trailing_return |
| 79 // CHECK-NO-11: no_trailing_return | |
| 80 | 72 |
| 81 | 73 |
| 82 #if __has_feature(cxx_attributes) | 74 #if __has_feature(cxx_attributes) |
| 83 int has_attributes(); | 75 int has_attributes(); |
| 84 #else | 76 #else |
| 85 int no_attributes(); | 77 int no_attributes(); |
| 86 #endif | 78 #endif |
| 87 | 79 |
| 88 // CHECK-1Y: has_attributes | 80 // CHECK-0X: has_attributes |
| 89 // CHECK-11: has_attributes | 81 // CHECK-NO-0X: no_attributes |
| 90 // CHECK-NO-11: no_attributes | |
| 91 | 82 |
| 92 | 83 |
| 93 #if __has_feature(cxx_static_assert) | 84 #if __has_feature(cxx_static_assert) |
| 94 int has_static_assert(); | 85 int has_static_assert(); |
| 95 #else | 86 #else |
| 96 int no_static_assert(); | 87 int no_static_assert(); |
| 97 #endif | 88 #endif |
| 98 | 89 |
| 99 // CHECK-1Y: has_static_assert | 90 // CHECK-0X: has_static_assert |
| 100 // CHECK-11: has_static_assert | 91 // CHECK-NO-0X: no_static_assert |
| 101 // CHECK-NO-11: no_static_assert | |
| 102 | 92 |
| 103 #if __has_feature(cxx_deleted_functions) | 93 #if __has_feature(cxx_deleted_functions) |
| 104 int has_deleted_functions(); | 94 int has_deleted_functions(); |
| 105 #else | 95 #else |
| 106 int no_deleted_functions(); | 96 int no_deleted_functions(); |
| 107 #endif | 97 #endif |
| 108 | 98 |
| 109 // CHECK-1Y: has_deleted_functions | 99 // CHECK-0X: has_deleted_functions |
| 110 // CHECK-11: has_deleted_functions | 100 // CHECK-NO-0X: no_deleted_functions |
| 111 // CHECK-NO-11: no_deleted_functions | |
| 112 | 101 |
| 113 #if __has_feature(cxx_defaulted_functions) | 102 #if __has_feature(cxx_defaulted_functions) |
| 114 int has_defaulted_functions(); | 103 int has_defaulted_functions(); |
| 115 #else | 104 #else |
| 116 int no_defaulted_functions(); | 105 int no_defaulted_functions(); |
| 117 #endif | 106 #endif |
| 118 | 107 |
| 119 // CHECK-1Y: has_defaulted_functions | 108 // CHECK-0X: has_defaulted_functions |
| 120 // CHECK-11: has_defaulted_functions | 109 // CHECK-NO-0X: no_defaulted_functions |
| 121 // CHECK-NO-11: no_defaulted_functions | |
| 122 | 110 |
| 123 #if __has_feature(cxx_rvalue_references) | 111 #if __has_feature(cxx_rvalue_references) |
| 124 int has_rvalue_references(); | 112 int has_rvalue_references(); |
| 125 #else | 113 #else |
| 126 int no_rvalue_references(); | 114 int no_rvalue_references(); |
| 127 #endif | 115 #endif |
| 128 | 116 |
| 129 // CHECK-1Y: has_rvalue_references | 117 // CHECK-0X: has_rvalue_references |
| 130 // CHECK-11: has_rvalue_references | 118 // CHECK-NO-0X: no_rvalue_references |
| 131 // CHECK-NO-11: no_rvalue_references | |
| 132 | 119 |
| 133 | 120 |
| 134 #if __has_feature(cxx_variadic_templates) | 121 #if __has_feature(cxx_variadic_templates) |
| 135 int has_variadic_templates(); | 122 int has_variadic_templates(); |
| 136 #else | 123 #else |
| 137 int no_variadic_templates(); | 124 int no_variadic_templates(); |
| 138 #endif | 125 #endif |
| 139 | 126 |
| 140 // CHECK-1Y: has_variadic_templates | 127 // CHECK-0X: has_variadic_templates |
| 141 // CHECK-11: has_variadic_templates | 128 // CHECK-NO-0X: no_variadic_templates |
| 142 // CHECK-NO-11: no_variadic_templates | |
| 143 | 129 |
| 144 | 130 |
| 145 #if __has_feature(cxx_inline_namespaces) | 131 #if __has_feature(cxx_inline_namespaces) |
| 146 int has_inline_namespaces(); | 132 int has_inline_namespaces(); |
| 147 #else | 133 #else |
| 148 int no_inline_namespaces(); | 134 int no_inline_namespaces(); |
| 149 #endif | 135 #endif |
| 150 | 136 |
| 151 // CHECK-1Y: has_inline_namespaces | 137 // CHECK-0X: has_inline_namespaces |
| 152 // CHECK-11: has_inline_namespaces | 138 // CHECK-NO-0X: no_inline_namespaces |
| 153 // CHECK-NO-11: no_inline_namespaces | |
| 154 | 139 |
| 155 | 140 |
| 156 #if __has_feature(cxx_range_for) | 141 #if __has_feature(cxx_range_for) |
| 157 int has_range_for(); | 142 int has_range_for(); |
| 158 #else | 143 #else |
| 159 int no_range_for(); | 144 int no_range_for(); |
| 160 #endif | 145 #endif |
| 161 | 146 |
| 162 // CHECK-1Y: has_range_for | 147 // CHECK-0X: has_range_for |
| 163 // CHECK-11: has_range_for | 148 // CHECK-NO-0X: no_range_for |
| 164 // CHECK-NO-11: no_range_for | |
| 165 | 149 |
| 166 | 150 |
| 167 #if __has_feature(cxx_reference_qualified_functions) | 151 #if __has_feature(cxx_reference_qualified_functions) |
| 168 int has_reference_qualified_functions(); | 152 int has_reference_qualified_functions(); |
| 169 #else | 153 #else |
| 170 int no_reference_qualified_functions(); | 154 int no_reference_qualified_functions(); |
| 171 #endif | 155 #endif |
| 172 | 156 |
| 173 // CHECK-1Y: has_reference_qualified_functions | 157 // CHECK-0X: has_reference_qualified_functions |
| 174 // CHECK-11: has_reference_qualified_functions | 158 // CHECK-NO-0X: no_reference_qualified_functions |
| 175 // CHECK-NO-11: no_reference_qualified_functions | |
| 176 | 159 |
| 177 #if __has_feature(cxx_default_function_template_args) | 160 #if __has_feature(cxx_default_function_template_args) |
| 178 int has_default_function_template_args(); | 161 int has_default_function_template_args(); |
| 179 #else | 162 #else |
| 180 int no_default_function_template_args(); | 163 int no_default_function_template_args(); |
| 181 #endif | 164 #endif |
| 182 | 165 |
| 183 // CHECK-1Y: has_default_function_template_args | 166 // CHECK-0X: has_default_function_template_args |
| 184 // CHECK-11: has_default_function_template_args | 167 // CHECK-NO-0X: no_default_function_template_args |
| 185 // CHECK-NO-11: no_default_function_template_args | |
| 186 | 168 |
| 187 #if __has_feature(cxx_noexcept) | 169 #if __has_feature(cxx_noexcept) |
| 188 int has_noexcept(); | 170 int has_noexcept(); |
| 189 #else | 171 #else |
| 190 int no_noexcept(); | 172 int no_noexcept(); |
| 191 #endif | 173 #endif |
| 192 | 174 |
| 193 // CHECK-1Y: has_noexcept | 175 // CHECK-0X: has_noexcept |
| 194 // CHECK-11: has_noexcept | 176 // CHECK-NO-0X: no_noexcept |
| 195 // CHECK-NO-11: no_noexcept | |
| 196 | 177 |
| 197 #if __has_feature(cxx_override_control) | 178 #if __has_feature(cxx_override_control) |
| 198 int has_override_control(); | 179 int has_override_control(); |
| 199 #else | 180 #else |
| 200 int no_override_control(); | 181 int no_override_control(); |
| 201 #endif | 182 #endif |
| 202 | 183 |
| 203 // CHECK-1Y: has_override_control | 184 // CHECK-0X: has_override_control |
| 204 // CHECK-11: has_override_control | 185 // CHECK-NO-0X: no_override_control |
| 205 // CHECK-NO-11: no_override_control | |
| 206 | 186 |
| 207 #if __has_feature(cxx_alias_templates) | 187 #if __has_feature(cxx_alias_templates) |
| 208 int has_alias_templates(); | 188 int has_alias_templates(); |
| 209 #else | 189 #else |
| 210 int no_alias_templates(); | 190 int no_alias_templates(); |
| 211 #endif | 191 #endif |
| 212 | 192 |
| 213 // CHECK-1Y: has_alias_templates | 193 // CHECK-0X: has_alias_templates |
| 214 // CHECK-11: has_alias_templates | 194 // CHECK-NO-0X: no_alias_templates |
| 215 // CHECK-NO-11: no_alias_templates | |
| 216 | 195 |
| 217 #if __has_feature(cxx_implicit_moves) | 196 #if __has_feature(cxx_implicit_moves) |
| 218 int has_implicit_moves(); | 197 int has_implicit_moves(); |
| 219 #else | 198 #else |
| 220 int no_implicit_moves(); | 199 int no_implicit_moves(); |
| 221 #endif | 200 #endif |
| 222 | 201 |
| 223 // CHECK-1Y: has_implicit_moves | 202 // CHECK-0X: has_implicit_moves |
| 224 // CHECK-11: has_implicit_moves | 203 // CHECK-NO-0X: no_implicit_moves |
| 225 // CHECK-NO-11: no_implicit_moves | |
| 226 | 204 |
| 227 #if __has_feature(cxx_alignas) | 205 #if __has_feature(cxx_alignas) |
| 228 int has_alignas(); | 206 int has_alignas(); |
| 229 #else | 207 #else |
| 230 int no_alignas(); | 208 int no_alignas(); |
| 231 #endif | 209 #endif |
| 232 | 210 |
| 233 // CHECK-1Y: has_alignas | 211 // CHECK-0X: has_alignas |
| 234 // CHECK-11: has_alignas | 212 // CHECK-NO-0X: no_alignas |
| 235 // CHECK-NO-11: no_alignas | |
| 236 | 213 |
| 237 #if __has_feature(cxx_raw_string_literals) | 214 #if __has_feature(cxx_raw_string_literals) |
| 238 int has_raw_string_literals(); | 215 int has_raw_string_literals(); |
| 239 #else | 216 #else |
| 240 int no_raw_string_literals(); | 217 int no_raw_string_literals(); |
| 241 #endif | 218 #endif |
| 242 | 219 |
| 243 // CHECK-1Y: has_raw_string_literals | 220 // CHECK-0X: has_raw_string_literals |
| 244 // CHECK-11: has_raw_string_literals | 221 // CHECK-NO-0X: no_raw_string_literals |
| 245 // CHECK-NO-11: no_raw_string_literals | |
| 246 | 222 |
| 247 #if __has_feature(cxx_unicode_literals) | 223 #if __has_feature(cxx_unicode_literals) |
| 248 int has_unicode_literals(); | 224 int has_unicode_literals(); |
| 249 #else | 225 #else |
| 250 int no_unicode_literals(); | 226 int no_unicode_literals(); |
| 251 #endif | 227 #endif |
| 252 | 228 |
| 253 // CHECK-1Y: has_unicode_literals | 229 // CHECK-0X: has_unicode_literals |
| 254 // CHECK-11: has_unicode_literals | 230 // CHECK-NO-0X: no_unicode_literals |
| 255 // CHECK-NO-11: no_unicode_literals | |
| 256 | 231 |
| 257 #if __has_feature(cxx_constexpr) | 232 #if __has_feature(cxx_constexpr) |
| 258 int has_constexpr(); | 233 int has_constexpr(); |
| 259 #else | 234 #else |
| 260 int no_constexpr(); | 235 int no_constexpr(); |
| 261 #endif | 236 #endif |
| 262 | 237 |
| 263 // CHECK-1Y: has_constexpr | 238 // CHECK-0X: has_constexpr |
| 264 // CHECK-11: has_constexpr | 239 // CHECK-NO-0X: no_constexpr |
| 265 // CHECK-NO-11: no_constexpr | |
| 266 | 240 |
| 267 #if __has_feature(cxx_generalized_initializers) | 241 #if __has_feature(cxx_generalized_initializers) |
| 268 int has_generalized_initializers(); | 242 int has_generalized_initializers(); |
| 269 #else | 243 #else |
| 270 int no_generalized_initializers(); | 244 int no_generalized_initializers(); |
| 271 #endif | 245 #endif |
| 272 | 246 |
| 273 // CHECK-1Y: has_generalized_initializers | 247 // CHECK-0X: has_generalized_initializers |
| 274 // CHECK-11: has_generalized_initializers | 248 // CHECK-NO-0X: no_generalized_initializers |
| 275 // CHECK-NO-11: no_generalized_initializers | |
| 276 | 249 |
| 277 #if __has_feature(cxx_unrestricted_unions) | 250 #if __has_feature(cxx_unrestricted_unions) |
| 278 int has_unrestricted_unions(); | 251 int has_unrestricted_unions(); |
| 279 #else | 252 #else |
| 280 int no_unrestricted_unions(); | 253 int no_unrestricted_unions(); |
| 281 #endif | 254 #endif |
| 282 | 255 |
| 283 // CHECK-1Y: has_unrestricted_unions | 256 // CHECK-0X: has_unrestricted_unions |
| 284 // CHECK-11: has_unrestricted_unions | 257 // CHECK-NO-0X: no_unrestricted_unions |
| 285 // CHECK-NO-11: no_unrestricted_unions | |
| 286 | 258 |
| 287 #if __has_feature(cxx_user_literals) | 259 #if __has_feature(cxx_user_literals) |
| 288 int has_user_literals(); | 260 int has_user_literals(); |
| 289 #else | 261 #else |
| 290 int no_user_literals(); | 262 int no_user_literals(); |
| 291 #endif | 263 #endif |
| 292 | 264 |
| 293 // CHECK-1Y: has_user_literals | 265 // CHECK-0X: has_user_literals |
| 294 // CHECK-11: has_user_literals | 266 // CHECK-NO-0X: no_user_literals |
| 295 // CHECK-NO-11: no_user_literals | |
| 296 | 267 |
| 297 #if __has_feature(cxx_local_type_template_args) | 268 #if __has_feature(cxx_local_type_template_args) |
| 298 int has_local_type_template_args(); | 269 int has_local_type_template_args(); |
| 299 #else | 270 #else |
| 300 int no_local_type_template_args(); | 271 int no_local_type_template_args(); |
| 301 #endif | 272 #endif |
| 302 | 273 |
| 303 // CHECK-1Y: has_local_type_template_args | 274 // CHECK-0X: has_local_type_template_args |
| 304 // CHECK-11: has_local_type_template_args | 275 // CHECK-NO-0X: no_local_type_template_args |
| 305 // CHECK-NO-11: no_local_type_template_args | |
| 306 | 276 |
| 307 #if __has_feature(cxx_inheriting_constructors) | 277 #if __has_feature(cxx_inheriting_constructors) |
| 308 int has_inheriting_constructors(); | 278 int has_inheriting_constructors(); |
| 309 #else | 279 #else |
| 310 int no_inheriting_constructors(); | 280 int no_inheriting_constructors(); |
| 311 #endif | 281 #endif |
| 312 | 282 |
| 313 // CHECK-1Y: has_inheriting_constructors | 283 // CHECK-0X: has_inheriting_constructors |
| 314 // CHECK-11: has_inheriting_constructors | 284 // CHECK-NO-0X: no_inheriting_constructors |
| 315 // CHECK-NO-11: no_inheriting_constructors | |
| 316 | 285 |
| 317 #if __has_feature(cxx_thread_local) | 286 #if __has_feature(cxx_thread_local) |
| 318 int has_thread_local(); | 287 int has_thread_local(); |
| 319 #else | 288 #else |
| 320 int no_thread_local(); | 289 int no_thread_local(); |
| 321 #endif | 290 #endif |
| 322 | 291 |
| 323 // CHECK-1Y: has_thread_local | 292 // CHECK-0X: has_thread_local |
| 324 // CHECK-11: has_thread_local | 293 // CHECK-NO-0X: no_thread_local |
| 325 // CHECK-NO-11: no_thread_local | |
| 326 // CHECK-NO-TLS: no_thread_local | 294 // CHECK-NO-TLS: no_thread_local |
| 327 | |
| 328 // === C++1y features === | |
| 329 | |
| 330 #if __has_feature(cxx_binary_literals) | |
| 331 int has_binary_literals(); | |
| 332 #else | |
| 333 int no_binary_literals(); | |
| 334 #endif | |
| 335 | |
| 336 // CHECK-1Y: has_binary_literals | |
| 337 // CHECK-11: no_binary_literals | |
| 338 // CHECK-NO-11: no_binary_literals | |
| 339 | |
| 340 #if __has_feature(cxx_aggregate_nsdmi) | |
| 341 int has_aggregate_nsdmi(); | |
| 342 #else | |
| 343 int no_aggregate_nsdmi(); | |
| 344 #endif | |
| 345 | |
| 346 // CHECK-1Y: has_aggregate_nsdmi | |
| 347 // CHECK-11: no_aggregate_nsdmi | |
| 348 // CHECK-NO-11: no_aggregate_nsdmi | |
| OLD | NEW |