1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
// P1467R9 - Extended floating-point types and standard names.
// { dg-do compile { target c++23 } }
// { dg-options "" }
#include "ext-floating.h"
#ifdef __STRICT_ANSI__
#undef __SIZEOF_FLOAT128__
#endif
extern "C" void abort ();
using namespace std;
template <typename T, typename U>
int
foo (T x, U y) noexcept
{
return 3;
}
int
main ()
{
if (foo (0.0f, 0.0f) != 3)
abort ();
if (foo (0.0, 0.0) != 3)
abort ();
if (foo (0.0L, 0.0L) != 3)
abort ();
#ifdef __STDCPP_FLOAT16_T__
if (foo (0.0f16, 0.0f16) != 3)
abort ();
if (foo (0.0f, 0.0f16) != 3)
abort ();
#endif
#ifdef __STDCPP_FLOAT32_T__
if (foo (0.0f32, 0.0f32) != 3)
abort ();
if (foo (0.0f, 0.0f32) != 3)
abort ();
#endif
#ifdef __STDCPP_FLOAT64_T__
if (foo (0.0f64, 0.0f64) != 3)
abort ();
if (foo (0.0, 0.0f64) != 3)
abort ();
#endif
#ifdef __STDCPP_FLOAT128_T__
if (foo (0.0f128, 0.0f128) != 3)
abort ();
if (foo (0.0L, 0.0f128) != 3)
abort ();
#endif
#ifdef __STDCPP_BFLOAT16_T__
if (foo (0.0bf16, 0.0bf16) != 3)
abort ();
if (foo (0.0f, 0.0bf16) != 3)
abort ();
#endif
#ifdef __FLT32X_MANT_DIG__
if (foo (0.0f32x, 0.0f32x) != 3)
abort ();
if (foo (0.0, 0.0f32x) != 3)
abort ();
#endif
#ifdef __FLT64X_MANT_DIG__
if (foo (0.0f64x, 0.0f64x) != 3)
abort ();
if (foo (0.0L, 0.0f64x) != 3)
abort ();
#endif
#ifdef __FLT128X_MANT_DIG__
if (foo (0.0f128x, 0.0f128x) != 3)
abort ();
if (foo (0.0L, 0.0f128x) != 3)
abort ();
#endif
}
|