rust/tests/ui/asm/naked-functions-inline.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
642 B
Rust
Raw Normal View History

//@ needs-asm-support
#![feature(naked_functions)]
#![crate_type = "lib"]
use std::arch::naked_asm;
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
pub extern "C" fn inline_none() {
naked_asm!("");
}
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
#[inline]
//~^ ERROR [E0736]
2025-03-29 17:30:11 +01:00
pub extern "C" fn inline_hint() {
naked_asm!("");
}
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
#[inline(always)]
//~^ ERROR [E0736]
2025-03-29 17:30:11 +01:00
pub extern "C" fn inline_always() {
naked_asm!("");
}
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
#[inline(never)]
//~^ ERROR [E0736]
2025-03-29 17:30:11 +01:00
pub extern "C" fn inline_never() {
naked_asm!("");
}
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
#[cfg_attr(all(), inline(never))]
//~^ ERROR [E0736]
2025-03-29 17:30:11 +01:00
pub extern "C" fn conditional_inline_never() {
naked_asm!("");
}