Merge pull request 'test: reinstate compiler-rt and zigc tests with different LLVM bug workarounds' (#31909) from alexrp/zig:reinstate-tests into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31909
This commit is contained in:
Alex Rønne Petersen
2026-04-17 12:04:30 +02:00
3 changed files with 41 additions and 15 deletions
+32
View File
@@ -152,6 +152,10 @@ fn test__addo_limb64(comptime T: type, a: T, b: T, expected: struct { T, bool })
}
test __addo_limb64 {
if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
try test__addo_limb64(u64, 1, 2, .{ 3, false });
try test__addo_limb64(u64, maxInt(u64), 2, .{ 1, true });
try test__addo_limb64(u65, maxInt(u65), 2, .{ 1, true });
@@ -228,6 +232,10 @@ fn test__subo_limb64(comptime T: type, a: T, b: T, expected: struct { T, bool })
}
test __subo_limb64 {
if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
try test__subo_limb64(u64, 3, 2, .{ 1, false });
try test__subo_limb64(u64, 0, 1, .{ maxInt(u64), true });
try test__subo_limb64(u65, 0, 1, .{ maxInt(u65), true });
@@ -477,6 +485,10 @@ fn test__not_limb64(comptime T: type, a: T, expected: T) !void {
}
test __not_limb64 {
if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
try test__not_limb64(u64, 1, maxInt(u64) - 1);
try test__not_limb64(u64, 3, maxInt(u64) - 3);
try test__not_limb64(u65, maxInt(u65), 0);
@@ -555,6 +567,10 @@ fn test__shlo_limb64(comptime T: type, a: T, shift: u16, expected: struct { T, b
}
test __shlo_limb64 {
if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
try test__shlo_limb64(u64, 0x1234_5678_9ABC_DEF0, 4, .{ 0x2345_6789_ABCD_EF00, true });
try test__shlo_limb64(u64, 0x8000_0000_0000_0001, 63, .{ 0x8000_0000_0000_0000, true });
try test__shlo_limb64(u65, 1, 64, .{ 0x1_0000_0000_0000_0000, false });
@@ -631,6 +647,10 @@ fn test__shr_limb64(comptime T: type, a: T, shift: u16, expected: T) !void {
}
test __shr_limb64 {
if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
try test__shr_limb64(u64, 0x1234_5678_9ABC_DEF0, 4, 0x0123_4567_89AB_CDEF);
try test__shr_limb64(u64, 0x8000_0000_0000_0001, 63, 1);
try test__shr_limb64(u65, 0x1_0000_0000_0000_0000, 64, 1);
@@ -858,6 +878,10 @@ fn test__bitreverse_limb64(comptime T: type, a: T, expected: T) !void {
}
test __bitreverse_limb64 {
if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
try test__bitreverse_limb64(u64, 1 << 7, 1 << 56);
try test__bitreverse_limb64(u65, 1 << 64, 1);
try test__bitreverse_limb64(u65, 1 << 9, 1 << 55);
@@ -910,6 +934,10 @@ fn test__byteswap_limb64(comptime T: type, a: T, expected: T) !void {
}
test __byteswap_limb64 {
if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
try test__byteswap_limb64(u64, 0x0123_4567_89AB_CDEF, 0xEFCD_AB89_6745_2301);
try test__byteswap_limb64(u72, 0x01_23_45_67_89_AB_CD_EF_11, 0x11_EF_CD_AB_89_67_45_23_01);
try test__byteswap_limb64(u128, 1 << 72, 1 << 48);
@@ -1036,6 +1064,10 @@ fn test__mulo_limb64(comptime T: type, a: T, b: T, expected: struct { T, bool })
}
test __mulo_limb64 {
if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
try test__mulo_limb64(u64, 3, 5, .{ 15, false });
try test__mulo_limb64(u64, maxInt(u64), 2, .{ maxInt(u64) - 1, true });
try test__mulo_limb64(u65, 1 << 32, 1 << 32, .{ 1 << 64, false });
+1 -1
View File
@@ -1629,7 +1629,7 @@ pub const DeclGen = struct {
if (func_analysis.branch_hint == .cold)
try w.writeAll("zig_cold ");
if (kind == .definition and func_analysis.disable_intrinsics or dg.mod.no_builtin)
if (kind == .definition and (func_analysis.disable_intrinsics or dg.mod.no_builtin))
try w.writeAll("zig_no_builtin ");
}
+8 -14
View File
@@ -2523,19 +2523,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
const would_use_llvm = wouldUseLlvm(test_target.use_llvm, test_target.target, test_target.optimize_mode);
if (options.skip_llvm and would_use_llvm) continue;
if (would_use_llvm and (mem.eql(u8, options.name, "compiler-rt") or mem.eql(u8, options.name, "zigc"))) {
switch (test_target.optimize_mode) {
.Debug, .ReleaseSafe => {
// LLVM 21 is affected by multiple bugs in safe builds of compiler-rt:
// * https://codeberg.org/ziglang/zig/issues/31701
// * https://codeberg.org/ziglang/zig/issues/31702
// ...so for now, skip these tests.
continue;
},
.ReleaseSmall, .ReleaseFast => {},
}
}
const triple_txt = resolved_target.query.zigTriple(b.allocator) catch @panic("OOM");
if (options.test_target_filters.len > 0) {
@@ -2610,7 +2597,14 @@ fn addOneModuleTest(
.zig_lib_dir = b.path("lib"),
});
these_tests.linkage = test_target.linkage;
if (options.no_builtin) these_tests.root_module.no_builtin = true;
// https://codeberg.org/ziglang/zig/issues/31701
if (!(mem.eql(u8, options.name, "compiler-rt") or mem.eql(u8, options.name, "zigc"))) {
if (options.no_builtin) these_tests.root_module.no_builtin = true;
}
// https://codeberg.org/ziglang/zig/issues/31702
if (mem.eql(u8, options.name, "compiler-rt") or mem.eql(u8, options.name, "zigc")) {
these_tests.root_module.stack_protector = false;
}
if (options.build_options) |build_options| {
these_tests.root_module.addOptions("build_options", build_options);
}