mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
23 lines
391 B
Rust
23 lines
391 B
Rust
// Tests inlining of `may_unwind` inline assembly.
|
|
//
|
|
// ignore-wasm32-bare compiled with panic=abort by default
|
|
// needs-asm-support
|
|
#![feature(asm_unwind)]
|
|
|
|
struct D;
|
|
|
|
impl Drop for D {
|
|
fn drop(&mut self) {}
|
|
}
|
|
|
|
#[inline(always)]
|
|
fn foo() {
|
|
let _d = D;
|
|
unsafe { std::arch::asm!("", options(may_unwind)) };
|
|
}
|
|
|
|
// EMIT_MIR asm_unwind.main.Inline.diff
|
|
pub fn main() {
|
|
foo();
|
|
}
|