19eabbb60SReid Kleckner // RUN: %clang_cc1 -verify -std=gnu++11 %s 29eabbb60SReid Kleckner // RUN: %clang_cc1 -verify -std=c++11 %s 39eabbb60SReid Kleckner // RUN: %clang_cc1 -triple powerpc64-linux -verify -std=c++11 %s 49eabbb60SReid Kleckner // RUN: %clang_cc1 -triple i686-windows-gnu -verify -std=c++11 %s 59eabbb60SReid Kleckner // RUN: %clang_cc1 -triple x86_64-windows-gnu -verify -std=c++11 %s 69eabbb60SReid Kleckner // RUN: %clang_cc1 -triple x86_64-windows-msvc -verify -std=c++11 %s 708ef80f4SNico Weber 89eabbb60SReid Kleckner #if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__) 9*4aa510beSserge-sans-paille 10*4aa510beSserge-sans-paille #if defined(__ppc__) 11*4aa510beSserge-sans-paille template <typename> struct __is_float128 { static constexpr bool value = false; }; 12*4aa510beSserge-sans-paille template <> struct __is_float128<__float128> { static constexpr bool value = true; }; 13*4aa510beSserge-sans-paille static_assert(__is_float128<__ieee128>::value, "__ieee128 aliases to __float128"); 14*4aa510beSserge-sans-paille #endif 15*4aa510beSserge-sans-paille 16bb1ea2d6SNemanja Ivanovic __float128 f; 1708ef80f4SNico Weber template<typename> struct __is_floating_point_helper {}; 18d7d45bf8SNemanja Ivanovic template<> struct __is_floating_point_helper<__float128> {}; 19bb1ea2d6SNemanja Ivanovic int g(int x, __float128 *y) { 20bb1ea2d6SNemanja Ivanovic return x + *y; 21bb1ea2d6SNemanja Ivanovic } 22bb1ea2d6SNemanja Ivanovic 23bb1ea2d6SNemanja Ivanovic // expected-no-diagnostics 24bb1ea2d6SNemanja Ivanovic #else 25bb1ea2d6SNemanja Ivanovic #if !defined(__STRICT_ANSI__) 26bb1ea2d6SNemanja Ivanovic __float128 f; // expected-error {{__float128 is not supported on this target}} 27bb1ea2d6SNemanja Ivanovic // But this should work: 28bb1ea2d6SNemanja Ivanovic template<typename> struct __is_floating_point_helper {}; 29bb1ea2d6SNemanja Ivanovic template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}} 3008ef80f4SNico Weber 3108ef80f4SNico Weber // FIXME: This could have a better diag. 32bb1ea2d6SNemanja Ivanovic int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}} 33bb1ea2d6SNemanja Ivanovic return x + *y; 3408ef80f4SNico Weber } 3508ef80f4SNico Weber 3608ef80f4SNico Weber #else 37bb1ea2d6SNemanja Ivanovic __float128 f; // expected-error {{__float128 is not supported on this target}} 3808ef80f4SNico Weber template<typename> struct __is_floating_point_helper {}; 39bb1ea2d6SNemanja Ivanovic template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}} 4008ef80f4SNico Weber 41bb1ea2d6SNemanja Ivanovic int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}} 42bb1ea2d6SNemanja Ivanovic return x + *y; 4308ef80f4SNico Weber } 4408ef80f4SNico Weber 4508ef80f4SNico Weber #endif 46bb1ea2d6SNemanja Ivanovic #endif 47