summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.panic-abort.diff
blob: 34163d4d84a79fd01d3cbd15ab0f33f27373f1b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
- // MIR for `main` before ConstProp
+ // MIR for `main` after ConstProp
  
  fn main() -> () {
      let mut _0: ();
      let _1: i32;
      let mut _3: i32;
      let mut _4: bool;
      let mut _5: bool;
      let mut _6: bool;
      let mut _7: bool;
      scope 1 {
          debug y => _1;
          let _2: i32;
          scope 2 {
              debug _z => _2;
          }
      }
  
      bb0: {
          StorageLive(_1);
          _1 = const 0_i32;
          StorageLive(_2);
          StorageLive(_3);
-         _3 = _1;
-         _4 = Eq(_3, const 0_i32);
-         assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind unreachable];
+         _3 = const 0_i32;
+         _4 = const true;
+         assert(!const true, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind unreachable];
      }
  
      bb1: {
-         _5 = Eq(_3, const -1_i32);
-         _6 = Eq(const 1_i32, const i32::MIN);
-         _7 = BitAnd(move _5, move _6);
-         assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable];
+         _5 = const false;
+         _6 = const false;
+         _7 = const false;
+         assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable];
      }
  
      bb2: {
          _2 = Div(const 1_i32, move _3);
          StorageDead(_3);
          _0 = const ();
          StorageDead(_2);
          StorageDead(_1);
          return;
      }
  }