about summary refs log tree commit diff
path: root/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff
blob: d11c07c4ba3013ddd44387a11c08ac5cbee39459 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
- // MIR for `otherwise_t4_unreachable_default_2` before UnreachableEnumBranching
+ // MIR for `otherwise_t4_unreachable_default_2` after UnreachableEnumBranching
  
  fn otherwise_t4_unreachable_default_2() -> () {
      let mut _0: ();
      let _1: &str;
      let mut _2: Test4;
      let mut _3: isize;
      let _4: &str;
      let _5: &str;
      let _6: &str;
      let _7: &str;
  
      bb0: {
          StorageLive(_1);
          StorageLive(_2);
          _2 = Test4::C;
          _3 = discriminant(_2);
-         switchInt(move _3) -> [0: bb2, 1: bb4, 2: bb3, otherwise: bb1];
+         switchInt(move _3) -> [0: bb2, 1: bb4, 2: bb3, 3: bb1, otherwise: bb8];
      }
  
      bb1: {
          StorageLive(_7);
          _7 = const "A(other)D";
          _1 = &(*_7);
          StorageDead(_7);
          goto -> bb7;
      }
  
      bb2: {
          switchInt(copy ((_2 as A).0: i32)) -> [1: bb6, 2: bb5, otherwise: bb1];
      }
  
      bb3: {
          StorageLive(_6);
          _6 = const "C";
          _1 = &(*_6);
          StorageDead(_6);
          goto -> bb7;
      }
  
      bb4: {
          StorageLive(_5);
          _5 = const "B(i32)";
          _1 = &(*_5);
          StorageDead(_5);
          goto -> bb7;
      }
  
      bb5: {
          StorageLive(_4);
          _4 = const "A(2)";
          _1 = &(*_4);
          StorageDead(_4);
          goto -> bb7;
      }
  
      bb6: {
          _1 = const "A(1)";
          goto -> bb7;
      }
  
      bb7: {
          StorageDead(_2);
          StorageDead(_1);
          _0 = const ();
          return;
+     }
+ 
+     bb8: {
+         unreachable;
      }
  }
  
  ALLOC0 (size: 9, align: 1) {
      41 28 6f 74 68 65 72 29 44                      │ A(other)D
  }
  
  ALLOC1 (size: 4, align: 1) {
      41 28 32 29                                     │ A(2)
  }
  
  ALLOC2 (size: 4, align: 1) {
      41 28 31 29                                     │ A(1)
  }
  
  ALLOC3 (size: 6, align: 1) {
      42 28 69 33 32 29                               │ B(i32)
  }
  
  ALLOC4 (size: 1, align: 1) {
      43                                              │ C
  }