Skip to content

Commit

Permalink
Fix tests that only broke during cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
tdittr committed Aug 9, 2024
1 parent d9cd3bd commit 0cef57e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//@ only-x86_64

fn efiapi(f: extern "efiapi" fn(usize, ...)) {
//~^ ERROR: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
//~^^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
--> $DIR/feature-gate-extended_varargs_abi_support.rs:1:14
--> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14
|
LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -9,13 +9,13 @@ LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) {
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
--> $DIR/feature-gate-extended_varargs_abi_support.rs:1:14
--> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14
|
LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention

error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
--> $DIR/feature-gate-extended_varargs_abi_support.rs:6:12
--> $DIR/feature-gate-extended_varargs_abi_support.rs:8:12
|
LL | fn sysv(f: extern "sysv64" fn(usize, ...)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -25,13 +25,13 @@ LL | fn sysv(f: extern "sysv64" fn(usize, ...)) {
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
--> $DIR/feature-gate-extended_varargs_abi_support.rs:6:12
--> $DIR/feature-gate-extended_varargs_abi_support.rs:8:12
|
LL | fn sysv(f: extern "sysv64" fn(usize, ...)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention

error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
--> $DIR/feature-gate-extended_varargs_abi_support.rs:11:11
--> $DIR/feature-gate-extended_varargs_abi_support.rs:13:11
|
LL | fn win(f: extern "win64" fn(usize, ...)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -41,7 +41,7 @@ LL | fn win(f: extern "win64" fn(usize, ...)) {
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
--> $DIR/feature-gate-extended_varargs_abi_support.rs:11:11
--> $DIR/feature-gate-extended_varargs_abi_support.rs:13:11
|
LL | fn win(f: extern "win64" fn(usize, ...)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
Expand Down
9 changes: 9 additions & 0 deletions tests/ui/c-variadic/variadic-ffi-2-arm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ only-arm
//@ build-pass
#![feature(extended_varargs_abi_support)]

fn aapcs(f: extern "aapcs" fn(usize, ...)) {
f(22, 44);
}

fn main() {}
6 changes: 2 additions & 4 deletions tests/ui/c-variadic/variadic-ffi-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ fn baz(f: extern "stdcall" fn(usize, ...)) {
fn system(f: extern "system" fn(usize, ...)) {
f(22, 44);
}
#[cfg(target_arch = "arm")]
fn aapcs(f: extern "aapcs" fn(usize, ...)) {
f(22, 44);
}
#[cfg(target_arch = "x86_64")]
fn sysv(f: extern "sysv64" fn(usize, ...)) {
f(22, 44);
}
#[cfg(target_arch = "x86_64")]
fn win(f: extern "win64" fn(usize, ...)) {
f(22, 44);
}
Expand Down

0 comments on commit 0cef57e

Please sign in to comment.