1*9eabbb60SReid Kleckner // RUN: %clang_cc1 -verify -std=gnu++11 %s
2*9eabbb60SReid Kleckner // RUN: %clang_cc1 -verify -std=c++11 %s
3*9eabbb60SReid Kleckner // RUN: %clang_cc1 -triple powerpc64-linux -verify -std=c++11 %s
4*9eabbb60SReid Kleckner // RUN: %clang_cc1 -triple i686-windows-gnu -verify -std=c++11 %s
5*9eabbb60SReid Kleckner // RUN: %clang_cc1 -triple x86_64-windows-gnu -verify -std=c++11 %s
6*9eabbb60SReid Kleckner // RUN: %clang_cc1 -triple x86_64-windows-msvc -verify -std=c++11 %s
708ef80f4SNico Weber 
8*9eabbb60SReid Kleckner #if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__)
9bb1ea2d6SNemanja Ivanovic __float128 f;
1008ef80f4SNico Weber template<typename> struct __is_floating_point_helper {};
11d7d45bf8SNemanja Ivanovic template<> struct __is_floating_point_helper<__float128> {};
12bb1ea2d6SNemanja Ivanovic int g(int x, __float128 *y) {
13bb1ea2d6SNemanja Ivanovic   return x + *y;
14bb1ea2d6SNemanja Ivanovic }
15bb1ea2d6SNemanja Ivanovic 
16bb1ea2d6SNemanja Ivanovic // expected-no-diagnostics
17bb1ea2d6SNemanja Ivanovic #else
18bb1ea2d6SNemanja Ivanovic #if !defined(__STRICT_ANSI__)
19bb1ea2d6SNemanja Ivanovic __float128 f;  // expected-error {{__float128 is not supported on this target}}
20bb1ea2d6SNemanja Ivanovic // But this should work:
21bb1ea2d6SNemanja Ivanovic template<typename> struct __is_floating_point_helper {};
22bb1ea2d6SNemanja Ivanovic template<> struct __is_floating_point_helper<__float128> {};  // expected-error {{__float128 is not supported on this target}}
2308ef80f4SNico Weber 
2408ef80f4SNico Weber // FIXME: This could have a better diag.
25bb1ea2d6SNemanja Ivanovic int g(int x, __float128 *y) {  // expected-error {{__float128 is not supported on this target}}
26bb1ea2d6SNemanja Ivanovic   return x + *y;
2708ef80f4SNico Weber }
2808ef80f4SNico Weber 
2908ef80f4SNico Weber #else
30bb1ea2d6SNemanja Ivanovic __float128 f;  // expected-error {{__float128 is not supported on this target}}
3108ef80f4SNico Weber template<typename> struct __is_floating_point_helper {};
32bb1ea2d6SNemanja Ivanovic template<> struct __is_floating_point_helper<__float128> {};  // expected-error {{__float128 is not supported on this target}}
3308ef80f4SNico Weber 
34bb1ea2d6SNemanja Ivanovic int g(int x, __float128 *y) {  // expected-error {{__float128 is not supported on this target}}
35bb1ea2d6SNemanja Ivanovic   return x + *y;
3608ef80f4SNico Weber }
3708ef80f4SNico Weber 
3808ef80f4SNico Weber #endif
39bb1ea2d6SNemanja Ivanovic #endif
40