diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-01-06 21:51:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-06 21:51:56 +0100 |
| commit | 0fb80b0633fc5ebc92776449cb4e76068b5845f5 (patch) | |
| tree | 3d72f6598837e534f7a306f3f94b70a6be8591d3 | |
| parent | a7a5f3506b74651235ba7112ce38b7c3205d0527 (diff) | |
| parent | 03ac40d5709060168e10c9c3187ffb5a161e773b (diff) | |
| download | zig-0fb80b0633fc5ebc92776449cb4e76068b5845f5.tar.gz zig-0fb80b0633fc5ebc92776449cb4e76068b5845f5.zip | |
Merge pull request #22430 from alexrp/thumbeb
Some QEMU fixes + disable some tests for `thumbeb` in addition to `armeb`
| -rw-r--r-- | lib/std/fmt.zig | 2 | ||||
| -rw-r--r-- | lib/std/simd.zig | 2 | ||||
| -rw-r--r-- | lib/std/zig/system.zig | 9 | ||||
| -rw-r--r-- | test/behavior/align.zig | 4 | ||||
| -rw-r--r-- | test/behavior/vector.zig | 8 |
5 files changed, 14 insertions, 11 deletions
diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index b45194a837..2b5e78975e 100644 --- a/lib/std/fmt.zig +++ b/lib/std/fmt.zig @@ -2596,7 +2596,7 @@ test "positional/alignment/width/precision" { } test "vector" { - if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 + if ((builtin.cpu.arch == .armeb or builtin.cpu.arch == .thumbeb) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 if (builtin.target.cpu.arch == .riscv64) { // https://github.com/ziglang/zig/issues/4486 return error.SkipZigTest; diff --git a/lib/std/simd.zig b/lib/std/simd.zig index 3413ad127f..e06a873f09 100644 --- a/lib/std/simd.zig +++ b/lib/std/simd.zig @@ -462,7 +462,7 @@ pub fn prefixScan(comptime op: std.builtin.ReduceOp, comptime hop: isize, vec: a test "vector prefix scan" { if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 + if ((builtin.cpu.arch == .armeb or builtin.cpu.arch == .thumbeb) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21893 if (comptime builtin.cpu.arch.isMIPS()) { diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index 591e369ff7..6e4fc1adef 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -83,8 +83,8 @@ pub fn getExternalExecutor( return switch (candidate.cpu.arch) { .aarch64 => Executor{ .qemu = "qemu-aarch64" }, .aarch64_be => Executor{ .qemu = "qemu-aarch64_be" }, - .arm => Executor{ .qemu = "qemu-arm" }, - .armeb => Executor{ .qemu = "qemu-armeb" }, + .arm, .thumb => Executor{ .qemu = "qemu-arm" }, + .armeb, .thumbeb => Executor{ .qemu = "qemu-armeb" }, .hexagon => Executor{ .qemu = "qemu-hexagon" }, .loongarch64 => Executor{ .qemu = "qemu-loongarch64" }, .m68k => Executor{ .qemu = "qemu-m68k" }, @@ -116,7 +116,10 @@ pub fn getExternalExecutor( }, .sparc64 => Executor{ .qemu = "qemu-sparc64" }, .x86 => Executor{ .qemu = "qemu-i386" }, - .x86_64 => Executor{ .qemu = "qemu-x86_64" }, + .x86_64 => switch (candidate.abi) { + .gnux32, .muslx32 => return bad_result, + else => Executor{ .qemu = "qemu-x86_64" }, + }, .xtensa => Executor{ .qemu = "qemu-xtensa" }, else => return bad_result, }; diff --git a/test/behavior/align.zig b/test/behavior/align.zig index 9b3696e0a1..9974715e3b 100644 --- a/test/behavior/align.zig +++ b/test/behavior/align.zig @@ -347,7 +347,7 @@ test "@alignCast functions" { // function alignment is a compile error on wasm32/wasm64 if (native_arch == .wasm32 or native_arch == .wasm64) return error.SkipZigTest; - if (native_arch == .thumb) return error.SkipZigTest; + if (native_arch == .thumb or native_arch == .thumbeb) return error.SkipZigTest; try expect(fnExpectsOnly1(simple4) == 0x19); } @@ -512,7 +512,7 @@ test "align(N) on functions" { // function alignment is a compile error on wasm32/wasm64 if (native_arch == .wasm32 or native_arch == .wasm64) return error.SkipZigTest; - if (native_arch == .thumb) return error.SkipZigTest; + if (native_arch == .thumb or native_arch == .thumbeb) return error.SkipZigTest; try expect((@intFromPtr(&overaligned_fn) & (0x1000 - 1)) == 0); } diff --git a/test/behavior/vector.zig b/test/behavior/vector.zig index 5798665d0c..3180d1554a 100644 --- a/test/behavior/vector.zig +++ b/test/behavior/vector.zig @@ -640,7 +640,7 @@ test "vector division operators" { }; try comptime S.doTheTest(); - if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 + if ((builtin.cpu.arch == .armeb or builtin.cpu.arch == .thumbeb) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 try S.doTheTest(); } @@ -1100,7 +1100,7 @@ test "@addWithOverflow" { } }; try comptime S.doTheTest(); - if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 + if ((builtin.cpu.arch == .armeb or builtin.cpu.arch == .thumbeb) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 try S.doTheTest(); } @@ -1134,7 +1134,7 @@ test "@subWithOverflow" { } }; try comptime S.doTheTest(); - if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 + if ((builtin.cpu.arch == .armeb or builtin.cpu.arch == .thumbeb) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 try S.doTheTest(); } @@ -1158,7 +1158,7 @@ test "@mulWithOverflow" { } }; try comptime S.doTheTest(); - if (builtin.cpu.arch == .armeb and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 + if ((builtin.cpu.arch == .armeb or builtin.cpu.arch == .thumbeb) and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/22060 try S.doTheTest(); } |
