]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Sema/128bitfloat.cc
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / Sema / 128bitfloat.cc
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
3
4 #if !defined(__STRICT_ANSI__)
5 __float128 f;  // expected-error {{support for type '__float128' is not yet implemented}}
6 // But this should work:
7 template<typename> struct __is_floating_point_helper {};
8 template<> struct __is_floating_point_helper<__float128> {};
9
10 // FIXME: This could have a better diag.
11 void g(int x, __float128 *y) {
12   x + *y;  // expected-error {{invalid operands to binary expression ('int' and '__float128')}}
13 }
14
15 #else
16 __float128 f;  // expected-error {{unknown type name '__float128'}}
17 template<typename> struct __is_floating_point_helper {};
18 template<> struct __is_floating_point_helper<__float128> {};  // expected-error {{use of undeclared identifier '__float128'}}
19
20 void g(int x, __float128 *y) {  // expected-error {{unknown type name '__float128'}}
21   x + *y;
22 }
23
24 #endif