summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff
blob: 60ce9cd8ad9d97b5353fc87f7249564c1fef6677 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
- // MIR for `main` before ElaborateDrops
+ // MIR for `main` after ElaborateDrops
  
  fn main() -> () {
      let mut _0: ();
      let _1: E;
      let mut _2: bool;
      let mut _3: E;
      let mut _4: K;
      let mut _5: isize;
+     let mut _7: bool;
+     let mut _8: bool;
+     let mut _9: bool;
+     let mut _10: isize;
+     let mut _11: isize;
      scope 1 {
          debug e => _1;
          scope 2 {
              debug _k => _6;
              let _6: K;
          }
      }
  
      bb0: {
+         _7 = const false;
+         _8 = const false;
+         _9 = const false;
          StorageLive(_1);
          StorageLive(_2);
          _2 = cond() -> [return: bb1, unwind: bb11];
      }
  
      bb1: {
          switchInt(move _2) -> [0: bb8, otherwise: bb2];
      }
  
      bb2: {
          StorageLive(_3);
          StorageLive(_4);
          _4 = K;
          _3 = E::F(move _4);
          StorageDead(_4);
-         drop(_1) -> [return: bb3, unwind: bb4];
+         goto -> bb3;
      }
  
      bb3: {
+         _7 = const true;
+         _8 = const true;
+         _9 = const true;
          _1 = move _3;
-         drop(_3) -> [return: bb5, unwind: bb11];
+         goto -> bb5;
      }
  
      bb4 (cleanup): {
+         _7 = const true;
+         _8 = const true;
+         _9 = const true;
          _1 = move _3;
-         drop(_3) -> [return: bb11, unwind terminate];
+         goto -> bb11;
      }
  
      bb5: {
          StorageDead(_3);
          _5 = discriminant(_1);
          switchInt(move _5) -> [0: bb6, otherwise: bb7];
      }
  
      bb6: {
          StorageLive(_6);
+         _9 = const false;
          _6 = move ((_1 as F).0: K);
          _0 = const ();
          StorageDead(_6);
          goto -> bb9;
      }
  
      bb7: {
          _0 = const ();
          goto -> bb9;
      }
  
      bb8: {
          _0 = const ();
          goto -> bb9;
      }
  
      bb9: {
          StorageDead(_2);
-         drop(_1) -> [return: bb10, unwind continue];
+         goto -> bb18;
      }
  
      bb10: {
+         _7 = const false;
+         _8 = const false;
+         _9 = const false;
          StorageDead(_1);
          return;
      }
  
      bb11 (cleanup): {
-         drop(_1) -> [return: bb12, unwind terminate];
+         goto -> bb12;
      }
  
      bb12 (cleanup): {
          resume;
+     }
+ 
+     bb13: {
+         _7 = const false;
+         goto -> bb10;
+     }
+ 
+     bb14 (cleanup): {
+         goto -> bb12;
+     }
+ 
+     bb15: {
+         drop(_1) -> [return: bb13, unwind: bb12];
+     }
+ 
+     bb16 (cleanup): {
+         drop(_1) -> [return: bb12, unwind terminate];
+     }
+ 
+     bb17: {
+         _10 = discriminant(_1);
+         switchInt(move _10) -> [0: bb13, otherwise: bb15];
+     }
+ 
+     bb18: {
+         switchInt(_7) -> [0: bb13, otherwise: bb17];
+     }
+ 
+     bb19 (cleanup): {
+         _11 = discriminant(_1);
+         switchInt(move _11) -> [0: bb14, otherwise: bb16];
+     }
+ 
+     bb20 (cleanup): {
+         switchInt(_7) -> [0: bb12, otherwise: bb19];
      }
  }