aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2025-09-13 17:54:31 +0100
committermlugg <mlugg@mlugg.co.uk>2025-09-30 13:44:54 +0100
commit2fefe0e4b39ab6f86e5af423304b8a7b2da5fe72 (patch)
tree4201d6170dfb7568298c0365747c73e3cf344f1c /test
parentf5c8d80e08fac9dcf2eb88941d68b44640a4c9b4 (diff)
downloadzig-2fefe0e4b39ab6f86e5af423304b8a7b2da5fe72.tar.gz
zig-2fefe0e4b39ab6f86e5af423304b8a7b2da5fe72.zip
tests: fix 32-bit compatible arch selection
Diffstat (limited to 'test')
-rw-r--r--test/tests.zig28
1 files changed, 18 insertions, 10 deletions
diff --git a/test/tests.zig b/test/tests.zig
index b327e94a8f..a6bd061f38 100644
--- a/test/tests.zig
+++ b/test/tests.zig
@@ -1866,18 +1866,26 @@ fn nativeAndCompatible32bit(b: *std.Build, skip_non_native: bool) []const std.Bu
const host = b.graph.host.result;
const only_native = (&b.graph.host)[0..1];
if (skip_non_native) return only_native;
- const arch32: std.Target.Cpu.Arch = switch (host.cpu.arch) {
- .x86_64 => .x86,
- .aarch64 => .arm,
- .aarch64_be => .armeb,
+ const arch32: std.Target.Cpu.Arch = switch (host.os.tag) {
+ .windows => switch (host.cpu.arch) {
+ .x86_64 => .x86,
+ .aarch64 => .thumb,
+ .aarch64_be => .thumbeb,
+ else => return only_native,
+ },
+ .freebsd => switch (host.cpu.arch) {
+ .aarch64 => .arm,
+ .aarch64_be => .armeb,
+ else => return only_native,
+ },
+ .linux, .netbsd => switch (host.cpu.arch) {
+ .x86_64 => .x86,
+ .aarch64 => .arm,
+ .aarch64_be => .armeb,
+ else => return only_native,
+ },
else => return only_native,
};
- switch (host.os.tag) {
- .windows => if (arch32.isArm()) return only_native,
- .macos, .freebsd => if (arch32 == .x86) return only_native,
- .linux, .netbsd => {},
- else => return only_native,
- }
return b.graph.arena.dupe(std.Build.ResolvedTarget, &.{
b.graph.host,
b.resolveTargetQuery(.{ .cpu_arch = arch32, .os_tag = host.os.tag }),