2024-07-16 17:03:33 -05:00
|
|
|
//@ needs-asm-support
|
|
|
|
//@ compile-flags: --test
|
|
|
|
|
|
|
|
#![allow(undefined_naked_function_abi)]
|
|
|
|
#![feature(naked_functions)]
|
|
|
|
#![feature(test)]
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
2024-08-04 09:45:48 -05:00
|
|
|
use std::arch::naked_asm;
|
2024-07-16 17:03:33 -05:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[naked]
|
2024-07-17 03:42:24 -05:00
|
|
|
//~^ ERROR [E0736]
|
2024-07-16 17:03:33 -05:00
|
|
|
fn test_naked() {
|
2024-09-05 06:45:26 -05:00
|
|
|
unsafe { naked_asm!("") };
|
2024-07-16 17:03:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[should_panic]
|
|
|
|
#[test]
|
|
|
|
#[naked]
|
2024-07-17 03:42:24 -05:00
|
|
|
//~^ ERROR [E0736]
|
2024-07-16 17:03:33 -05:00
|
|
|
fn test_naked_should_panic() {
|
2024-09-05 06:45:26 -05:00
|
|
|
unsafe { naked_asm!("") };
|
2024-07-16 17:03:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[ignore]
|
|
|
|
#[test]
|
|
|
|
#[naked]
|
2024-07-17 03:42:24 -05:00
|
|
|
//~^ ERROR [E0736]
|
2024-07-16 17:03:33 -05:00
|
|
|
fn test_naked_ignore() {
|
2024-09-05 06:45:26 -05:00
|
|
|
unsafe { naked_asm!("") };
|
2024-07-16 17:03:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[bench]
|
|
|
|
#[naked]
|
2024-07-17 03:42:24 -05:00
|
|
|
//~^ ERROR [E0736]
|
2024-07-16 17:03:33 -05:00
|
|
|
fn bench_naked() {
|
2024-09-05 06:45:26 -05:00
|
|
|
unsafe { naked_asm!("") };
|
2024-07-16 17:03:33 -05:00
|
|
|
}
|