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

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

38 lines
545 B
Rust
Raw Normal View History

//@ needs-asm-support
//@ compile-flags: --test
#![feature(test)]
#![crate_type = "lib"]
use std::arch::naked_asm;
#[test]
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
//~^ ERROR [E0736]
extern "C" fn test_naked() {
2025-03-29 17:30:11 +01:00
naked_asm!("")
}
#[should_panic]
#[test]
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
//~^ ERROR [E0736]
extern "C" fn test_naked_should_panic() {
2025-03-29 17:30:11 +01:00
naked_asm!("")
}
#[ignore]
#[test]
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
//~^ ERROR [E0736]
extern "C" fn test_naked_ignore() {
2025-03-29 17:30:11 +01:00
naked_asm!("")
}
#[bench]
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
//~^ ERROR [E0736]
extern "C" fn bench_naked() {
2025-03-29 17:30:11 +01:00
naked_asm!("")
}