2021-11-14 03:08:12 +01:00
|
|
|
// min-llvm-version: 13.0.0
|
|
|
|
|
// compile-flags: -O
|
2021-12-03 23:53:31 +01:00
|
|
|
// only-x86_64
|
2021-11-14 03:08:12 +01:00
|
|
|
|
|
|
|
|
#![crate_type = "rlib"]
|
2021-12-10 00:15:33 +00:00
|
|
|
#![feature(asm_unwind)]
|
|
|
|
|
|
|
|
|
|
use std::arch::asm;
|
2021-11-14 03:08:12 +01:00
|
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
|
pub extern "C" fn panicky() {}
|
|
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
|
|
impl Drop for Foo {
|
|
|
|
|
fn drop(&mut self) {
|
|
|
|
|
println!();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CHECK-LABEL: @may_unwind
|
|
|
|
|
#[no_mangle]
|
|
|
|
|
pub unsafe fn may_unwind() {
|
|
|
|
|
let _m = Foo;
|
2021-11-28 19:35:31 +01:00
|
|
|
// CHECK: invoke void asm sideeffect alignstack inteldialect unwind ""
|
2021-11-14 03:08:12 +01:00
|
|
|
asm!("", options(may_unwind));
|
|
|
|
|
}
|