rust/tests/mir-opt/dest-prop/union.rs
2023-04-06 10:08:07 +01:00

18 lines
359 B
Rust

// ignore-wasm32 compiled with panic=abort by default
//! Tests that we can propagate into places that are projections into unions
// compile-flags: -Zunsound-mir-opts
fn val() -> u32 {
1
}
// EMIT_MIR union.main.DestinationPropagation.diff
fn main() {
union Un {
us: u32,
}
let un = Un { us: val() };
drop(unsafe { un.us });
}