summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/inline/asm_unwind.rs
blob: c03feb433128cd25ed40d77dccd3a97aae258c77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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();
}