summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir')
-rw-r--r--tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir113
1 files changed, 113 insertions, 0 deletions
diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir
new file mode 100644
index 000000000..7ecdc428e
--- /dev/null
+++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir
@@ -0,0 +1,113 @@
+// MIR for `test` before ElaborateDrops
+
+fn test() -> Option<Box<u32>> {
+ let mut _0: std::option::Option<std::boxed::Box<u32>>;
+ let mut _1: std::boxed::Box<u32>;
+ let mut _2: usize;
+ let mut _3: usize;
+ let mut _4: *mut u8;
+ let mut _5: std::boxed::Box<u32>;
+ let mut _6: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>;
+ let mut _7: std::option::Option<u32>;
+ let mut _8: isize;
+ let _9: std::option::Option<std::convert::Infallible>;
+ let mut _10: !;
+ let mut _11: std::option::Option<std::convert::Infallible>;
+ let _12: u32;
+ scope 1 {
+ }
+ scope 2 {
+ debug residual => _9;
+ scope 3 {
+ }
+ }
+ scope 4 {
+ debug val => _12;
+ scope 5 {
+ }
+ }
+
+ bb0: {
+ StorageLive(_1);
+ _2 = SizeOf(u32);
+ _3 = AlignOf(u32);
+ _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> [return: bb1, unwind continue];
+ }
+
+ bb1: {
+ StorageLive(_5);
+ _5 = ShallowInitBox(move _4, u32);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = Option::<u32>::None;
+ _6 = <Option<u32> as Try>::branch(move _7) -> [return: bb2, unwind: bb12];
+ }
+
+ bb2: {
+ StorageDead(_7);
+ _8 = discriminant(_6);
+ switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb4];
+ }
+
+ bb3: {
+ StorageLive(_12);
+ _12 = ((_6 as Continue).0: u32);
+ (*_5) = _12;
+ StorageDead(_12);
+ _1 = move _5;
+ drop(_5) -> [return: bb7, unwind: bb11];
+ }
+
+ bb4: {
+ unreachable;
+ }
+
+ bb5: {
+ StorageLive(_9);
+ _9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>);
+ StorageLive(_11);
+ _11 = _9;
+ _0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12];
+ }
+
+ bb6: {
+ StorageDead(_11);
+ StorageDead(_9);
+ drop(_5) -> [return: bb9, unwind continue];
+ }
+
+ bb7: {
+ StorageDead(_5);
+ _0 = Option::<Box<u32>>::Some(move _1);
+ drop(_1) -> [return: bb8, unwind continue];
+ }
+
+ bb8: {
+ StorageDead(_1);
+ StorageDead(_6);
+ goto -> bb10;
+ }
+
+ bb9: {
+ StorageDead(_5);
+ StorageDead(_1);
+ StorageDead(_6);
+ goto -> bb10;
+ }
+
+ bb10: {
+ return;
+ }
+
+ bb11 (cleanup): {
+ drop(_1) -> [return: bb13, unwind terminate];
+ }
+
+ bb12 (cleanup): {
+ drop(_5) -> [return: bb13, unwind terminate];
+ }
+
+ bb13 (cleanup): {
+ resume;
+ }
+}