Skip to content

Commit 313f04f

Browse files
author
icedrocket
committed
Add regression test for rust-lang#105626
1 parent 41ff6a8 commit 313f04f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Diff for: tests/ui/numbers-arithmetic/issue-105626.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// run-pass
2+
// only-x86
3+
// min-system-llvm-version: 16
4+
// compile-flags: -Ctarget-feature=+sse2
5+
6+
use std::hint::black_box;
7+
8+
fn main() {
9+
let n: i64 = black_box(0x3fffffdfffffff);
10+
let r = f32::from_bits(0x5a7fffff);
11+
12+
assert_ne!((n as f64) as f32, n as f32);
13+
14+
// FIXME: these assertions fail if only x87 is enabled
15+
assert_eq!(n as i64 as f32, r);
16+
assert_eq!(n as u64 as f32, r);
17+
}

0 commit comments

Comments
 (0)