]> git.proxmox.com Git - rustc.git/blame - tests/codegen/c-variadic-copy.rs
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / codegen / c-variadic-copy.rs
CommitLineData
dc9dc135
XL
1// Tests that `VaListImpl::clone` gets inlined into a call to `llvm.va_copy`
2
3#![crate_type = "lib"]
4#![feature(c_variadic)]
5#![no_std]
6use core::ffi::VaList;
7
8extern "C" {
9 fn foreign_c_variadic_1(_: VaList, ...);
10}
11
12pub unsafe extern "C" fn clone_variadic(ap: VaList) {
13 let mut ap2 = ap.clone();
14 // CHECK: call void @llvm.va_copy
15 foreign_c_variadic_1(ap2.as_va_list(), 42i32);
16}