rust/tests/ui/const_prop/apfloat-f64-roundtrip.rs

10 lines
298 B
Rust
Raw Normal View History

2023-07-07 05:50:07 -05:00
// run-pass
// compile-flags: -O -Zmir-opt-level=3 -Cno-prepopulate-passes
// min-llvm-version: 16.0 (requires APFloat fixes in LLVM)
// Regression test for a broken MIR optimization (issue #113407).
pub fn main() {
let f = f64::from_bits(0x19873cc2) as f32;
assert_eq!(f.to_bits(), 0);
}