about summary refs log tree commit diff
path: root/tests/ui/asm/naked-functions-target-feature.rs
blob: 57ad79b1c315c208c4b1f9fc513b579165df9e6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//@ build-pass
//@ needs-asm-support

#![feature(naked_functions_target_feature)]
#![crate_type = "lib"]

use std::arch::{asm, naked_asm};

#[cfg(target_arch = "x86_64")]
#[target_feature(enable = "sse2")]
#[unsafe(naked)]
pub extern "C" fn compatible_target_feature() {
    naked_asm!("ret");
}

#[cfg(target_arch = "aarch64")]
#[target_feature(enable = "neon")]
#[unsafe(naked)]
pub extern "C" fn compatible_target_feature() {
    naked_asm!("ret");
}