2017-05-27 01:38:15 +08:00
|
|
|
// RUN: %clang_cc1 -verify -std=gnu++11 %s
|
|
|
|
// RUN: %clang_cc1 -verify -std=c++11 %s
|
|
|
|
// RUN: %clang_cc1 -triple powerpc64-linux -verify -std=c++11 %s
|
|
|
|
// RUN: %clang_cc1 -triple i686-windows-gnu -verify -std=c++11 %s
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-windows-gnu -verify -std=c++11 %s
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-windows-msvc -verify -std=c++11 %s
|
2013-06-21 05:44:55 +08:00
|
|
|
|
2017-05-27 01:38:15 +08:00
|
|
|
#if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__)
|
2016-05-09 16:52:33 +08:00
|
|
|
__float128 f;
|
|
|
|
template<typename> struct __is_floating_point_helper {};
|
|
|
|
template<> struct __is_floating_point_helper<__float128> {};
|
|
|
|
int g(int x, __float128 *y) {
|
|
|
|
return x + *y;
|
|
|
|
}
|
|
|
|
|
|
|
|
// expected-no-diagnostics
|
|
|
|
#else
|
2013-06-21 05:44:55 +08:00
|
|
|
#if !defined(__STRICT_ANSI__)
|
2016-05-09 16:52:33 +08:00
|
|
|
__float128 f; // expected-error {{__float128 is not supported on this target}}
|
2013-06-21 05:44:55 +08:00
|
|
|
// But this should work:
|
|
|
|
template<typename> struct __is_floating_point_helper {};
|
2016-05-09 16:52:33 +08:00
|
|
|
template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}}
|
2013-06-21 07:30:30 +08:00
|
|
|
|
|
|
|
// FIXME: This could have a better diag.
|
2016-05-09 16:52:33 +08:00
|
|
|
int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}}
|
|
|
|
return x + *y;
|
2013-06-21 07:30:30 +08:00
|
|
|
}
|
|
|
|
|
2013-06-21 05:44:55 +08:00
|
|
|
#else
|
2016-05-09 16:52:33 +08:00
|
|
|
__float128 f; // expected-error {{__float128 is not supported on this target}}
|
2013-06-21 05:44:55 +08:00
|
|
|
template<typename> struct __is_floating_point_helper {};
|
2016-05-09 16:52:33 +08:00
|
|
|
template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}}
|
2013-06-21 07:30:30 +08:00
|
|
|
|
2016-05-09 16:52:33 +08:00
|
|
|
int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}}
|
|
|
|
return x + *y;
|
2013-06-21 07:30:30 +08:00
|
|
|
}
|
|
|
|
|
2013-06-21 05:44:55 +08:00
|
|
|
#endif
|
2016-05-09 16:52:33 +08:00
|
|
|
#endif
|