annotate clang/test/Sema/128bitfloat.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -verify -std=gnu++11 %s
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -verify -std=c++11 %s
anatofuz
parents:
diff changeset
3 // RUN: %clang_cc1 -triple powerpc64-linux -verify -std=c++11 %s
anatofuz
parents:
diff changeset
4 // RUN: %clang_cc1 -triple i686-windows-gnu -verify -std=c++11 %s
anatofuz
parents:
diff changeset
5 // RUN: %clang_cc1 -triple x86_64-windows-gnu -verify -std=c++11 %s
anatofuz
parents:
diff changeset
6 // RUN: %clang_cc1 -triple x86_64-windows-msvc -verify -std=c++11 %s
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 #if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__)
anatofuz
parents:
diff changeset
9 __float128 f;
anatofuz
parents:
diff changeset
10 template<typename> struct __is_floating_point_helper {};
anatofuz
parents:
diff changeset
11 template<> struct __is_floating_point_helper<__float128> {};
anatofuz
parents:
diff changeset
12 int g(int x, __float128 *y) {
anatofuz
parents:
diff changeset
13 return x + *y;
anatofuz
parents:
diff changeset
14 }
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 // expected-no-diagnostics
anatofuz
parents:
diff changeset
17 #else
anatofuz
parents:
diff changeset
18 #if !defined(__STRICT_ANSI__)
anatofuz
parents:
diff changeset
19 __float128 f; // expected-error {{__float128 is not supported on this target}}
anatofuz
parents:
diff changeset
20 // But this should work:
anatofuz
parents:
diff changeset
21 template<typename> struct __is_floating_point_helper {};
anatofuz
parents:
diff changeset
22 template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}}
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 // FIXME: This could have a better diag.
anatofuz
parents:
diff changeset
25 int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}}
anatofuz
parents:
diff changeset
26 return x + *y;
anatofuz
parents:
diff changeset
27 }
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 #else
anatofuz
parents:
diff changeset
30 __float128 f; // expected-error {{__float128 is not supported on this target}}
anatofuz
parents:
diff changeset
31 template<typename> struct __is_floating_point_helper {};
anatofuz
parents:
diff changeset
32 template<> struct __is_floating_point_helper<__float128> {}; // expected-error {{__float128 is not supported on this target}}
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 int g(int x, __float128 *y) { // expected-error {{__float128 is not supported on this target}}
anatofuz
parents:
diff changeset
35 return x + *y;
anatofuz
parents:
diff changeset
36 }
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 #endif
anatofuz
parents:
diff changeset
39 #endif