Skip to content

Commit 0cef57e

Browse files
committed
Fix tests that only broke during cross compilation
1 parent d9cd3bd commit 0cef57e

4 files changed

+19
-10
lines changed

tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//@ only-x86_64
2+
13
fn efiapi(f: extern "efiapi" fn(usize, ...)) {
24
//~^ ERROR: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
35
//~^^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable

tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable
2-
--> $DIR/feature-gate-extended_varargs_abi_support.rs:1:14
2+
--> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14
33
|
44
LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,13 +9,13 @@ LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) {
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

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

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

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

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

4343
error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl`
44-
--> $DIR/feature-gate-extended_varargs_abi_support.rs:11:11
44+
--> $DIR/feature-gate-extended_varargs_abi_support.rs:13:11
4545
|
4646
LL | fn win(f: extern "win64" fn(usize, ...)) {
4747
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ only-arm
2+
//@ build-pass
3+
#![feature(extended_varargs_abi_support)]
4+
5+
fn aapcs(f: extern "aapcs" fn(usize, ...)) {
6+
f(22, 44);
7+
}
8+
9+
fn main() {}

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ fn baz(f: extern "stdcall" fn(usize, ...)) {
1111
fn system(f: extern "system" fn(usize, ...)) {
1212
f(22, 44);
1313
}
14-
#[cfg(target_arch = "arm")]
15-
fn aapcs(f: extern "aapcs" fn(usize, ...)) {
16-
f(22, 44);
17-
}
14+
#[cfg(target_arch = "x86_64")]
1815
fn sysv(f: extern "sysv64" fn(usize, ...)) {
1916
f(22, 44);
2017
}
18+
#[cfg(target_arch = "x86_64")]
2119
fn win(f: extern "win64" fn(usize, ...)) {
2220
f(22, 44);
2321
}

0 commit comments

Comments
 (0)