diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
commit | 2b6b257f4e5503a7a2675bdb8735693db769f75c (patch) | |
tree | e85e046ae7003fe3bcc8b5454cd0fa3f7407b470 /test/Sema/128bitfloat.cpp | |
parent | b4348ed0b7e90c0831b925fbee00b5f179a99796 (diff) |
Notes
Diffstat (limited to 'test/Sema/128bitfloat.cpp')
-rw-r--r-- | test/Sema/128bitfloat.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/test/Sema/128bitfloat.cpp b/test/Sema/128bitfloat.cpp index cb76dac96001d..2449cb6b6596f 100644 --- a/test/Sema/128bitfloat.cpp +++ b/test/Sema/128bitfloat.cpp @@ -1,24 +1,35 @@ // RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s +#ifdef __FLOAT128__ +__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 #if !defined(__STRICT_ANSI__) -__float128 f; // expected-error {{support for type '__float128' is not yet implemented}} +__float128 f; // expected-error {{__float128 is not supported on this target}} // But this should work: template<typename> struct __is_floating_point_helper {}; -template<> struct __is_floating_point_helper<__float128> {}; +template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}} // FIXME: This could have a better diag. -void g(int x, __float128 *y) { - x + *y; // expected-error {{invalid operands to binary expression ('int' and '__float128')}} +int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}} + return x + *y; } #else -__float128 f; // expected-error {{unknown type name '__float128'}} +__float128 f; // expected-error {{__float128 is not supported on this target}} template<typename> struct __is_floating_point_helper {}; -template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{use of undeclared identifier '__float128'}} +template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}} -void g(int x, __float128 *y) { // expected-error {{unknown type name '__float128'}} - x + *y; +int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}} + return x + *y; } #endif +#endif |