commit abaf3dfbe9b79dcdaf742fa1c08ce6f54061e237 (tree)
parent b36cfc6352df4c5c5005c7a720dbc84894097d11
Author: Matthew Lugg <mlugg@mlugg.co.uk>
Date: Sat, 28 Mar 2026 19:24:09 +0000
tests: fix `wouldUseLlvm` on x86_64-windows
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/test/tests.zig b/test/tests.zig
@@ -2647,12 +2647,19 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt
}
const cpu_arch = query.cpu_arch orelse builtin.cpu.arch;
const os_tag = query.os_tag orelse builtin.os.tag;
+ const ofmt: std.Target.ObjectFormat = query.ofmt orelse .default(os_tag, cpu_arch);
switch (cpu_arch) {
- .x86_64 => if (os_tag.isBSD() or os_tag == .illumos or std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true,
+ .x86_64 => {
+ if (std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true;
+ if (os_tag.isBSD() or os_tag == .illumos) return true;
+ return switch (ofmt) {
+ .elf, .macho => return false,
+ else => return true,
+ };
+ },
.spirv32, .spirv64 => return false,
else => return true,
}
- return false;
}
const CAbiTestOptions = struct {