]> git.proxmox.com Git - rustc.git/blame - src/test/codegen/personality_lifetimes.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / codegen / personality_lifetimes.rs
CommitLineData
cc61c64b 1// ignore-msvc
e74abb32 2// ignore-wasm32-bare compiled with panic=abort by default
cc61c64b
XL
3
4// compile-flags: -O -C no-prepopulate-passes
5
6#![crate_type="lib"]
7
8struct S;
9
10impl Drop for S {
11 fn drop(&mut self) {
12 }
13}
14
15fn might_unwind() {
16}
17
18// CHECK-LABEL: @test
19#[no_mangle]
20pub fn test() {
21 let _s = S;
22 // Check that the personality slot alloca gets a lifetime start in each cleanup block, not just
23 // in the first one.
923072b8 24 // CHECK: [[SLOT:%[0-9]+]] = alloca { {{i8\*|ptr}}, i32 }
cc61c64b 25 // CHECK-LABEL: cleanup:
923072b8 26 // CHECK: call void @llvm.lifetime.start.{{.*}}({{.*}})
cc61c64b 27 // CHECK-LABEL: cleanup1:
923072b8 28 // CHECK: call void @llvm.lifetime.start.{{.*}}({{.*}})
cc61c64b
XL
29 might_unwind();
30 let _t = S;
31 might_unwind();
32}