150
|
1 // RUN: %clang_cc1 -verify -std=gnu++11 %s
|
|
2 // RUN: %clang_cc1 -verify -std=c++11 %s
|
|
3 // RUN: %clang_cc1 -triple powerpc64-linux -verify -std=c++11 %s
|
|
4 // RUN: %clang_cc1 -triple i686-windows-gnu -verify -std=c++11 %s
|
|
5 // RUN: %clang_cc1 -triple x86_64-windows-gnu -verify -std=c++11 %s
|
|
6 // RUN: %clang_cc1 -triple x86_64-windows-msvc -verify -std=c++11 %s
|
|
7
|
|
8 #if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__)
|
207
|
9
|
|
10 #if defined(__ppc__)
|
|
11 template <typename> struct __is_float128 { static constexpr bool value = false; };
|
|
12 template <> struct __is_float128<__float128> { static constexpr bool value = true; };
|
|
13 static_assert(__is_float128<__ieee128>::value, "__ieee128 aliases to __float128");
|
|
14 #endif
|
|
15
|
150
|
16 __float128 f;
|
|
17 template<typename> struct __is_floating_point_helper {};
|
|
18 template<> struct __is_floating_point_helper<__float128> {};
|
|
19 int g(int x, __float128 *y) {
|
|
20 return x + *y;
|
|
21 }
|
|
22
|
|
23 // expected-no-diagnostics
|
|
24 #else
|
|
25 #if !defined(__STRICT_ANSI__)
|
|
26 __float128 f; // expected-error {{__float128 is not supported on this target}}
|
|
27 // But this should work:
|
|
28 template<typename> struct __is_floating_point_helper {};
|
|
29 template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}}
|
|
30
|
|
31 // FIXME: This could have a better diag.
|
|
32 int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}}
|
|
33 return x + *y;
|
|
34 }
|
|
35
|
|
36 #else
|
|
37 __float128 f; // expected-error {{__float128 is not supported on this target}}
|
|
38 template<typename> struct __is_floating_point_helper {};
|
|
39 template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}}
|
|
40
|
|
41 int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}}
|
|
42 return x + *y;
|
|
43 }
|
|
44
|
|
45 #endif
|
|
46 #endif
|