rust/tests/assembly/naked-functions/aix.rs

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

36 lines
979 B
Rust
Raw Normal View History

2025-02-28 19:30:01 +01:00
//@ revisions: elfv1-be aix
//@ add-core-stubs
//@ assembly-output: emit-asm
//
//@[elfv1-be] compile-flags: --target powerpc64-unknown-linux-gnu
//@[elfv1-be] needs-llvm-components: powerpc
//
//@[aix] compile-flags: --target powerpc64-ibm-aix
//@[aix] needs-llvm-components: powerpc
#![crate_type = "lib"]
2024-12-18 22:05:27 +01:00
#![feature(no_core, asm_experimental_arch, f128, linkage, fn_align)]
2025-02-28 19:30:01 +01:00
#![no_core]
// tests that naked functions work for the `powerpc64-ibm-aix` target.
//
// This target is special because it uses the XCOFF binary format
// It is tested alongside an elf powerpc target to pin down commonalities and differences.
//
// https://doc.rust-lang.org/rustc/platform-support/aix.html
// https://www.ibm.com/docs/en/aix/7.2?topic=formats-xcoff-object-file-format
extern crate minicore;
use minicore::*;
// elfv1-be: .p2align 2
// aix: .align 2
// CHECK: .globl blr
// CHECK-LABEL: blr:
// CHECK: blr
#[no_mangle]
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
extern "C" fn blr() {
2025-02-28 19:30:01 +01:00
naked_asm!("blr")
}