diff --git a/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String;42].AddMovesForPackedDrops.before.mir b/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String;42].AddMovesForPackedDrops.before.mir new file mode 100644 index 00000000000..197a93e99d3 --- /dev/null +++ b/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String;42].AddMovesForPackedDrops.before.mir @@ -0,0 +1,55 @@ +// MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops + +fn std::ptr::drop_in_place(_1: *mut [String; 42]) -> () { + let mut _0: (); + let mut _2: usize; + let mut _3: usize; + let mut _4: *mut std::string::String; + let mut _5: bool; + let mut _6: *mut std::string::String; + let mut _7: bool; + + bb0: { + goto -> bb8; + } + + bb1: { + return; + } + + bb2 (cleanup): { + resume; + } + + bb3 (cleanup): { + _4 = &raw mut (*_1)[_3]; + _3 = Add(move _3, const 1_usize); + drop((*_4)) -> [return: bb4, unwind terminate(cleanup)]; + } + + bb4 (cleanup): { + _5 = Eq(copy _3, copy _2); + switchInt(move _5) -> [0: bb3, otherwise: bb2]; + } + + bb5: { + _6 = &raw mut (*_1)[_3]; + _3 = Add(move _3, const 1_usize); + drop((*_6)) -> [return: bb6, unwind: bb4]; + } + + bb6: { + _7 = Eq(copy _3, copy _2); + switchInt(move _7) -> [0: bb5, otherwise: bb1]; + } + + bb7: { + _2 = Len((*_1)); + _3 = const 0_usize; + goto -> bb6; + } + + bb8: { + goto -> bb7; + } +} diff --git a/tests/mir-opt/slice_drop_shim.rs b/tests/mir-opt/slice_drop_shim.rs index c2f4c82ecc8..f34c34855a1 100644 --- a/tests/mir-opt/slice_drop_shim.rs +++ b/tests/mir-opt/slice_drop_shim.rs @@ -5,6 +5,8 @@ // if we use -Clink-dead-code. // EMIT_MIR core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir +// EMIT_MIR core.ptr-drop_in_place.[String;42].AddMovesForPackedDrops.before.mir fn main() { let _fn = std::ptr::drop_in_place::<[String]> as unsafe fn(_); + let _fn = std::ptr::drop_in_place::<[String; 42]> as unsafe fn(_); }