]> git.lizzy.rs Git - rust.git/blob - tests/codegen/c-variadic-copy.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / codegen / c-variadic-copy.rs
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]
6 use core::ffi::VaList;
7
8 extern "C" {
9     fn foreign_c_variadic_1(_: VaList, ...);
10 }
11
12 pub 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 }