authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-30 05:45:57+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-30 05:45:57+02:00
log09ad5c029a24f77e3de3586fa10164374c4c9ac5
tree42b5806dae6c56eb21450d954298264390aaeea2
parentb8cb780230197ce7e7e3059c7e37e1a40d9dcfc2
parent9ad29fbc6c594f4474919020a3c796d64ab38455

Merge pull request 'make `-Dskip-non-native` smarter' (#35502) from skip_non_native into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35502

10 files changed, 158 insertions(+), 53 deletions(-)

build.zig-1
...@@ -233,7 +233,6 @@ pub fn build(b: *std.Build) !void {...@@ -233,7 +233,6 @@ pub fn build(b: *std.Build) !void {
233 exe.root_module.addOptions("build_options", exe_options);233 exe.root_module.addOptions("build_options", exe_options);
234234
235 exe_options.addOption(u32, "mem_leak_frames", mem_leak_frames);235 exe_options.addOption(u32, "mem_leak_frames", mem_leak_frames);
236 exe_options.addOption(bool, "skip_non_native", skip_non_native);
237 exe_options.addOption(bool, "have_llvm", enable_llvm);236 exe_options.addOption(bool, "have_llvm", enable_llvm);
238 exe_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);237 exe_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);
239 exe_options.addOption(bool, "llvm_has_csky", llvm_has_csky);238 exe_options.addOption(bool, "llvm_has_csky", llvm_has_csky);
lib/std/math.zig+5
...@@ -461,6 +461,11 @@ pub fn wrap(x: anytype, r: anytype) @TypeOf(x) {...@@ -461,6 +461,11 @@ pub fn wrap(x: anytype, r: anytype) @TypeOf(x) {
461 }461 }
462}462}
463test wrap {463test wrap {
464 if (builtin.os.tag == .windows and builtin.cpu.arch == .x86) {
465 // https://codeberg.org/ziglang/zig/issues/35520
466 return error.SkipZigTest;
467 }
468
464 // Within range469 // Within range
465 try testing.expect(wrap(@as(i32, -75), @as(i32, 180)) == -75);470 try testing.expect(wrap(@as(i32, -75), @as(i32, 180)) == -75);
466 try testing.expect(wrap(@as(i32, -75), @as(i32, -180)) == -75);471 try testing.expect(wrap(@as(i32, -75), @as(i32, -180)) == -75);
lib/std/math/isnan.zig+5
...@@ -29,6 +29,11 @@ test isNan {...@@ -29,6 +29,11 @@ test isNan {
29test isSignalNan {29test isSignalNan {
30 if (builtin.zig_backend == .stage2_x86_64 and builtin.object_format == .coff and builtin.abi != .gnu) return error.SkipZigTest;30 if (builtin.zig_backend == .stage2_x86_64 and builtin.object_format == .coff and builtin.abi != .gnu) return error.SkipZigTest;
3131
32 if (builtin.os.tag == .windows) {
33 // https://codeberg.org/ziglang/zig/issues/35519
34 return error.SkipZigTest;
35 }
36
32 inline for ([_]type{ f16, f32, f64, f80, f128, c_longdouble }) |T| {37 inline for ([_]type{ f16, f32, f64, f80, f128, c_longdouble }) |T| {
33 // TODO: Signalling NaN values get converted to quiet NaN values in38 // TODO: Signalling NaN values get converted to quiet NaN values in
34 // some cases where they shouldn't such that this can fail.39 // some cases where they shouldn't such that this can fail.
src/link/Elf.zig-12
...@@ -1691,9 +1691,6 @@ pub fn updateFunc(...@@ -1691,9 +1691,6 @@ pub fn updateFunc(
1691 func_index: InternPool.Index,1691 func_index: InternPool.Index,
1692 mir: *const codegen.AnyMir,1692 mir: *const codegen.AnyMir,
1693) link.File.UpdateNavError!void {1693) link.File.UpdateNavError!void {
1694 if (build_options.skip_non_native and builtin.object_format != .elf) {
1695 @panic("Attempted to compile for object format that was disabled by build configuration");
1696 }
1697 return self.zigObjectPtr().?.updateFunc(self, pt, func_index, mir);1694 return self.zigObjectPtr().?.updateFunc(self, pt, func_index, mir);
1698}1695}
16991696
...@@ -1702,9 +1699,6 @@ pub fn updateNav(...@@ -1702,9 +1699,6 @@ pub fn updateNav(
1702 pt: Zcu.PerThread,1699 pt: Zcu.PerThread,
1703 nav: InternPool.Nav.Index,1700 nav: InternPool.Nav.Index,
1704) link.File.UpdateNavError!void {1701) link.File.UpdateNavError!void {
1705 if (build_options.skip_non_native and builtin.object_format != .elf) {
1706 @panic("Attempted to compile for object format that was disabled by build configuration");
1707 }
1708 return self.zigObjectPtr().?.updateNav(self, pt, nav);1702 return self.zigObjectPtr().?.updateNav(self, pt, nav);
1709}1703}
17101704
...@@ -1714,9 +1708,6 @@ pub fn updateContainerType(...@@ -1714,9 +1708,6 @@ pub fn updateContainerType(
1714 ty: InternPool.Index,1708 ty: InternPool.Index,
1715 success: bool,1709 success: bool,
1716) link.File.UpdateContainerTypeError!void {1710) link.File.UpdateContainerTypeError!void {
1717 if (build_options.skip_non_native and builtin.object_format != .elf) {
1718 @panic("Attempted to compile for object format that was disabled by build configuration");
1719 }
1720 return self.zigObjectPtr().?.updateContainerType(pt, ty, success) catch |err| switch (err) {1711 return self.zigObjectPtr().?.updateContainerType(pt, ty, success) catch |err| switch (err) {
1721 error.OutOfMemory => |e| return e,1712 error.OutOfMemory => |e| return e,
1722 };1713 };
...@@ -1728,9 +1719,6 @@ pub fn updateExports(...@@ -1728,9 +1719,6 @@ pub fn updateExports(
1728 exported: Zcu.Exported,1719 exported: Zcu.Exported,
1729 export_indices: []const Zcu.Export.Index,1720 export_indices: []const Zcu.Export.Index,
1730) link.File.UpdateExportsError!void {1721) link.File.UpdateExportsError!void {
1731 if (build_options.skip_non_native and builtin.object_format != .elf) {
1732 @panic("Attempted to compile for object format that was disabled by build configuration");
1733 }
1734 return self.zigObjectPtr().?.updateExports(self, pt, exported, export_indices);1722 return self.zigObjectPtr().?.updateExports(self, pt, exported, export_indices);
1735}1723}
17361724
src/link/MachO.zig-9
...@@ -3075,16 +3075,10 @@ pub fn updateFunc(...@@ -3075,16 +3075,10 @@ pub fn updateFunc(
3075 func_index: InternPool.Index,3075 func_index: InternPool.Index,
3076 mir: *const codegen.AnyMir,3076 mir: *const codegen.AnyMir,
3077) link.File.UpdateNavError!void {3077) link.File.UpdateNavError!void {
3078 if (build_options.skip_non_native and builtin.object_format != .macho) {
3079 @panic("Attempted to compile for object format that was disabled by build configuration");
3080 }
3081 return self.getZigObject().?.updateFunc(self, pt, func_index, mir);3078 return self.getZigObject().?.updateFunc(self, pt, func_index, mir);
3082}3079}
30833080
3084pub fn updateNav(self: *MachO, pt: Zcu.PerThread, nav: InternPool.Nav.Index) link.File.UpdateNavError!void {3081pub fn updateNav(self: *MachO, pt: Zcu.PerThread, nav: InternPool.Nav.Index) link.File.UpdateNavError!void {
3085 if (build_options.skip_non_native and builtin.object_format != .macho) {
3086 @panic("Attempted to compile for object format that was disabled by build configuration");
3087 }
3088 return self.getZigObject().?.updateNav(self, pt, nav);3082 return self.getZigObject().?.updateNav(self, pt, nav);
3089}3083}
30903084
...@@ -3098,9 +3092,6 @@ pub fn updateExports(...@@ -3098,9 +3092,6 @@ pub fn updateExports(
3098 exported: Zcu.Exported,3092 exported: Zcu.Exported,
3099 export_indices: []const Zcu.Export.Index,3093 export_indices: []const Zcu.Export.Index,
3100) link.File.UpdateExportsError!void {3094) link.File.UpdateExportsError!void {
3101 if (build_options.skip_non_native and builtin.object_format != .macho) {
3102 @panic("Attempted to compile for object format that was disabled by build configuration");
3103 }
3104 return self.getZigObject().?.updateExports(self, pt, exported, export_indices);3095 return self.getZigObject().?.updateExports(self, pt, exported, export_indices);
3105}3096}
31063097
src/link/Wasm.zig-11
...@@ -3192,10 +3192,6 @@ pub fn updateFunc(...@@ -3192,10 +3192,6 @@ pub fn updateFunc(
3192 func_index: InternPool.Index,3192 func_index: InternPool.Index,
3193 any_mir: *const codegen.AnyMir,3193 any_mir: *const codegen.AnyMir,
3194) !void {3194) !void {
3195 if (build_options.skip_non_native and builtin.object_format != .wasm) {
3196 @panic("Attempted to compile for object format that was disabled by build configuration");
3197 }
3198
3199 dev.check(.wasm_backend);3195 dev.check(.wasm_backend);
32003196
3201 // This linker implementation only works with codegen backend `.stage2_wasm`.3197 // This linker implementation only works with codegen backend `.stage2_wasm`.
...@@ -3279,9 +3275,6 @@ pub fn updateFunc(...@@ -3279,9 +3275,6 @@ pub fn updateFunc(
3279// Generate code for the "Nav", storing it in memory to be later written to3275// Generate code for the "Nav", storing it in memory to be later written to
3280// the file on flush().3276// the file on flush().
3281pub fn updateNav(wasm: *Wasm, pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) !void {3277pub fn updateNav(wasm: *Wasm, pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) !void {
3282 if (build_options.skip_non_native and builtin.object_format != .wasm) {
3283 @panic("Attempted to compile for object format that was disabled by build configuration");
3284 }
3285 const zcu = pt.zcu;3278 const zcu = pt.zcu;
3286 const ip = &zcu.intern_pool;3279 const ip = &zcu.intern_pool;
3287 const nav = ip.getNav(nav_index);3280 const nav = ip.getNav(nav_index);
...@@ -3378,10 +3371,6 @@ pub fn updateExports(...@@ -3378,10 +3371,6 @@ pub fn updateExports(
3378 exported: Zcu.Exported,3371 exported: Zcu.Exported,
3379 export_indices: []const Zcu.Export.Index,3372 export_indices: []const Zcu.Export.Index,
3380) !void {3373) !void {
3381 if (build_options.skip_non_native and builtin.object_format != .wasm) {
3382 @panic("Attempted to compile for object format that was disabled by build configuration");
3383 }
3384
3385 const zcu = pt.zcu;3374 const zcu = pt.zcu;
3386 const gpa = zcu.gpa;3375 const gpa = zcu.gpa;
3387 const ip = &zcu.intern_pool;3376 const ip = &zcu.intern_pool;
test/behavior/align.zig+5
...@@ -29,6 +29,11 @@ test "large alignment of local constant" {...@@ -29,6 +29,11 @@ test "large alignment of local constant" {
29 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // flaky29 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // flaky
30 if (builtin.zig_backend == .stage2_c and builtin.target.abi == .msvc) return error.SkipZigTest;30 if (builtin.zig_backend == .stage2_c and builtin.target.abi == .msvc) return error.SkipZigTest;
3131
32 if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag == .windows) {
33 // https://codeberg.org/ziglang/zig/issues/35537
34 return error.SkipZigTest;
35 }
36
32 const x: f32 align(128) = 12.34;37 const x: f32 align(128) = 12.34;
33 try std.testing.expect(@intFromPtr(&x) % 128 == 0);38 try std.testing.expect(@intFromPtr(&x) % 128 == 0);
34}39}
test/behavior/floatop.zig+5
...@@ -948,6 +948,11 @@ test "@log2 with vectors" {...@@ -948,6 +948,11 @@ test "@log2 with vectors" {
948 builtin.cpu.arch == .aarch64 and948 builtin.cpu.arch == .aarch64 and
949 builtin.os.tag == .windows) return error.SkipZigTest;949 builtin.os.tag == .windows) return error.SkipZigTest;
950950
951 if (builtin.os.tag == .windows and builtin.cpu.arch == .x86) {
952 // https://codeberg.org/ziglang/zig/issues/35518
953 return error.SkipZigTest;
954 }
955
951 try testLog2WithVectors();956 try testLog2WithVectors();
952 try comptime testLog2WithVectors();957 try comptime testLog2WithVectors();
953}958}
test/src/Cases.zig+1-1
...@@ -481,7 +481,7 @@ pub fn lowerToBuildSteps(...@@ -481,7 +481,7 @@ pub fn lowerToBuildSteps(
481481
482 if (case.case.? == .Error and options.skip_compile_errors) continue;482 if (case.case.? == .Error and options.skip_compile_errors) continue;
483483
484 if (options.skip_non_native and !case.target.query.isNative())484 if (options.skip_non_native and !@import("../tests.zig").isNative(&case.target, &b.graph.host.result))
485 continue;485 continue;
486486
487 if (options.skip_spirv and case.target.query.cpu_arch != null and case.target.query.cpu_arch.?.isSpirV()) continue;487 if (options.skip_spirv and case.target.query.cpu_arch != null and case.target.query.cpu_arch.?.isSpirV()) continue;
test/tests.zig+137-19
...@@ -200,6 +200,7 @@ const module_test_targets = blk: {...@@ -200,6 +200,7 @@ const module_test_targets = blk: {
200 // .use_lld = false,200 // .use_lld = false,
201 // .optimize_mode = .ReleaseFast,201 // .optimize_mode = .ReleaseFast,
202 // .strip = true,202 // .strip = true,
203 // .skip_modules = &.{"std"}, // TODO get these passing
203 //},204 //},
204 //.{205 //.{
205 // .target = .{206 // .target = .{
...@@ -212,6 +213,7 @@ const module_test_targets = blk: {...@@ -212,6 +213,7 @@ const module_test_targets = blk: {
212 // .use_lld = false,213 // .use_lld = false,
213 // .optimize_mode = .ReleaseFast,214 // .optimize_mode = .ReleaseFast,
214 // .strip = true,215 // .strip = true,
216 // .skip_modules = &.{"std"}, // TODO get these passing
215 //},217 //},
216218
217 .{219 .{
...@@ -1609,6 +1611,8 @@ const module_test_targets = blk: {...@@ -1609,6 +1611,8 @@ const module_test_targets = blk: {
1609 .abi = .msvc,1611 .abi = .msvc,
1610 },1612 },
1611 .link_libc = true,1613 .link_libc = true,
1614 // https://codeberg.org/ziglang/zig/issues/35517
1615 .skip_modules = &.{"libc"},
1612 },1616 },
1613 .{1617 .{
1614 .target = .{1618 .target = .{
...@@ -1624,6 +1628,8 @@ const module_test_targets = blk: {...@@ -1624,6 +1628,8 @@ const module_test_targets = blk: {
1624 .abi = .gnu,1628 .abi = .gnu,
1625 },1629 },
1626 .link_libc = true,1630 .link_libc = true,
1631 // https://codeberg.org/ziglang/zig/issues/35517
1632 .skip_modules = &.{"libc"},
1627 },1633 },
16281634
1629 .{1635 .{
...@@ -1634,6 +1640,8 @@ const module_test_targets = blk: {...@@ -1634,6 +1640,8 @@ const module_test_targets = blk: {
1634 },1640 },
1635 .use_llvm = false,1641 .use_llvm = false,
1636 .use_lld = false,1642 .use_lld = false,
1643 // https://codeberg.org/ziglang/zig/issues/35537
1644 .skip_modules = &.{"behavior"},
1637 },1645 },
1638 .{1646 .{
1639 .target = .{1647 .target = .{
...@@ -1649,6 +1657,8 @@ const module_test_targets = blk: {...@@ -1649,6 +1657,8 @@ const module_test_targets = blk: {
1649 .abi = .msvc,1657 .abi = .msvc,
1650 },1658 },
1651 .link_libc = true,1659 .link_libc = true,
1660 // https://codeberg.org/ziglang/zig/issues/35517
1661 .skip_modules = &.{"libc"},
1652 },1662 },
1653 .{1663 .{
1654 .target = .{1664 .target = .{
...@@ -1989,13 +1999,14 @@ const c_abi_targets = blk: {...@@ -1989,13 +1999,14 @@ const c_abi_targets = blk: {
19891999
1990 // Windows Targets2000 // Windows Targets
19912001
1992 .{2002 // https://codeberg.org/ziglang/zig/issues/35521
1993 .target = .{2003 //.{
1994 .cpu_arch = .x86,2004 // .target = .{
1995 .os_tag = .windows,2005 // .cpu_arch = .x86,
1996 .abi = .gnu,2006 // .os_tag = .windows,
1997 },2007 // .abi = .gnu,
1998 },2008 // },
2009 //},
1999 .{2010 .{
2000 .target = .{2011 .target = .{
2001 .cpu_arch = .x86_64,2012 .cpu_arch = .x86_64,
...@@ -2026,8 +2037,7 @@ const incremental_targets: []const []const u8 = &.{...@@ -2026,8 +2037,7 @@ const incremental_targets: []const []const u8 = &.{
2026 //"wasm32-wasi-selfhosted",2037 //"wasm32-wasi-selfhosted",
2027};2038};
20282039
2029fn compatible32bitArch(b: *std.Build) ?std.Target.Cpu.Arch {2040fn compatible32bitArch(host: *const std.Target) ?std.Target.Cpu.Arch {
2030 const host = b.graph.host.result;
2031 return switch (host.os.tag) {2041 return switch (host.os.tag) {
2032 .windows => switch (host.cpu.arch) {2042 .windows => switch (host.cpu.arch) {
2033 .x86_64 => .x86,2043 .x86_64 => .x86,
...@@ -2050,6 +2060,108 @@ fn compatible32bitArch(b: *std.Build) ?std.Target.Cpu.Arch {...@@ -2050,6 +2060,108 @@ fn compatible32bitArch(b: *std.Build) ?std.Target.Cpu.Arch {
2050 };2060 };
2051}2061}
20522062
2063pub fn isNative(actual_target: *const std.Build.ResolvedTarget, host: *const std.Target) bool {
2064 if (actual_target.query.isNative()) return true;
2065 const actual = &actual_target.result;
2066
2067 if (actual.cpu.arch != host.cpu.arch and
2068 actual.cpu.arch != compatible32bitArch(host))
2069 {
2070 return false;
2071 }
2072
2073 if (actual.os.tag != host.os.tag)
2074 return false;
2075
2076 // Remove features that don't actually affect compatibility.
2077 const irrelevant: std.Target.Cpu.Feature.Set = switch (host.cpu.arch) {
2078 .x86_64 => std.Target.x86.featureSet(&.{
2079 .@"16bit_mode",
2080 .@"32bit_mode",
2081 .@"64bit",
2082 .false_deps_getmant,
2083 .false_deps_lzcnt_tzcnt,
2084 .false_deps_mulc,
2085 .false_deps_mullq,
2086 .false_deps_perm,
2087 .false_deps_popcnt,
2088 .false_deps_range,
2089 .fast_11bytenop,
2090 .fast_15bytenop,
2091 .fast_7bytenop,
2092 .fast_bextr,
2093 .fast_dpwssd,
2094 .fast_gather,
2095 .fast_hops,
2096 .fast_imm16,
2097 .fast_lzcnt,
2098 .fast_movbe,
2099 .fast_scalar_fsqrt,
2100 .fast_scalar_shift_masks,
2101 .fast_shld_rotate,
2102 .fast_variable_crosslane_shuffle,
2103 .fast_variable_perlane_shuffle,
2104 .fast_vector_fsqrt,
2105 .fast_vector_shift_masks,
2106 .faster_shift_than_shuffle,
2107 .no_bypass_delay,
2108 .no_bypass_delay_blend,
2109 .no_bypass_delay_mov,
2110 .no_bypass_delay_shuffle,
2111 .prefer_128_bit,
2112 .prefer_256_bit,
2113 .prefer_legacy_setcc,
2114 .prefer_mask_registers,
2115 .prefer_movmsk_over_vtest,
2116 .prefer_no_gather,
2117 .prefer_no_scatter,
2118 .slow_3ops_lea,
2119 .slow_incdec,
2120 .slow_lea,
2121 .slow_pmaddwd,
2122 .slow_pmulld,
2123 .slow_pmullq,
2124 .slow_shld,
2125 .slow_two_mem_ops,
2126 .slow_unaligned_mem_16,
2127 .slow_unaligned_mem_32,
2128 }),
2129 .aarch64, .aarch64_be => std.Target.aarch64.featureSet(&.{
2130 .addr_lsl_slow_14,
2131 .alu_lsl_fast,
2132 .avoid_ldapur,
2133 .disable_fast_inc_vl,
2134 .exynos_cheap_as_move,
2135 .fuse_address,
2136 .fuse_addsub_2reg_const1,
2137 .fuse_adrp_add,
2138 .fuse_aes,
2139 .fuse_arith_logic,
2140 .fuse_crypto_eor,
2141 .fuse_csel,
2142 .fuse_cset,
2143 .fuse_literals,
2144 .predictable_select_expensive,
2145 .slow_misaligned_128store,
2146 .slow_paired_128,
2147 .slow_strqro_store,
2148 .use_experimental_zeroing_pseudos,
2149 .use_fixed_over_scalable_if_equal_cost,
2150 .use_postra_scheduler,
2151 .use_reciprocal_square_root,
2152 .use_wzr_to_vec_move,
2153 }),
2154 else => .empty,
2155 };
2156 var set = actual.cpu.features;
2157 set.removeFeatureSet(irrelevant);
2158
2159 if (!host.cpu.features.isSuperSetOf(set))
2160 return false;
2161
2162 return true;
2163}
2164
2053/// For stack trace tests, we only test native by default, because external executors are pretty2165/// For stack trace tests, we only test native by default, because external executors are pretty
2054/// unreliable at stack tracing. However, if there's a 32-bit equivalent target which the host can2166/// unreliable at stack tracing. However, if there's a 32-bit equivalent target which the host can
2055/// trivially run, we may as well at least test that!2167/// trivially run, we may as well at least test that!
...@@ -2057,7 +2169,7 @@ fn nativeAndCompatible32bit(b: *std.Build, skip_non_native: bool) []const std.Bu...@@ -2057,7 +2169,7 @@ fn nativeAndCompatible32bit(b: *std.Build, skip_non_native: bool) []const std.Bu
2057 const host = b.graph.host.result;2169 const host = b.graph.host.result;
2058 const only_native = (&b.graph.host)[0..1];2170 const only_native = (&b.graph.host)[0..1];
2059 if (skip_non_native) return only_native;2171 if (skip_non_native) return only_native;
2060 const arch32 = compatible32bitArch(b) orelse return only_native;2172 const arch32 = compatible32bitArch(&b.graph.host.result) orelse return only_native;
2061 return b.graph.arena.dupe(std.Build.ResolvedTarget, &.{2173 return b.graph.arena.dupe(std.Build.ResolvedTarget, &.{
2062 b.graph.host,2174 b.graph.host,
2063 b.resolveTargetQuery(.{ .cpu_arch = arch32, .os_tag = host.os.tag }),2175 b.resolveTargetQuery(.{ .cpu_arch = arch32, .os_tag = host.os.tag }),
...@@ -2074,7 +2186,7 @@ fn wineAndCompatible32bit(b: *std.Build, skip_non_native: bool) []const std.Buil...@@ -2074,7 +2186,7 @@ fn wineAndCompatible32bit(b: *std.Build, skip_non_native: bool) []const std.Buil
2074 .os_tag = .windows,2186 .os_tag = .windows,
2075 })) catch @panic("OOM");2187 })) catch @panic("OOM");
2076 if (!skip_non_native) {2188 if (!skip_non_native) {
2077 if (compatible32bitArch(b)) |arch| {2189 if (compatible32bitArch(&b.graph.host.result)) |arch| {
2078 targets.append(b.graph.arena, b.resolveTargetQuery(.{2190 targets.append(b.graph.arena, b.resolveTargetQuery(.{
2079 .cpu_arch = arch,2191 .cpu_arch = arch,
2080 .os_tag = .windows,2192 .os_tag = .windows,
...@@ -2519,11 +2631,21 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -2519,11 +2631,21 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
25192631
2520 if (!options.test_extra_targets and test_target.extra_target) continue;2632 if (!options.test_extra_targets and test_target.extra_target) continue;
25212633
2522 if (options.skip_non_native and !test_target.target.isNative())2634 if (options.skip_non_native and !isNative(&resolved_target, &b.graph.host.result))
2523 continue;2635 continue;
25242636
2525 const target = &resolved_target.result;2637 const target = &resolved_target.result;
25262638
2639 if (target.cpu.arch == .powerpc64le and target.ofmt == .c) {
2640 // https://codeberg.org/ziglang/zig/issues/35522
2641 continue;
2642 }
2643
2644 if (target.cpu.arch == .s390x and target.ofmt == .c) {
2645 // https://codeberg.org/ziglang/zig/issues/35523
2646 continue;
2647 }
2648
2527 if (std.mem.eql(u8, options.name, "libc")) {2649 if (std.mem.eql(u8, options.name, "libc")) {
2528 // The libc API tests obviously need to link libc. So for test2650 // The libc API tests obviously need to link libc. So for test
2529 // target entries where we wouldn't link libc by default, skip the2651 // target entries where we wouldn't link libc by default, skip the
...@@ -2562,11 +2684,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -2562,11 +2684,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
2562 if (options.skip_single_threaded and test_target.single_threaded == true)2684 if (options.skip_single_threaded and test_target.single_threaded == true)
2563 continue;2685 continue;
25642686
2565 if (!would_use_llvm and target.cpu.arch == .aarch64) {
2566 // TODO get std tests passing for the aarch64 self-hosted backend.
2567 if (mem.eql(u8, options.name, "std")) continue;
2568 }
2569
2570 const want_this_mode = for (options.optimize_modes) |m| {2687 const want_this_mode = for (options.optimize_modes) |m| {
2571 if (m == test_target.optimize_mode) break true;2688 if (m == test_target.optimize_mode) break true;
2572 } else false;2689 } else false;
...@@ -2812,8 +2929,6 @@ pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step {...@@ -2812,8 +2929,6 @@ pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step {
2812 const step = b.step("test-c-abi", "Run the C ABI tests");2929 const step = b.step("test-c-abi", "Run the C ABI tests");
28132930
2814 for (c_abi_targets) |c_abi_target| {2931 for (c_abi_targets) |c_abi_target| {
2815 if (options.skip_non_native and !c_abi_target.target.isNative()) continue;
2816
2817 if (options.skip_wasm and c_abi_target.target.cpu_arch != null and c_abi_target.target.cpu_arch.?.isWasm()) continue;2932 if (options.skip_wasm and c_abi_target.target.cpu_arch != null and c_abi_target.target.cpu_arch.?.isWasm()) continue;
28182933
2819 if (options.skip_freebsd and c_abi_target.target.os_tag == .freebsd) continue;2934 if (options.skip_freebsd and c_abi_target.target.os_tag == .freebsd) continue;
...@@ -2827,6 +2942,9 @@ pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step {...@@ -2827,6 +2942,9 @@ pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step {
2827 const triple_txt = resolved_target.query.zigTriple(b.allocator) catch @panic("OOM");2942 const triple_txt = resolved_target.query.zigTriple(b.allocator) catch @panic("OOM");
2828 const target = &resolved_target.result;2943 const target = &resolved_target.result;
28292944
2945 if (options.skip_non_native and !isNative(&resolved_target, &b.graph.host.result))
2946 continue;
2947
2830 if (options.test_target_filters.len > 0) {2948 if (options.test_target_filters.len > 0) {
2831 for (options.test_target_filters) |filter| {2949 for (options.test_target_filters) |filter| {
2832 if (std.mem.indexOf(u8, triple_txt, filter) != null) break;2950 if (std.mem.indexOf(u8, triple_txt, filter) != null) break;