2024-08-22 12:48:39 -05:00
|
|
|
//@ compile-flags: -C no-prepopulate-passes -Copt-level=0
|
|
|
|
//@ needs-asm-support
|
|
|
|
//@ ignore-arm no "ret" mnemonic
|
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
#![feature(naked_functions, fn_align)]
|
2024-09-05 06:45:26 -05:00
|
|
|
use std::arch::naked_asm;
|
2024-08-22 12:48:39 -05:00
|
|
|
|
|
|
|
// CHECK: Function Attrs: naked
|
|
|
|
// CHECK-NEXT: define{{.*}}void @naked_empty()
|
|
|
|
// CHECK: align 16
|
|
|
|
#[repr(align(16))]
|
|
|
|
#[no_mangle]
|
|
|
|
#[naked]
|
|
|
|
pub unsafe extern "C" fn naked_empty() {
|
|
|
|
// CHECK-NEXT: start:
|
|
|
|
// CHECK-NEXT: call void asm
|
|
|
|
// CHECK-NEXT: unreachable
|
2024-09-05 06:45:26 -05:00
|
|
|
naked_asm!("ret");
|
2024-08-22 12:48:39 -05:00
|
|
|
}
|