| 1 | // RUN: %clang_cc1 -verify -std=gnu++11 %s |
| 2 | // RUN: %clang_cc1 -verify -std=c++11 %s |
| 3 | // RUN: %clang_cc1 -triple powerpc64-linux -verify -std=c++11 %s |
| 4 | // RUN: %clang_cc1 -triple i686-windows-gnu -verify -std=c++11 %s |
| 5 | // RUN: %clang_cc1 -triple x86_64-windows-gnu -verify -std=c++11 %s |
| 6 | // RUN: %clang_cc1 -triple x86_64-windows-msvc -verify -std=c++11 %s |
| 7 | |
| 8 | #if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__) |
| 9 | __float128 f; |
| 10 | template<typename> struct __is_floating_point_helper {}; |
| 11 | template<> struct __is_floating_point_helper<__float128> {}; |
| 12 | int g(int x, __float128 *y) { |
| 13 | return x + *y; |
| 14 | } |
| 15 | |
| 16 | // expected-no-diagnostics |
| 17 | #else |
| 18 | #if !defined(__STRICT_ANSI__) |
| 19 | __float128 f; // expected-error {{__float128 is not supported on this target}} |
| 20 | // But this should work: |
| 21 | template<typename> struct __is_floating_point_helper {}; |
| 22 | template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}} |
| 23 | |
| 24 | // FIXME: This could have a better diag. |
| 25 | int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}} |
| 26 | return x + *y; |
| 27 | } |
| 28 | |
| 29 | #else |
| 30 | __float128 f; // expected-error {{__float128 is not supported on this target}} |
| 31 | template<typename> struct __is_floating_point_helper {}; |
| 32 | template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}} |
| 33 | |
| 34 | int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}} |
| 35 | return x + *y; |
| 36 | } |
| 37 | |
| 38 | #endif |
| 39 | #endif |
| 40 | |