Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -E -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-0X %s |
Daniel Dunbar | 9fde9c4 | 2010-06-29 16:52:24 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-0X %s |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 3 | |
David Chisnall | 7a7ee30 | 2012-01-16 17:27:18 +0000 | [diff] [blame] | 4 | #if __has_feature(cxx_atomic) |
| 5 | int has_atomic(); |
| 6 | #else |
| 7 | int no_atomic(); |
| 8 | #endif |
| 9 | |
| 10 | // CHECK-0X: has_atomic |
| 11 | // CHECK-NO-0X: no_atomic |
| 12 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 13 | #if __has_feature(cxx_lambdas) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 14 | int has_lambdas(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 15 | #else |
| 16 | int no_lambdas(); |
| 17 | #endif |
| 18 | |
| 19 | // CHECK-0X: no_lambdas |
| 20 | // CHECK-NO-0X: no_lambdas |
| 21 | |
| 22 | |
| 23 | #if __has_feature(cxx_nullptr) |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 24 | int has_nullptr(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 25 | #else |
| 26 | int no_nullptr(); |
| 27 | #endif |
| 28 | |
Douglas Gregor | 84ee2ee | 2011-05-21 23:15:46 +0000 | [diff] [blame] | 29 | // CHECK-0X: has_nullptr |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 30 | // CHECK-NO-0X: no_nullptr |
| 31 | |
| 32 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 33 | #if __has_feature(cxx_decltype) |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 34 | int has_decltype(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 35 | #else |
| 36 | int no_decltype(); |
| 37 | #endif |
| 38 | |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 39 | // CHECK-0X: has_decltype |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 40 | // CHECK-NO-0X: no_decltype |
| 41 | |
| 42 | |
| 43 | #if __has_feature(cxx_auto_type) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 44 | int has_auto_type(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 45 | #else |
| 46 | int no_auto_type(); |
| 47 | #endif |
| 48 | |
Richard Smith | 738291e | 2011-02-20 12:13:05 +0000 | [diff] [blame] | 49 | // CHECK-0X: has_auto_type |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 50 | // CHECK-NO-0X: no_auto_type |
| 51 | |
| 52 | |
Richard Smith | 6a4e73c | 2011-04-03 14:12:46 +0000 | [diff] [blame] | 53 | #if __has_feature(cxx_trailing_return) |
| 54 | int has_trailing_return(); |
| 55 | #else |
| 56 | int no_trailing_return(); |
| 57 | #endif |
| 58 | |
| 59 | // CHECK-0X: has_trailing_return |
| 60 | // CHECK-NO-0X: no_trailing_return |
| 61 | |
| 62 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 63 | #if __has_feature(cxx_attributes) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 64 | int has_attributes(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 65 | #else |
| 66 | int no_attributes(); |
| 67 | #endif |
| 68 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 69 | // CHECK-0X: has_attributes |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 70 | // CHECK-NO-0X: no_attributes |
| 71 | |
| 72 | |
| 73 | #if __has_feature(cxx_static_assert) |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 74 | int has_static_assert(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 75 | #else |
| 76 | int no_static_assert(); |
| 77 | #endif |
| 78 | |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 79 | // CHECK-0X: has_static_assert |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 80 | // CHECK-NO-0X: no_static_assert |
| 81 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 82 | #if __has_feature(cxx_deleted_functions) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 83 | int has_deleted_functions(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 84 | #else |
| 85 | int no_deleted_functions(); |
| 86 | #endif |
| 87 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 88 | // CHECK-0X: has_deleted_functions |
| 89 | // CHECK-NO-0X: no_deleted_functions |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 90 | |
Douglas Gregor | f695a69 | 2011-11-01 01:19:34 +0000 | [diff] [blame] | 91 | #if __has_feature(cxx_defaulted_functions) |
| 92 | int has_defaulted_functions(); |
| 93 | #else |
| 94 | int no_defaulted_functions(); |
| 95 | #endif |
| 96 | |
| 97 | // CHECK-0X: has_defaulted_functions |
| 98 | // CHECK-NO-0X: no_defaulted_functions |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 99 | |
| 100 | #if __has_feature(cxx_rvalue_references) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 101 | int has_rvalue_references(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 102 | #else |
| 103 | int no_rvalue_references(); |
| 104 | #endif |
| 105 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 106 | // CHECK-0X: has_rvalue_references |
| 107 | // CHECK-NO-0X: no_rvalue_references |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 108 | |
| 109 | |
| 110 | #if __has_feature(cxx_variadic_templates) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 111 | int has_variadic_templates(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 112 | #else |
| 113 | int no_variadic_templates(); |
| 114 | #endif |
| 115 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 116 | // CHECK-0X: has_variadic_templates |
| 117 | // CHECK-NO-0X: no_variadic_templates |
Sebastian Redl | f6c0977 | 2010-08-31 23:28:47 +0000 | [diff] [blame] | 118 | |
| 119 | |
| 120 | #if __has_feature(cxx_inline_namespaces) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 121 | int has_inline_namespaces(); |
Sebastian Redl | f6c0977 | 2010-08-31 23:28:47 +0000 | [diff] [blame] | 122 | #else |
| 123 | int no_inline_namespaces(); |
| 124 | #endif |
| 125 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 126 | // CHECK-0X: has_inline_namespaces |
| 127 | // CHECK-NO-0X: no_inline_namespaces |
Douglas Gregor | 56209ff | 2011-01-26 21:25:54 +0000 | [diff] [blame] | 128 | |
Richard Smith | a391a46 | 2011-04-15 15:14:40 +0000 | [diff] [blame] | 129 | |
| 130 | #if __has_feature(cxx_range_for) |
| 131 | int has_range_for(); |
| 132 | #else |
| 133 | int no_range_for(); |
| 134 | #endif |
| 135 | |
| 136 | // CHECK-0X: has_range_for |
| 137 | // CHECK-NO-0X: no_range_for |
| 138 | |
| 139 | |
Douglas Gregor | 56209ff | 2011-01-26 21:25:54 +0000 | [diff] [blame] | 140 | #if __has_feature(cxx_reference_qualified_functions) |
| 141 | int has_reference_qualified_functions(); |
| 142 | #else |
| 143 | int no_reference_qualified_functions(); |
| 144 | #endif |
| 145 | |
| 146 | // CHECK-0X: has_reference_qualified_functions |
| 147 | // CHECK-NO-0X: no_reference_qualified_functions |
| 148 | |
Douglas Gregor | 0750800 | 2011-02-05 20:35:30 +0000 | [diff] [blame] | 149 | #if __has_feature(cxx_default_function_template_args) |
| 150 | int has_default_function_template_args(); |
| 151 | #else |
| 152 | int 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 Redl | 4561ecd | 2011-03-15 21:17:12 +0000 | [diff] [blame] | 158 | #if __has_feature(cxx_noexcept) |
| 159 | int has_noexcept(); |
| 160 | #else |
| 161 | int no_noexcept(); |
| 162 | #endif |
| 163 | |
| 164 | // CHECK-0X: has_noexcept |
| 165 | // CHECK-NO-0X: no_noexcept |
| 166 | |
Anders Carlsson | c8b9f79 | 2011-03-25 15:04:23 +0000 | [diff] [blame] | 167 | #if __has_feature(cxx_override_control) |
| 168 | int has_override_control(); |
| 169 | #else |
| 170 | int no_override_control(); |
| 171 | #endif |
| 172 | |
| 173 | // CHECK-0X: has_override_control |
| 174 | // CHECK-NO-0X: no_override_control |
Richard Smith | 3e4c6c4 | 2011-05-05 21:57:07 +0000 | [diff] [blame] | 175 | |
| 176 | #if __has_feature(cxx_alias_templates) |
| 177 | int has_alias_templates(); |
| 178 | #else |
| 179 | int no_alias_templates(); |
| 180 | #endif |
| 181 | |
| 182 | // CHECK-0X: has_alias_templates |
| 183 | // CHECK-NO-0X: no_alias_templates |
Sebastian Redl | 74e611a | 2011-09-04 18:14:28 +0000 | [diff] [blame] | 184 | |
| 185 | #if __has_feature(cxx_implicit_moves) |
| 186 | int has_implicit_moves(); |
| 187 | #else |
| 188 | int no_implicit_moves(); |
| 189 | #endif |
| 190 | |
| 191 | // CHECK-0X: has_implicit_moves |
| 192 | // CHECK-NO-0X: no_implicit_moves |
Peter Collingbourne | fd5f686 | 2011-10-14 23:44:46 +0000 | [diff] [blame] | 193 | |
| 194 | #if __has_feature(cxx_alignas) |
| 195 | int has_alignas(); |
| 196 | #else |
| 197 | int no_alignas(); |
| 198 | #endif |
| 199 | |
| 200 | // CHECK-0X: has_alignas |
| 201 | // CHECK-NO-0X: no_alignas |
Douglas Gregor | 172b221 | 2011-11-01 01:23:44 +0000 | [diff] [blame] | 202 | |
| 203 | #if __has_feature(cxx_raw_string_literals) |
| 204 | int has_raw_string_literals(); |
| 205 | #else |
| 206 | int 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) |
| 213 | int has_unicode_literals(); |
| 214 | #else |
| 215 | int no_unicode_literals(); |
| 216 | #endif |
| 217 | |
| 218 | // CHECK-0X: has_unicode_literals |
| 219 | // CHECK-NO-0X: no_unicode_literals |