rust/tests/ui/c-variadic/variadic-ffi-2.rs

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

27 lines
611 B
Rust
Raw Normal View History

2018-08-19 13:30:23 +00:00
//@ 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,
2024-01-13 07:05:07 +00:00
// like C, cdecl, system, aapcs, win64, sysv64 or efiapi
f(22, 44);
}
2024-01-13 07:05:07 +00:00
fn system(f: extern "system" fn(usize, ...)) {
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() {}