rust/tests/codegen/cffi/c-variadic-naked.rs

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

16 lines
322 B
Rust
Raw Normal View History

//@ needs-asm-support
//@ only-x86_64
// tests that `va_start` is not injected into naked functions
#![crate_type = "lib"]
#![feature(c_variadic)]
#![no_std]
2025-03-29 17:30:11 +01:00
#[unsafe(naked)]
pub unsafe extern "C" fn c_variadic(_: usize, _: ...) {
// CHECK-NOT: va_start
// CHECK-NOT: alloca
2025-03-29 17:30:11 +01:00
core::arch::naked_asm!("ret")
}