rust/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff

46 lines
1.2 KiB
Diff
Raw Normal View History

2023-09-20 21:43:33 +00:00
- // MIR for `main` before GVN
+ // MIR for `main` after GVN
2023-02-08 20:28:39 +00:00
fn main() -> () {
2023-06-06 09:47:00 -04:00
let mut _0: ();
let mut _1: u8;
let mut _2: u8;
let mut _3: u8;
2023-02-08 20:28:39 +00:00
scope 1 {
}
2023-11-24 00:54:06 +08:00
scope 2 (inlined #[track_caller] <u8 as Add>::add) {
2023-06-06 09:47:00 -04:00
debug self => _2;
debug other => _3;
let mut _4: (u8, bool);
2023-02-08 20:28:39 +00:00
}
bb0: {
2023-06-06 09:47:00 -04:00
StorageLive(_1);
StorageLive(_2);
_2 = const u8::MAX;
StorageLive(_3);
_3 = const 1_u8;
2023-10-04 17:50:03 +00:00
StorageLive(_4);
2023-06-06 09:47:00 -04:00
- _4 = CheckedAdd(_2, _3);
2023-06-23 17:53:09 +01:00
- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind continue];
2023-06-06 09:47:00 -04:00
+ _4 = const (0_u8, true);
2023-02-07 19:24:21 +00:00
+ assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind continue];
2023-02-08 20:28:39 +00:00
}
bb1: {
2023-06-06 09:47:00 -04:00
- _1 = move (_4.0: u8);
+ _1 = const 0_u8;
2023-10-04 17:50:03 +00:00
StorageDead(_4);
2023-06-06 09:47:00 -04:00
StorageDead(_3);
StorageDead(_2);
StorageDead(_1);
_0 = const ();
return;
2023-02-08 20:28:39 +00:00
}
2023-09-12 11:33:58 +02:00
+ }
+
2023-10-15 17:00:11 +00:00
+ ALLOC0 (size: 2, align: 1) {
2023-09-12 11:33:58 +02:00
+ 00 01 │ ..
2023-02-08 20:28:39 +00:00
}