diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-unwind.mir | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-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/box_expr.main.ElaborateDrops.before.panic-unwind.mir')
-rw-r--r-- | tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-unwind.mir | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-unwind.mir b/tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-unwind.mir new file mode 100644 index 000000000..a72d22a9c --- /dev/null +++ b/tests/mir-opt/box_expr.main.ElaborateDrops.before.panic-unwind.mir @@ -0,0 +1,71 @@ +// MIR for `main` before ElaborateDrops + +fn main() -> () { + let mut _0: (); + let _1: std::boxed::Box<S>; + let mut _2: usize; + let mut _3: usize; + let mut _4: *mut u8; + let mut _5: std::boxed::Box<S>; + let _6: (); + let mut _7: std::boxed::Box<S>; + scope 1 { + debug x => _1; + } + scope 2 { + } + + bb0: { + StorageLive(_1); + _2 = SizeOf(S); + _3 = AlignOf(S); + _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> [return: bb1, unwind continue]; + } + + bb1: { + StorageLive(_5); + _5 = ShallowInitBox(move _4, S); + (*_5) = S::new() -> [return: bb2, unwind: bb8]; + } + + bb2: { + _1 = move _5; + drop(_5) -> [return: bb3, unwind continue]; + } + + bb3: { + StorageDead(_5); + StorageLive(_6); + StorageLive(_7); + _7 = move _1; + _6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6]; + } + + bb4: { + StorageDead(_7); + StorageDead(_6); + _0 = const (); + drop(_1) -> [return: bb5, unwind continue]; + } + + bb5: { + StorageDead(_1); + return; + } + + bb6 (cleanup): { + drop(_7) -> [return: bb7, unwind terminate]; + } + + bb7 (cleanup): { + drop(_1) -> [return: bb9, unwind terminate]; + } + + bb8 (cleanup): { + drop(_5) -> [return: bb9, unwind terminate]; + } + + bb9 (cleanup): { + resume; + } +} |