Skip to content

Commit 9f39427

Browse files
Added #[cfg(target_arch = x86_64)] to f16 and f128
1 parent 803cbaf commit 9f39427

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/ui/consts/const-float-bits-conv.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ fn has_broken_floats() -> bool {
2929
std::env::var("TARGET").is_ok_and(|v| v.contains("i586"))
3030
}
3131

32+
#[cfg(target_arch = "x86_64")]
3233
fn f16(){
3334
const_assert!((1f16).to_bits(), 0x3c00);
3435
const_assert!(u16::from_be_bytes(1f16.to_be_bytes()), 0x3c00);
@@ -119,6 +120,7 @@ fn f64() {
119120
}
120121
}
121122

123+
#[cfg(target_arch = "x86_64")]
122124
fn f128() {
123125
const_assert!((1f128).to_bits(), 0x3fff0000000000000000000000000000);
124126
const_assert!(u128::from_be_bytes(1f128.to_be_bytes()), 0x3fff0000000000000000000000000000);
@@ -150,8 +152,11 @@ fn f128() {
150152
}
151153

152154
fn main() {
153-
f16();
155+
#[cfg(target_arch = "x86_64")]
156+
{
157+
f16();
158+
f128();
159+
}
154160
f32();
155161
f64();
156-
f128();
157162
}

0 commit comments

Comments
 (0)