Files
rust/tests/ui/asm/naked-functions-target-feature.rs

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

22 lines
454 B
Rust
Raw Normal View History

//@ build-pass
//@ needs-asm-support
2024-12-18 22:05:27 +01:00
#![feature(naked_functions_target_feature)]
#![crate_type = "lib"]
use std::arch::{asm, naked_asm};
#[cfg(target_arch = "x86_64")]
#[target_feature(enable = "sse2")]
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
pub extern "C" fn compatible_target_feature() {
naked_asm!("ret");
}
#[cfg(target_arch = "aarch64")]
#[target_feature(enable = "neon")]
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
pub extern "C" fn compatible_target_feature() {
naked_asm!("ret");
}