Skip to content

Commit 1f5480d

Browse files
committed
test and fix some more targets
1 parent 5a3fea5 commit 1f5480d

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

compiler/rustc_target/src/abi/call/csky.rs

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
use crate::abi::call::{ArgAbi, FnAbi, Reg, Uniform};
88

99
fn classify_ret<Ty>(arg: &mut ArgAbi<'_, Ty>) {
10+
if !arg.layout.is_sized() {
11+
// Not touching this...
12+
return;
13+
}
1014
// For return type, aggregate which <= 2*XLen will be returned in registers.
1115
// Otherwise, aggregate will be returned indirectly.
1216
if arg.layout.is_aggregate() {
@@ -24,6 +28,10 @@ fn classify_ret<Ty>(arg: &mut ArgAbi<'_, Ty>) {
2428
}
2529

2630
fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
31+
if !arg.layout.is_sized() {
32+
// Not touching this...
33+
return;
34+
}
2735
// For argument type, the first 4*XLen parts of aggregate will be passed
2836
// in registers, and the rest will be passed in stack.
2937
// So we can coerce to integers directly and let backend handle it correctly.

compiler/rustc_target/src/abi/call/m68k.rs

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
99
}
1010

1111
fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
12+
if !arg.layout.is_sized() {
13+
// Not touching this...
14+
return;
15+
}
1216
if arg.layout.is_aggregate() {
1317
arg.make_indirect_byval(None);
1418
} else {

tests/ui/abi/compatibility.rs

+9
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@
4646
// revisions: wasi
4747
//[wasi] compile-flags: --target wasm32-wasi
4848
//[wasi] needs-llvm-components: webassembly
49+
// revisions: csky
50+
//[csky] compile-flags: --target csky-unknown-linux-gnuabiv2
51+
//[csky] needs-llvm-components: csky
52+
// revisions: bpf
53+
//[bpf] compile-flags: --target bpfeb-unknown-none
54+
//[bpf] needs-llvm-components: bpf
55+
// revisions: m68k
56+
//[m68k] compile-flags: --target m68k-unknown-linux-gnu
57+
//[m68k] needs-llvm-components: m68k
4958
// FIXME: disabled on nvptx64 since the target ABI fails the sanity check
5059
// see https://github.com/rust-lang/rust/issues/117480
5160
/* revisions: nvptx64

0 commit comments

Comments
 (0)