rust/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff
2024-05-17 20:33:02 -07:00

44 lines
1.2 KiB
Diff

- // MIR for `main` before GVN
+ // MIR for `main` after GVN
fn main() -> () {
let mut _0: ();
let mut _1: u8;
let mut _2: u8;
let mut _3: u8;
scope 1 {
}
scope 2 (inlined #[track_caller] <u8 as Add>::add) {
let mut _4: (u8, bool);
}
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = const u8::MAX;
StorageLive(_3);
_3 = const 1_u8;
StorageLive(_4);
- _4 = AddWithOverflow(_2, _3);
- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable];
+ _4 = const (0_u8, true);
+ assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind unreachable];
}
bb1: {
- _1 = move (_4.0: u8);
+ _1 = const 0_u8;
StorageDead(_4);
StorageDead(_3);
StorageDead(_2);
StorageDead(_1);
_0 = const ();
return;
}
+ }
+
+ ALLOC0 (size: 2, align: 1) {
+ 00 01 │ ..
}