about summary refs log tree commit diff
path: root/tests/ui/asm/naked-functions-rustic-abi.rs
blob: 99b8d2e19fe4050519176a607b9b658c135fdbea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//@ revisions: x86_64 aarch64
//
//@[aarch64] only-aarch64
//@[x86_64] only-x86_64
//
//@ build-pass
//@ needs-asm-support

#![feature(naked_functions, naked_functions_rustic_abi, rust_cold_cc)]
#![crate_type = "lib"]

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

#[unsafe(naked)]
pub fn rust_implicit() {
    naked_asm!("ret");
}

#[unsafe(naked)]
pub extern "Rust" fn rust_explicit() {
    naked_asm!("ret");
}

#[unsafe(naked)]
pub extern "rust-cold" fn rust_cold() {
    naked_asm!("ret");
}