| 1 |
// P1467R9 - Extended floating-point types and standard names. |
| 2 |
// { dg-do compile { target c++23 } } |
| 3 |
// { dg-options "" } |
| 4 |
|
| 5 |
#include "ext-floating.h" |
| 6 |
|
| 7 |
#ifdef __STRICT_ANSI__ |
| 8 |
#undef __SIZEOF_FLOAT128__ |
| 9 |
#endif |
| 10 |
|
| 11 |
using namespace std; |
| 12 |
|
| 13 |
float foo (float x, float y, float z) { return x * y + z; } |
| 14 |
double foo (double x, double y, double z) { return x * y + z; } |
| 15 |
long double foo (long double x, long double y, long double z) { return x * y + z; } |
| 16 |
#ifdef __STDCPP_FLOAT16_T__ |
| 17 |
float16_t foo (float16_t x, float16_t y, float16_t z) { return x * y + z; } |
| 18 |
#endif |
| 19 |
#ifdef __STDCPP_FLOAT32_T__ |
| 20 |
float32_t foo (float32_t x, float32_t y, float32_t z) { return x * y + z; } |
| 21 |
#endif |
| 22 |
#ifdef __STDCPP_FLOAT64_T__ |
| 23 |
float64_t foo (float64_t x, float64_t y, float64_t z) { return x * y + z; } |
| 24 |
#endif |
| 25 |
#ifdef __STDCPP_FLOAT128_T__ |
| 26 |
float128_t foo (float128_t x, float128_t y, float128_t z) { return x * y + z; } |
| 27 |
#endif |
| 28 |
#ifdef __STDCPP_BFLOAT16_T__ |
| 29 |
bfloat16_t foo (bfloat16_t x, bfloat16_t y, bfloat16_t z) { return x * y + z; } |
| 30 |
#endif |