2020-04-27 17:57:58 -05:00
|
|
|
- // MIR for `main` before ConstProp
|
|
|
|
+ // MIR for `main` after ConstProp
|
|
|
|
|
|
|
|
fn main() -> () {
|
2022-07-27 13:47:42 -05:00
|
|
|
let mut _0: (); // return place in scope 0 at $DIR/bad_op_div_by_zero.rs:+0:11: +0:11
|
|
|
|
let _1: i32; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+1:9: +1:10
|
|
|
|
let mut _3: i32; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
|
|
|
|
let mut _4: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
|
|
|
let mut _5: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
|
|
|
let mut _6: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
|
|
|
let mut _7: bool; // in scope 0 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
2020-04-27 17:57:58 -05:00
|
|
|
scope 1 {
|
2022-07-27 13:47:42 -05:00
|
|
|
debug y => _1; // in scope 1 at $DIR/bad_op_div_by_zero.rs:+1:9: +1:10
|
|
|
|
let _2: i32; // in scope 1 at $DIR/bad_op_div_by_zero.rs:+2:9: +2:11
|
2020-04-27 17:57:58 -05:00
|
|
|
scope 2 {
|
2022-07-27 13:47:42 -05:00
|
|
|
debug _z => _2; // in scope 2 at $DIR/bad_op_div_by_zero.rs:+2:9: +2:11
|
2020-04-27 17:57:58 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2022-07-27 13:47:42 -05:00
|
|
|
StorageLive(_1); // scope 0 at $DIR/bad_op_div_by_zero.rs:+1:9: +1:10
|
|
|
|
_1 = const 0_i32; // scope 0 at $DIR/bad_op_div_by_zero.rs:+1:13: +1:14
|
|
|
|
StorageLive(_2); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:9: +2:11
|
|
|
|
StorageLive(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
|
|
|
|
- _3 = _1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
|
|
|
|
- _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
|
|
|
+ _3 = const 0_i32; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
|
|
|
|
+ _4 = const true; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
2022-07-26 12:04:27 -05:00
|
|
|
assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
2020-04-27 17:57:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2022-07-27 13:47:42 -05:00
|
|
|
- _5 = Eq(_3, const -1_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
|
|
|
- _6 = Eq(const 1_i32, const i32::MIN); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
|
|
|
- _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
|
|
|
- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
|
|
|
+ _5 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
|
|
|
+ _6 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
|
|
|
+ _7 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
2022-07-26 12:04:27 -05:00
|
|
|
+ assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
2020-04-27 17:57:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2022-07-26 12:04:27 -05:00
|
|
|
_2 = Div(const 1_i32, move _3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
|
2022-07-27 13:47:42 -05:00
|
|
|
StorageDead(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
|
2022-07-26 12:04:27 -05:00
|
|
|
_0 = const (); // scope 0 at $DIR/bad_op_div_by_zero.rs:+0:11: +3:2
|
2022-07-27 13:47:42 -05:00
|
|
|
StorageDead(_2); // scope 1 at $DIR/bad_op_div_by_zero.rs:+3:1: +3:2
|
|
|
|
StorageDead(_1); // scope 0 at $DIR/bad_op_div_by_zero.rs:+3:1: +3:2
|
|
|
|
return; // scope 0 at $DIR/bad_op_div_by_zero.rs:+3:2: +3:2
|
2020-04-27 17:57:58 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|