]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/inline/asm_unwind.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / mir-opt / inline / asm_unwind.rs
1 // Tests inlining of `may_unwind` inline assembly.
2 //
3 // ignore-wasm32-bare compiled with panic=abort by default
4 // needs-asm-support
5 #![feature(asm_unwind)]
6
7 struct D;
8
9 impl Drop for D {
10     fn drop(&mut self) {}
11 }
12
13 #[inline(always)]
14 fn foo() {
15     let _d = D;
16     unsafe { std::arch::asm!("", options(may_unwind)) };
17 }
18
19 // EMIT_MIR asm_unwind.main.Inline.diff
20 pub fn main() {
21     foo();
22 }