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__)
94aa510beSserge-sans-paille
104aa510beSserge-sans-paille #if defined(__ppc__)
114aa510beSserge-sans-paille template <typename> struct __is_float128 { static constexpr bool value = false; };
124aa510beSserge-sans-paille template <> struct __is_float128<__float128> { static constexpr bool value = true; };
134aa510beSserge-sans-paille static_assert(__is_float128<__ieee128>::value, "__ieee128 aliases to __float128");
144aa510beSserge-sans-paille #endif
154aa510beSserge-sans-paille
16bb1ea2d6SNemanja Ivanovic __float128 f;
1708ef80f4SNico Weber template<typename> struct __is_floating_point_helper {};
18d7d45bf8SNemanja Ivanovic template<> struct __is_floating_point_helper<__float128> {};
g(int x,__float128 * y)19bb1ea2d6SNemanja Ivanovic int g(int x, __float128 *y) {
20bb1ea2d6SNemanja Ivanovic return x + *y;
21bb1ea2d6SNemanja Ivanovic }
22bb1ea2d6SNemanja Ivanovic
23*fae0dfa6SQiu Chaofan // expected-no-error {{__float128 is not supported on this target}}
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.
g(int x,__float128 * y)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
g(int x,__float128 * y)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*fae0dfa6SQiu Chaofan
48*fae0dfa6SQiu Chaofan #ifdef __ppc__
49*fae0dfa6SQiu Chaofan __ibm128 i;
50*fae0dfa6SQiu Chaofan template <> struct __is_floating_point_helper<__ibm128> {};
w(int x,__ibm128 * y)51*fae0dfa6SQiu Chaofan int w(int x, __ibm128 *y) {
52*fae0dfa6SQiu Chaofan return x + *y;
53*fae0dfa6SQiu Chaofan }
54*fae0dfa6SQiu Chaofan // expected-no-error {{__ibm128 is not supported on this target}}
55*fae0dfa6SQiu Chaofan #else
56*fae0dfa6SQiu Chaofan __ibm128 i; // expected-error {{__ibm128 is not supported on this target}}
57*fae0dfa6SQiu Chaofan template <> struct __is_floating_point_helper<__ibm128> {}; // expected-error {{__ibm128 is not supported on this target}}
w(int x,__ibm128 * y)58*fae0dfa6SQiu Chaofan int w(int x, __ibm128 *y) { // expected-error {{__ibm128 is not supported on this target}}
59*fae0dfa6SQiu Chaofan return x + *y;
60*fae0dfa6SQiu Chaofan }
61*fae0dfa6SQiu Chaofan #endif
62