authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-04-17 12:04:30+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-04-17 12:04:30+02:00
logadb1f3efc21adad67fe2638c889178401ca602a1
treef97e5b53801052c8ff4f0062559aaf22865e3480
parentdcd9ddc7cffc397057c0d8268d10d22379871521
parent504ebf85c4c331b3edcf62bbe97963827ad254db

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

3 files changed, 41 insertions(+), 15 deletions(-)

lib/compiler_rt/limb64.zig+32
...@@ -152,6 +152,10 @@ fn test__addo_limb64(comptime T: type, a: T, b: T, expected: struct { T, bool })...@@ -152,6 +152,10 @@ fn test__addo_limb64(comptime T: type, a: T, b: T, expected: struct { T, bool })
152}152}
153153
154test __addo_limb64 {154test __addo_limb64 {
155 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
156 if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
157 if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
158
155 try test__addo_limb64(u64, 1, 2, .{ 3, false });159 try test__addo_limb64(u64, 1, 2, .{ 3, false });
156 try test__addo_limb64(u64, maxInt(u64), 2, .{ 1, true });160 try test__addo_limb64(u64, maxInt(u64), 2, .{ 1, true });
157 try test__addo_limb64(u65, maxInt(u65), 2, .{ 1, true });161 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 })...@@ -228,6 +232,10 @@ fn test__subo_limb64(comptime T: type, a: T, b: T, expected: struct { T, bool })
228}232}
229233
230test __subo_limb64 {234test __subo_limb64 {
235 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
236 if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
237 if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
238
231 try test__subo_limb64(u64, 3, 2, .{ 1, false });239 try test__subo_limb64(u64, 3, 2, .{ 1, false });
232 try test__subo_limb64(u64, 0, 1, .{ maxInt(u64), true });240 try test__subo_limb64(u64, 0, 1, .{ maxInt(u64), true });
233 try test__subo_limb64(u65, 0, 1, .{ maxInt(u65), true });241 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 {...@@ -477,6 +485,10 @@ fn test__not_limb64(comptime T: type, a: T, expected: T) !void {
477}485}
478486
479test __not_limb64 {487test __not_limb64 {
488 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
489 if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
490 if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
491
480 try test__not_limb64(u64, 1, maxInt(u64) - 1);492 try test__not_limb64(u64, 1, maxInt(u64) - 1);
481 try test__not_limb64(u64, 3, maxInt(u64) - 3);493 try test__not_limb64(u64, 3, maxInt(u64) - 3);
482 try test__not_limb64(u65, maxInt(u65), 0);494 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...@@ -555,6 +567,10 @@ fn test__shlo_limb64(comptime T: type, a: T, shift: u16, expected: struct { T, b
555}567}
556568
557test __shlo_limb64 {569test __shlo_limb64 {
570 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
571 if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
572 if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
573
558 try test__shlo_limb64(u64, 0x1234_5678_9ABC_DEF0, 4, .{ 0x2345_6789_ABCD_EF00, true });574 try test__shlo_limb64(u64, 0x1234_5678_9ABC_DEF0, 4, .{ 0x2345_6789_ABCD_EF00, true });
559 try test__shlo_limb64(u64, 0x8000_0000_0000_0001, 63, .{ 0x8000_0000_0000_0000, true });575 try test__shlo_limb64(u64, 0x8000_0000_0000_0001, 63, .{ 0x8000_0000_0000_0000, true });
560 try test__shlo_limb64(u65, 1, 64, .{ 0x1_0000_0000_0000_0000, false });576 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 {...@@ -631,6 +647,10 @@ fn test__shr_limb64(comptime T: type, a: T, shift: u16, expected: T) !void {
631}647}
632648
633test __shr_limb64 {649test __shr_limb64 {
650 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
651 if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
652 if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
653
634 try test__shr_limb64(u64, 0x1234_5678_9ABC_DEF0, 4, 0x0123_4567_89AB_CDEF);654 try test__shr_limb64(u64, 0x1234_5678_9ABC_DEF0, 4, 0x0123_4567_89AB_CDEF);
635 try test__shr_limb64(u64, 0x8000_0000_0000_0001, 63, 1);655 try test__shr_limb64(u64, 0x8000_0000_0000_0001, 63, 1);
636 try test__shr_limb64(u65, 0x1_0000_0000_0000_0000, 64, 1);656 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 {...@@ -858,6 +878,10 @@ fn test__bitreverse_limb64(comptime T: type, a: T, expected: T) !void {
858}878}
859879
860test __bitreverse_limb64 {880test __bitreverse_limb64 {
881 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
882 if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
883 if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
884
861 try test__bitreverse_limb64(u64, 1 << 7, 1 << 56);885 try test__bitreverse_limb64(u64, 1 << 7, 1 << 56);
862 try test__bitreverse_limb64(u65, 1 << 64, 1);886 try test__bitreverse_limb64(u65, 1 << 64, 1);
863 try test__bitreverse_limb64(u65, 1 << 9, 1 << 55);887 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 {...@@ -910,6 +934,10 @@ fn test__byteswap_limb64(comptime T: type, a: T, expected: T) !void {
910}934}
911935
912test __byteswap_limb64 {936test __byteswap_limb64 {
937 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
938 if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
939 if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
940
913 try test__byteswap_limb64(u64, 0x0123_4567_89AB_CDEF, 0xEFCD_AB89_6745_2301);941 try test__byteswap_limb64(u64, 0x0123_4567_89AB_CDEF, 0xEFCD_AB89_6745_2301);
914 try test__byteswap_limb64(u72, 0x01_23_45_67_89_AB_CD_EF_11, 0x11_EF_CD_AB_89_67_45_23_01);942 try test__byteswap_limb64(u72, 0x01_23_45_67_89_AB_CD_EF_11, 0x11_EF_CD_AB_89_67_45_23_01);
915 try test__byteswap_limb64(u128, 1 << 72, 1 << 48);943 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 })...@@ -1036,6 +1064,10 @@ fn test__mulo_limb64(comptime T: type, a: T, b: T, expected: struct { T, bool })
1036}1064}
10371065
1038test __mulo_limb64 {1066test __mulo_limb64 {
1067 if (builtin.cpu.arch == .aarch64_be) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
1068 if (builtin.cpu.arch == .mips64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
1069 if (builtin.cpu.arch == .powerpc64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31905
1070
1039 try test__mulo_limb64(u64, 3, 5, .{ 15, false });1071 try test__mulo_limb64(u64, 3, 5, .{ 15, false });
1040 try test__mulo_limb64(u64, maxInt(u64), 2, .{ maxInt(u64) - 1, true });1072 try test__mulo_limb64(u64, maxInt(u64), 2, .{ maxInt(u64) - 1, true });
1041 try test__mulo_limb64(u65, 1 << 32, 1 << 32, .{ 1 << 64, false });1073 try test__mulo_limb64(u65, 1 << 32, 1 << 32, .{ 1 << 64, false });
src/codegen/c.zig+1-1
...@@ -1629,7 +1629,7 @@ pub const DeclGen = struct {...@@ -1629,7 +1629,7 @@ pub const DeclGen = struct {
1629 if (func_analysis.branch_hint == .cold)1629 if (func_analysis.branch_hint == .cold)
1630 try w.writeAll("zig_cold ");1630 try w.writeAll("zig_cold ");
16311631
1632 if (kind == .definition and func_analysis.disable_intrinsics or dg.mod.no_builtin)1632 if (kind == .definition and (func_analysis.disable_intrinsics or dg.mod.no_builtin))
1633 try w.writeAll("zig_no_builtin ");1633 try w.writeAll("zig_no_builtin ");
1634 }1634 }
16351635
test/tests.zig+8-14
...@@ -2523,19 +2523,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -2523,19 +2523,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
2523 const would_use_llvm = wouldUseLlvm(test_target.use_llvm, test_target.target, test_target.optimize_mode);2523 const would_use_llvm = wouldUseLlvm(test_target.use_llvm, test_target.target, test_target.optimize_mode);
2524 if (options.skip_llvm and would_use_llvm) continue;2524 if (options.skip_llvm and would_use_llvm) continue;
25252525
2526 if (would_use_llvm and (mem.eql(u8, options.name, "compiler-rt") or mem.eql(u8, options.name, "zigc"))) {
2527 switch (test_target.optimize_mode) {
2528 .Debug, .ReleaseSafe => {
2529 // LLVM 21 is affected by multiple bugs in safe builds of compiler-rt:
2530 // * https://codeberg.org/ziglang/zig/issues/31701
2531 // * https://codeberg.org/ziglang/zig/issues/31702
2532 // ...so for now, skip these tests.
2533 continue;
2534 },
2535 .ReleaseSmall, .ReleaseFast => {},
2536 }
2537 }
2538
2539 const triple_txt = resolved_target.query.zigTriple(b.allocator) catch @panic("OOM");2526 const triple_txt = resolved_target.query.zigTriple(b.allocator) catch @panic("OOM");
25402527
2541 if (options.test_target_filters.len > 0) {2528 if (options.test_target_filters.len > 0) {
...@@ -2610,7 +2597,14 @@ fn addOneModuleTest(...@@ -2610,7 +2597,14 @@ fn addOneModuleTest(
2610 .zig_lib_dir = b.path("lib"),2597 .zig_lib_dir = b.path("lib"),
2611 });2598 });
2612 these_tests.linkage = test_target.linkage;2599 these_tests.linkage = test_target.linkage;
2613 if (options.no_builtin) these_tests.root_module.no_builtin = true;2600 // https://codeberg.org/ziglang/zig/issues/31701
2601 if (!(mem.eql(u8, options.name, "compiler-rt") or mem.eql(u8, options.name, "zigc"))) {
2602 if (options.no_builtin) these_tests.root_module.no_builtin = true;
2603 }
2604 // https://codeberg.org/ziglang/zig/issues/31702
2605 if (mem.eql(u8, options.name, "compiler-rt") or mem.eql(u8, options.name, "zigc")) {
2606 these_tests.root_module.stack_protector = false;
2607 }
2614 if (options.build_options) |build_options| {2608 if (options.build_options) |build_options| {
2615 these_tests.root_module.addOptions("build_options", build_options);2609 these_tests.root_module.addOptions("build_options", build_options);
2616 }2610 }