]> git.lizzy.rs Git - rust.git/blob - tests/codegen/dealloc-no-unwind.rs
Auto merge of #107778 - weihanglo:update-cargo, r=weihanglo
[rust.git] / tests / codegen / dealloc-no-unwind.rs
1 // no-system-llvm
2 // compile-flags: -O
3
4 #![crate_type="lib"]
5
6 struct A;
7
8 impl Drop for A {
9     fn drop(&mut self) {
10         extern "C" { fn foo(); }
11         unsafe { foo(); }
12     }
13 }
14
15 #[no_mangle]
16 pub fn a(a: Box<i32>) {
17     // CHECK-LABEL: define{{.*}}void @a
18     // CHECK: call void @__rust_dealloc
19     // CHECK-NEXT: call void @foo
20     let _a = A;
21     drop(a);
22 }