]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff
Rollup merge of #107559 - WaffleLapkin:is_it_2015¿, r=davidtwco
[rust.git] / tests / mir-opt / const_prop / bad_op_mod_by_zero.main.ConstProp.diff
1 - // MIR for `main` before ConstProp
2 + // MIR for `main` after ConstProp
3   
4   fn main() -> () {
5       let mut _0: ();                      // return place in scope 0 at $DIR/bad_op_mod_by_zero.rs:+0:11: +0:11
6       let _1: i32;                         // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+1:9: +1:10
7       let mut _3: i32;                     // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:18: +2:19
8       let mut _4: bool;                    // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
9       let mut _5: bool;                    // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
10       let mut _6: bool;                    // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
11       let mut _7: bool;                    // in scope 0 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
12       scope 1 {
13           debug y => _1;                   // in scope 1 at $DIR/bad_op_mod_by_zero.rs:+1:9: +1:10
14           let _2: i32;                     // in scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:9: +2:11
15           scope 2 {
16               debug _z => _2;              // in scope 2 at $DIR/bad_op_mod_by_zero.rs:+2:9: +2:11
17           }
18       }
19   
20       bb0: {
21           _1 = const 0_i32;                // scope 0 at $DIR/bad_op_mod_by_zero.rs:+1:13: +1:14
22           StorageLive(_2);                 // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:9: +2:11
23 -         _4 = Eq(_1, const 0_i32);        // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
24 -         assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
25 +         _4 = const true;                 // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
26 +         assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
27       }
28   
29       bb1: {
30           _5 = Eq(_1, const -1_i32);       // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
31 -         _6 = Eq(const 1_i32, const i32::MIN); // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
32 -         _7 = BitAnd(move _5, move _6);   // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
33 -         assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _1) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
34 +         _6 = const false;                // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
35 +         _7 = const false;                // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
36 +         assert(!const false, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _1) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
37       }
38   
39       bb2: {
40           _2 = Rem(const 1_i32, _1);       // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
41           StorageDead(_2);                 // scope 1 at $DIR/bad_op_mod_by_zero.rs:+3:1: +3:2
42           return;                          // scope 0 at $DIR/bad_op_mod_by_zero.rs:+3:2: +3:2
43       }
44   }
45