2017-03-31 13:09:37 -05:00
|
|
|
//@ ignore-msvc
|
2023-05-23 08:20:57 -05:00
|
|
|
//@ needs-unwind
|
2017-03-31 13:09:37 -05:00
|
|
|
|
2017-03-29 13:43:01 -05:00
|
|
|
//@ compile-flags: -O -C no-prepopulate-passes
|
|
|
|
|
2024-05-28 23:11:20 -05:00
|
|
|
#![crate_type = "lib"]
|
2017-03-29 13:43:01 -05:00
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl Drop for S {
|
2023-10-06 19:29:42 -05:00
|
|
|
#[inline(never)]
|
2024-05-28 23:11:20 -05:00
|
|
|
fn drop(&mut self) {}
|
2017-03-29 13:43:01 -05:00
|
|
|
}
|
|
|
|
|
2023-10-06 19:29:42 -05:00
|
|
|
#[inline(never)]
|
2024-05-28 23:11:20 -05:00
|
|
|
fn might_unwind() {}
|
2017-03-29 13:43:01 -05:00
|
|
|
|
|
|
|
// CHECK-LABEL: @test
|
|
|
|
#[no_mangle]
|
|
|
|
pub fn test() {
|
|
|
|
let _s = S;
|
|
|
|
// Check that the personality slot alloca gets a lifetime start in each cleanup block, not just
|
|
|
|
// in the first one.
|
2024-02-23 23:48:20 -06:00
|
|
|
// CHECK: [[SLOT:%[0-9]+]] = alloca [{{[0-9]+}} x i8]
|
2017-03-29 13:43:01 -05:00
|
|
|
// CHECK-LABEL: cleanup:
|
2022-02-21 04:21:23 -06:00
|
|
|
// CHECK: call void @llvm.lifetime.start.{{.*}}({{.*}})
|
2017-03-29 13:43:01 -05:00
|
|
|
// CHECK-LABEL: cleanup1:
|
2022-02-21 04:21:23 -06:00
|
|
|
// CHECK: call void @llvm.lifetime.start.{{.*}}({{.*}})
|
2017-03-29 13:43:01 -05:00
|
|
|
might_unwind();
|
2017-04-19 17:20:50 -05:00
|
|
|
let _t = S;
|
2017-03-29 13:43:01 -05:00
|
|
|
might_unwind();
|
|
|
|
}
|