2017-03-31 13:09:37 -05:00
|
|
|
// ignore-msvc
|
2019-10-18 16:47:54 -05:00
|
|
|
// ignore-wasm32-bare compiled with panic=abort by default
|
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
|
|
|
|
|
|
|
|
#![crate_type="lib"]
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl Drop for S {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn might_unwind() {
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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.
|
2023-07-27 16:44:13 -05:00
|
|
|
// CHECK: [[SLOT:%[0-9]+]] = alloca { ptr, i32 }
|
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();
|
|
|
|
}
|