rust/tests/ui/c-variadic/variadic-ffi-2.rs
Soveu eea6149e03 Enable varargs support for AAPCS calling convention
This is the default calling convention for ARM - it is used for extern "C",
therefore it supports varargs.
2023-09-14 23:21:39 +02:00

24 lines
538 B
Rust

// ignore-arm stdcall isn't supported
#![feature(extended_varargs_abi_support)]
fn baz(f: extern "stdcall" fn(usize, ...)) {
//~^ ERROR: C-variadic function must have a compatible calling convention,
// like C, cdecl, aapcs, win64, sysv64 or efiapi
f(22, 44);
}
fn aapcs(f: extern "aapcs" fn(usize, ...)) {
f(22, 44);
}
fn sysv(f: extern "sysv64" fn(usize, ...)) {
f(22, 44);
}
fn win(f: extern "win64" fn(usize, ...)) {
f(22, 44);
}
fn efiapi(f: extern "efiapi" fn(usize, ...)) {
f(22, 44);
}
fn main() {}