zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 0fb80b0633fc5ebc92776449cb4e76068b5845f5 (tree)
parent a7a5f3506b74651235ba7112ce38b7c3205d0527
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Mon,  6 Jan 2025 21:51:56 +0100

Merge pull request #22430 from alexrp/thumbeb

Some QEMU fixes + disable some tests for `thumbeb` in addition to `armeb`
Diffstat:
Mlib/std/fmt.zig | 2+-
Mlib/std/simd.zig | 2+-
Mlib/std/zig/system.zig | 9++++++---
Mtest/behavior/align.zig | 4++--
Mtest/behavior/vector.zig | 8++++----
5 files changed, 14 insertions(+), 11 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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(); }