2025-02-11 17:22:27 -08:00
|
|
|
#![feature(extended_varargs_abi_support)]
|
2017-05-26 10:54:56 -06:00
|
|
|
|
2025-02-18 15:00:26 +01:00
|
|
|
fn baz(f: extern "Rust" fn(usize, ...)) {
|
2022-08-08 15:31:32 +02:00
|
|
|
//~^ ERROR: C-variadic function must have a compatible calling convention,
|
2024-01-12 23:05:07 -08:00
|
|
|
// like C, cdecl, system, aapcs, win64, sysv64 or efiapi
|
2022-08-08 15:31:32 +02:00
|
|
|
f(22, 44);
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-07 15:48:16 +02:00
|
|
|
#[cfg(target_arch = "x86_64")]
|
2022-08-08 15:31:32 +02:00
|
|
|
fn sysv(f: extern "sysv64" fn(usize, ...)) {
|
|
|
|
|
f(22, 44);
|
|
|
|
|
}
|
2024-08-07 15:48:16 +02:00
|
|
|
#[cfg(target_arch = "x86_64")]
|
2022-08-08 15:31:32 +02:00
|
|
|
fn win(f: extern "win64" fn(usize, ...)) {
|
|
|
|
|
f(22, 44);
|
|
|
|
|
}
|
2024-08-07 15:48:16 +02:00
|
|
|
#[cfg(any(
|
|
|
|
|
target_arch = "arm",
|
|
|
|
|
target_arch = "aarch64",
|
|
|
|
|
target_arch = "riscv32",
|
|
|
|
|
target_arch = "riscv64",
|
|
|
|
|
target_arch = "x86",
|
|
|
|
|
target_arch = "x86_64"
|
|
|
|
|
))]
|
2022-08-08 15:31:32 +02:00
|
|
|
fn efiapi(f: extern "efiapi" fn(usize, ...)) {
|
2013-11-04 16:34:07 -05:00
|
|
|
f(22, 44);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|