2024-08-22 19:48:39 +02:00
|
|
|
//@ compile-flags: -C no-prepopulate-passes -Copt-level=0
|
|
|
|
|
//@ needs-asm-support
|
|
|
|
|
//@ ignore-arm no "ret" mnemonic
|
2025-07-06 18:10:52 -04:00
|
|
|
//@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368)
|
2024-08-22 19:48:39 +02:00
|
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
2025-07-18 00:10:46 +08:00
|
|
|
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
|
|
|
|
|
#![feature(rustc_attrs)]
|
2024-12-18 22:05:27 +01:00
|
|
|
#![feature(fn_align)]
|
2025-07-18 00:10:46 +08:00
|
|
|
|
2024-09-05 13:45:26 +02:00
|
|
|
use std::arch::naked_asm;
|
2024-08-22 19:48:39 +02:00
|
|
|
|
2024-08-08 10:20:40 +02:00
|
|
|
// CHECK: .balign 16
|
|
|
|
|
// CHECK-LABEL: naked_empty:
|
2025-07-18 00:10:46 +08:00
|
|
|
#[rustc_align(16)]
|
2024-08-22 19:48:39 +02:00
|
|
|
#[no_mangle]
|
2025-03-29 17:30:11 +01:00
|
|
|
#[unsafe(naked)]
|
|
|
|
|
pub extern "C" fn naked_empty() {
|
2024-08-08 10:20:40 +02:00
|
|
|
// CHECK: ret
|
2025-03-29 17:30:11 +01:00
|
|
|
naked_asm!("ret")
|
2024-08-22 19:48:39 +02:00
|
|
|
}
|