rust/tests/ui/asm/may_unwind_ffi_unwind.rs
bjorn3 d3c580db21 Handle inline asm in has_ffi_unwind_calls
This is required for the soundness of options(may_unwind)
2025-11-25 16:01:02 +00:00

18 lines
378 B
Rust

// Check that asm!() with options(may_unwind) is considered an FFI call by has_ffi_unwind_calls.
//@ check-fail
//@ needs-asm-support
//@ needs-unwind
#![feature(asm_unwind)]
#![deny(ffi_unwind_calls)]
use std::arch::asm;
#[no_mangle]
pub unsafe fn asm_may_unwind() {
asm!("", options(may_unwind));
//~^ ERROR call to inline assembly that may unwind
}
fn main() {}