rust/tests/mir-opt/issue_41110.test.ElaborateD...

100 lines
2.1 KiB
Diff

- // MIR for `test` before ElaborateDrops
+ // MIR for `test` after ElaborateDrops
fn test() -> () {
let mut _0: ();
let _1: S;
let _3: ();
let mut _4: S;
let mut _5: S;
+ let mut _6: bool;
scope 1 {
debug u => _1;
let mut _2: S;
scope 2 {
debug v => _2;
}
}
bb0: {
+ _6 = const false;
StorageLive(_1);
+ _6 = const true;
_1 = S;
StorageLive(_2);
_2 = S;
StorageLive(_3);
StorageLive(_4);
_4 = move _2;
_3 = std::mem::drop::<S>(move _4) -> [return: bb1, unwind: bb7];
}
bb1: {
StorageDead(_4);
StorageDead(_3);
StorageLive(_5);
+ _6 = const false;
_5 = move _1;
- drop(_2) -> [return: bb2, unwind: bb3];
+ goto -> bb2;
}
bb2: {
_2 = move _5;
- drop(_5) -> [return: bb4, unwind: bb8];
+ goto -> bb4;
}
bb3 (cleanup): {
_2 = move _5;
- drop(_5) -> [return: bb8, unwind terminate(cleanup)];
+ goto -> bb8;
}
bb4: {
StorageDead(_5);
_0 = const ();
drop(_2) -> [return: bb5, unwind: bb9];
}
bb5: {
StorageDead(_2);
- drop(_1) -> [return: bb6, unwind: bb10];
+ goto -> bb6;
}
bb6: {
+ _6 = const false;
StorageDead(_1);
return;
}
bb7 (cleanup): {
- drop(_4) -> [return: bb8, unwind terminate(cleanup)];
+ goto -> bb8;
}
bb8 (cleanup): {
- drop(_2) -> [return: bb9, unwind terminate(cleanup)];
+ goto -> bb9;
}
bb9 (cleanup): {
- drop(_1) -> [return: bb10, unwind terminate(cleanup)];
+ goto -> bb12;
}
bb10 (cleanup): {
resume;
+ }
+
+ bb11 (cleanup): {
+ drop(_1) -> [return: bb10, unwind terminate(cleanup)];
+ }
+
+ bb12 (cleanup): {
+ switchInt(copy _6) -> [0: bb10, otherwise: bb11];
}
}