rust/tests/mir-opt/const_prop/transmute.undef_union_as_integer.ConstProp.diff
Scott McMurray 64cce5fc7d Add CastKind::Transmute to MIR
Updates `interpret`, `codegen_ssa`, and `codegen_cranelift` to consume the new cast instead of the intrinsic.

Includes `CastTransmute` for custom MIR building, to be able to test the extra UB.
2023-03-22 15:15:41 -07:00

23 lines
1.2 KiB
Diff

- // MIR for `undef_union_as_integer` before ConstProp
+ // MIR for `undef_union_as_integer` after ConstProp
fn undef_union_as_integer() -> u32 {
let mut _0: u32; // return place in scope 0 at $DIR/transmute.rs:+0:43: +0:46
let mut _1: undef_union_as_integer::Union32; // in scope 0 at $DIR/transmute.rs:+2:24: +2:44
let mut _2: (); // in scope 0 at $DIR/transmute.rs:+2:40: +2:42
scope 1 {
}
bb0: {
StorageLive(_1); // scope 1 at $DIR/transmute.rs:+2:24: +2:44
StorageLive(_2); // scope 1 at $DIR/transmute.rs:+2:40: +2:42
_2 = (); // scope 1 at $DIR/transmute.rs:+2:40: +2:42
_1 = Union32 { value: move _2 }; // scope 1 at $DIR/transmute.rs:+2:24: +2:44
StorageDead(_2); // scope 1 at $DIR/transmute.rs:+2:43: +2:44
_0 = move _1 as u32 (Transmute); // scope 1 at $DIR/transmute.rs:+2:14: +2:45
StorageDead(_1); // scope 1 at $DIR/transmute.rs:+2:44: +2:45
return; // scope 0 at $DIR/transmute.rs:+3:2: +3:2
}
}