diff options
| author | Rezwan ahmed sami <samiahmed0f0@gmail.com> | 2024-08-18 11:12:40 +0600 |
|---|---|---|
| committer | Rezwan ahmed sami <samiahmed0f0@gmail.com> | 2024-08-18 11:12:40 +0600 |
| commit | 9f39427228d09d7a06b9dd55a4f52b4b9ac15817 (patch) | |
| tree | 797957e079de1e64f5f3da90189284580f7f9562 | |
| parent | 803cbaf5fb5021eafaa60578ed33d708370ba3c0 (diff) | |
| download | rust-9f39427228d09d7a06b9dd55a4f52b4b9ac15817.tar.gz rust-9f39427228d09d7a06b9dd55a4f52b4b9ac15817.zip | |
Added #[cfg(target_arch = x86_64)] to f16 and f128
| -rw-r--r-- | tests/ui/consts/const-float-bits-conv.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/ui/consts/const-float-bits-conv.rs b/tests/ui/consts/const-float-bits-conv.rs index 2c4df96562a..3a526c54dc3 100644 --- a/tests/ui/consts/const-float-bits-conv.rs +++ b/tests/ui/consts/const-float-bits-conv.rs @@ -29,6 +29,7 @@ fn has_broken_floats() -> bool { std::env::var("TARGET").is_ok_and(|v| v.contains("i586")) } +#[cfg(target_arch = "x86_64")] fn f16(){ const_assert!((1f16).to_bits(), 0x3c00); const_assert!(u16::from_be_bytes(1f16.to_be_bytes()), 0x3c00); @@ -119,6 +120,7 @@ fn f64() { } } +#[cfg(target_arch = "x86_64")] fn f128() { const_assert!((1f128).to_bits(), 0x3fff0000000000000000000000000000); const_assert!(u128::from_be_bytes(1f128.to_be_bytes()), 0x3fff0000000000000000000000000000); @@ -150,8 +152,11 @@ fn f128() { } fn main() { - f16(); + #[cfg(target_arch = "x86_64")] + { + f16(); + f128(); + } f32(); f64(); - f128(); } |
