Files
rust/tests/codegen-llvm/c-variadic-va-end.rs
Folkert de Vries d297af408d remove LLVM va_end calls
The operation is a no-op, so we skip it.
2026-06-15 19:52:50 +02:00

17 lines
375 B
Rust

//@ add-minicore
//@ compile-flags: -Copt-level=3
#![feature(c_variadic)]
#![crate_type = "lib"]
unsafe extern "C" {
fn g(v: *mut u8);
}
#[unsafe(no_mangle)]
pub unsafe extern "C" fn f(mut args: ...) {
// CHECK: call void @llvm.va_start
unsafe { g(&raw mut args as *mut u8) }
// We no longer call the LLVM va_end.
// CHECK-NOT: call void @llvm.va_end
}