Skip to content

Commit 02e565a

Browse files
committed
Don't use win64 calling convention on 32-bit machines.
1 parent 5b534e4 commit 02e565a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/test/auxiliary/extern_calling_convention.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,26 @@
1212
// functions.
1313

1414
#[inline(never)]
15+
#[cfg(target_arch = "x86_64")]
1516
pub extern "win64" fn foo(a: int, b: int, c: int, d: int) {
1617
assert!(a == 1);
1718
assert!(b == 2);
1819
assert!(c == 3);
1920
assert!(d == 4);
20-
21+
2122
println!("a: {:?}, b: {:?}, c: {:?}, d: {:?}",
2223
a, b, c, d)
2324
}
2425

25-
fn main() {
26-
foo(1, 2, 3, 4)
26+
#[inline(never)]
27+
#[cfg(target_arch = "x86")]
28+
#[cfg(target_arch = "arm")]
29+
pub extern fn foo(a: int, b: int, c: int, d: int) {
30+
assert!(a == 1);
31+
assert!(b == 2);
32+
assert!(c == 3);
33+
assert!(d == 4);
34+
35+
println!("a: {:?}, b: {:?}, c: {:?}, d: {:?}",
36+
a, b, c, d)
2737
}

0 commit comments

Comments
 (0)