about summary refs log tree commit diff
path: root/tests/mir-opt/read_from_trivial_switch.main.SimplifyCfg-initial.diff
blob: 87758408a1c37722113a5f8872caec55e8bcc312 (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
- // MIR for `main` before SimplifyCfg-initial
+ // MIR for `main` after SimplifyCfg-initial
  
  fn main() -> () {
      let mut _0: ();
      let _1: &i32;
      let _2: i32;
      scope 1 {
          debug ref_ => _1;
          scope 2 {
          }
      }
  
      bb0: {
          StorageLive(_1);
          StorageLive(_2);
          _2 = const 1_i32;
          _1 = &_2;
          FakeRead(ForLet(None), _1);
          PlaceMention(_1);
-         switchInt(copy (*_1)) -> [0: bb2, otherwise: bb1];
+         switchInt(copy (*_1)) -> [0: bb1, otherwise: bb1];
      }
  
      bb1: {
-         goto -> bb5;
-     }
- 
-     bb2: {
-         goto -> bb5;
-     }
- 
-     bb3: {
-         goto -> bb1;
-     }
- 
-     bb4: {
-         FakeRead(ForMatchedPlace(None), _1);
-         unreachable;
-     }
- 
-     bb5: {
          _0 = const ();
          StorageDead(_2);
          StorageDead(_1);
          return;
      }
  }