rust/tests/mir-opt/const_prop/const_prop_fails_gracefully.rs
2023-04-06 10:08:07 +01:00

12 lines
271 B
Rust

// ignore-wasm32 compiled with panic=abort by default
// unit-test: ConstProp
#[inline(never)]
fn read(_: usize) { }
// EMIT_MIR const_prop_fails_gracefully.main.ConstProp.diff
fn main() {
const FOO: &i32 = &1;
let x = FOO as *const i32 as usize;
read(x);
}