| 1 |
// P1467R9 - Extended floating-point types and standard names. |
| 2 |
// { dg-do compile { target c++23 } } |
| 3 |
// { dg-options "-pedantic-errors -Wno-narrowing" } |
| 4 |
// { dg-add-options float16 } |
| 5 |
// { dg-add-options float32 } |
| 6 |
// { dg-add-options float64 } |
| 7 |
// { dg-add-options float128 } |
| 8 |
|
| 9 |
#include "ext-floating.h" |
| 10 |
|
| 11 |
#ifdef __STRICT_ANSI__ |
| 12 |
#undef __SIZEOF_FLOAT128__ |
| 13 |
#endif |
| 14 |
|
| 15 |
using namespace std; |
| 16 |
|
| 17 |
#ifdef __STDCPP_FLOAT16_T__ |
| 18 |
#ifdef __STDCPP_FLOAT32_T__ |
| 19 |
float16_t f16c = 1.0F32; // { dg-bogus "converting to 'std::float16_t' \\\{aka '_Float16'\\\} from '_Float32' with greater conversion rank" "" { target { float16 && float32 } } } |
| 20 |
#endif |
| 21 |
#ifdef __STDCPP_FLOAT64_T__ |
| 22 |
float16_t f16e = 1.0F64; // { dg-bogus "converting to 'std::float16_t' \\\{aka '_Float16'\\\} from '_Float64' with greater conversion rank" "" { target { float16 && float64 } } } |
| 23 |
#endif |
| 24 |
#ifdef __STDCPP_FLOAT128_T__ |
| 25 |
float16_t f16g = 1.0F128; // { dg-bogus "converting to 'std::float16_t' \\\{aka '_Float16'\\\} from '_Float128' with greater conversion rank" "" { target { float16 && float128 } } } |
| 26 |
#endif |
| 27 |
#endif |
| 28 |
#ifdef __STDCPP_FLOAT32_T__ |
| 29 |
#ifdef __STDCPP_FLOAT64_T__ |
| 30 |
float32_t f32e = 1.0F64; // { dg-bogus "converting to 'std::float32_t' \\\{aka '_Float32'\\\} from '_Float64' with greater conversion rank" "" { target { float32 && float64 } } } |
| 31 |
#endif |
| 32 |
#ifdef __STDCPP_FLOAT128_T__ |
| 33 |
float32_t f32g = 1.0F128; // { dg-bogus "converting to 'std::float32_t' \\\{aka '_Float32'\\\} from '_Float128' with greater conversion rank" "" { target { float32 && float128 } } } |
| 34 |
#endif |
| 35 |
#endif |
| 36 |
#ifdef __STDCPP_FLOAT64_T__ |
| 37 |
#ifdef __STDCPP_FLOAT128_T__ |
| 38 |
float64_t f64g = 1.0F128; // { dg-bogus "converting to 'std::float64_t' \\\{aka '_Float64'\\\} from '_Float128' with greater conversion rank" "" { target { float64 && float128 } } } |
| 39 |
#endif |
| 40 |
#endif |