108ef80f4SNico Weber // RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s
208ef80f4SNico Weber // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
308ef80f4SNico Weber 
4*bb1ea2d6SNemanja Ivanovic #ifdef __FLOAT128__
5*bb1ea2d6SNemanja Ivanovic __float128 f;
608ef80f4SNico Weber template<typename> struct __is_floating_point_helper {};
7d7d45bf8SNemanja Ivanovic template<> struct __is_floating_point_helper<__float128> {};
8*bb1ea2d6SNemanja Ivanovic int g(int x, __float128 *y) {
9*bb1ea2d6SNemanja Ivanovic   return x + *y;
10*bb1ea2d6SNemanja Ivanovic }
11*bb1ea2d6SNemanja Ivanovic 
12*bb1ea2d6SNemanja Ivanovic // expected-no-diagnostics
13*bb1ea2d6SNemanja Ivanovic #else
14*bb1ea2d6SNemanja Ivanovic #if !defined(__STRICT_ANSI__)
15*bb1ea2d6SNemanja Ivanovic __float128 f;  // expected-error {{__float128 is not supported on this target}}
16*bb1ea2d6SNemanja Ivanovic // But this should work:
17*bb1ea2d6SNemanja Ivanovic template<typename> struct __is_floating_point_helper {};
18*bb1ea2d6SNemanja Ivanovic template<> struct __is_floating_point_helper<__float128> {};  // expected-error {{__float128 is not supported on this target}}
1908ef80f4SNico Weber 
2008ef80f4SNico Weber // FIXME: This could have a better diag.
21*bb1ea2d6SNemanja Ivanovic int g(int x, __float128 *y) {  // expected-error {{__float128 is not supported on this target}}
22*bb1ea2d6SNemanja Ivanovic   return x + *y;
2308ef80f4SNico Weber }
2408ef80f4SNico Weber 
2508ef80f4SNico Weber #else
26*bb1ea2d6SNemanja Ivanovic __float128 f;  // expected-error {{__float128 is not supported on this target}}
2708ef80f4SNico Weber template<typename> struct __is_floating_point_helper {};
28*bb1ea2d6SNemanja Ivanovic template<> struct __is_floating_point_helper<__float128> {};  // expected-error {{__float128 is not supported on this target}}
2908ef80f4SNico Weber 
30*bb1ea2d6SNemanja Ivanovic int g(int x, __float128 *y) {  // expected-error {{__float128 is not supported on this target}}
31*bb1ea2d6SNemanja Ivanovic   return x + *y;
3208ef80f4SNico Weber }
3308ef80f4SNico Weber 
3408ef80f4SNico Weber #endif
35*bb1ea2d6SNemanja Ivanovic #endif
36