authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-15 22:23:48-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-08-15 22:23:48-07:00
log11176d22f82861b4b6967b77f753414f214bc632
tree9057a36dc881cb5d8b87ca00119b5bee3b9605fd
parent05c7968920c6a74debe407c2ea8c23cd60d89611
parent55cc9dda66a24ed2a86a358533ecf5840d47b3d7
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #21073 from alexrp/test-changes

`test`: QoL for port work, more mips re-enablement

14 files changed, 140 insertions(+), 69 deletions(-)

build.zig+44-28
...@@ -379,6 +379,8 @@ pub fn build(b: *std.Build) !void {...@@ -379,6 +379,8 @@ pub fn build(b: *std.Build) !void {
379 }379 }
380380
381 const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{};381 const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{};
382 const test_target_filters = b.option([]const []const u8, "test-target-filter", "Skip tests whose target triple do not match any filter") orelse &[0][]const u8{};
383 const test_slow_targets = b.option(bool, "test-slow-targets", "Enable running module tests for targets that have a slow compiler backend") orelse false;
382384
383 const test_cases_options = b.addOptions();385 const test_cases_options = b.addOptions();
384386
...@@ -455,8 +457,12 @@ pub fn build(b: *std.Build) !void {...@@ -455,8 +457,12 @@ pub fn build(b: *std.Build) !void {
455 });457 });
456 test_step.dependOn(test_cases_step);458 test_step.dependOn(test_cases_step);
457459
458 test_step.dependOn(tests.addModuleTests(b, .{460 const test_modules_step = b.step("test-modules", "Run the per-target module tests");
461
462 test_modules_step.dependOn(tests.addModuleTests(b, .{
459 .test_filters = test_filters,463 .test_filters = test_filters,
464 .test_target_filters = test_target_filters,
465 .test_slow_targets = test_slow_targets,
460 .root_src = "test/behavior.zig",466 .root_src = "test/behavior.zig",
461 .name = "behavior",467 .name = "behavior",
462 .desc = "Run the behavior tests",468 .desc = "Run the behavior tests",
...@@ -468,8 +474,10 @@ pub fn build(b: *std.Build) !void {...@@ -468,8 +474,10 @@ pub fn build(b: *std.Build) !void {
468 .max_rss = 1 * 1024 * 1024 * 1024,474 .max_rss = 1 * 1024 * 1024 * 1024,
469 }));475 }));
470476
471 test_step.dependOn(tests.addModuleTests(b, .{477 test_modules_step.dependOn(tests.addModuleTests(b, .{
472 .test_filters = test_filters,478 .test_filters = test_filters,
479 .test_target_filters = test_target_filters,
480 .test_slow_targets = test_slow_targets,
473 .root_src = "test/c_import.zig",481 .root_src = "test/c_import.zig",
474 .name = "c-import",482 .name = "c-import",
475 .desc = "Run the @cImport tests",483 .desc = "Run the @cImport tests",
...@@ -480,8 +488,10 @@ pub fn build(b: *std.Build) !void {...@@ -480,8 +488,10 @@ pub fn build(b: *std.Build) !void {
480 .skip_libc = skip_libc,488 .skip_libc = skip_libc,
481 }));489 }));
482490
483 test_step.dependOn(tests.addModuleTests(b, .{491 test_modules_step.dependOn(tests.addModuleTests(b, .{
484 .test_filters = test_filters,492 .test_filters = test_filters,
493 .test_target_filters = test_target_filters,
494 .test_slow_targets = test_slow_targets,
485 .root_src = "lib/compiler_rt.zig",495 .root_src = "lib/compiler_rt.zig",
486 .name = "compiler-rt",496 .name = "compiler-rt",
487 .desc = "Run the compiler_rt tests",497 .desc = "Run the compiler_rt tests",
...@@ -493,8 +503,10 @@ pub fn build(b: *std.Build) !void {...@@ -493,8 +503,10 @@ pub fn build(b: *std.Build) !void {
493 .no_builtin = true,503 .no_builtin = true,
494 }));504 }));
495505
496 test_step.dependOn(tests.addModuleTests(b, .{506 test_modules_step.dependOn(tests.addModuleTests(b, .{
497 .test_filters = test_filters,507 .test_filters = test_filters,
508 .test_target_filters = test_target_filters,
509 .test_slow_targets = test_slow_targets,
498 .root_src = "lib/c.zig",510 .root_src = "lib/c.zig",
499 .name = "universal-libc",511 .name = "universal-libc",
500 .desc = "Run the universal libc tests",512 .desc = "Run the universal libc tests",
...@@ -506,6 +518,24 @@ pub fn build(b: *std.Build) !void {...@@ -506,6 +518,24 @@ pub fn build(b: *std.Build) !void {
506 .no_builtin = true,518 .no_builtin = true,
507 }));519 }));
508520
521 test_modules_step.dependOn(tests.addModuleTests(b, .{
522 .test_filters = test_filters,
523 .test_target_filters = test_target_filters,
524 .test_slow_targets = test_slow_targets,
525 .root_src = "lib/std/std.zig",
526 .name = "std",
527 .desc = "Run the standard library tests",
528 .optimize_modes = optimization_modes,
529 .include_paths = &.{},
530 .skip_single_threaded = skip_single_threaded,
531 .skip_non_native = skip_non_native,
532 .skip_libc = skip_libc,
533 // I observed a value of 4572626944 on the M2 CI.
534 .max_rss = 5029889638,
535 }));
536
537 test_step.dependOn(test_modules_step);
538
509 test_step.dependOn(tests.addCompareOutputTests(b, test_filters, optimization_modes));539 test_step.dependOn(tests.addCompareOutputTests(b, test_filters, optimization_modes));
510 test_step.dependOn(tests.addStandaloneTests(540 test_step.dependOn(tests.addStandaloneTests(
511 b,541 b,
...@@ -519,39 +549,25 @@ pub fn build(b: *std.Build) !void {...@@ -519,39 +549,25 @@ pub fn build(b: *std.Build) !void {
519 test_step.dependOn(tests.addStackTraceTests(b, test_filters, optimization_modes));549 test_step.dependOn(tests.addStackTraceTests(b, test_filters, optimization_modes));
520 test_step.dependOn(tests.addCliTests(b));550 test_step.dependOn(tests.addCliTests(b));
521 test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filters, optimization_modes));551 test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filters, optimization_modes));
522 test_step.dependOn(tests.addModuleTests(b, .{
523 .test_filters = test_filters,
524 .root_src = "lib/std/std.zig",
525 .name = "std",
526 .desc = "Run the standard library tests",
527 .optimize_modes = optimization_modes,
528 .include_paths = &.{},
529 .skip_single_threaded = skip_single_threaded,
530 .skip_non_native = skip_non_native,
531 .skip_libc = skip_libc,
532 // I observed a value of 4572626944 on the M2 CI.
533 .max_rss = 5029889638,
534 }));
535552
536 try addWasiUpdateStep(b, version);553 try addWasiUpdateStep(b, version);
537554
538 const update_mingw_step = b.step("update-mingw", "Update zig's bundled mingw");555 const update_mingw_step = b.step("update-mingw", "Update zig's bundled mingw");
539 const opt_mingw_src_path = b.option([]const u8, "mingw-src", "path to mingw-w64 source directory");556 const opt_mingw_src_path = b.option([]const u8, "mingw-src", "path to mingw-w64 source directory");
540 const update_mingw_exe = b.addExecutable(.{
541 .name = "update_mingw",
542 .target = b.graph.host,
543 .root_source_file = b.path("tools/update_mingw.zig"),
544 });
545 const update_mingw_run = b.addRunArtifact(update_mingw_exe);
546 update_mingw_run.addDirectoryArg(b.path("lib"));
547 if (opt_mingw_src_path) |mingw_src_path| {557 if (opt_mingw_src_path) |mingw_src_path| {
558 const update_mingw_exe = b.addExecutable(.{
559 .name = "update_mingw",
560 .target = b.graph.host,
561 .root_source_file = b.path("tools/update_mingw.zig"),
562 });
563 const update_mingw_run = b.addRunArtifact(update_mingw_exe);
564 update_mingw_run.addDirectoryArg(b.path("lib"));
548 update_mingw_run.addDirectoryArg(.{ .cwd_relative = mingw_src_path });565 update_mingw_run.addDirectoryArg(.{ .cwd_relative = mingw_src_path });
566
567 update_mingw_step.dependOn(&update_mingw_run.step);
549 } else {568 } else {
550 // Intentionally cause an error if this build step is requested.569 update_mingw_step.dependOn(&b.addFail("The -Dmingw-src=... option is required for this step").step);
551 update_mingw_run.addArg("--missing-mingw-source-directory");
552 }570 }
553
554 update_mingw_step.dependOn(&update_mingw_run.step);
555}571}
556572
557fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void {573fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void {
ci/aarch64-linux-debug.sh+2-1
...@@ -62,7 +62,8 @@ stage3-debug/bin/zig build test docs \...@@ -62,7 +62,8 @@ stage3-debug/bin/zig build test docs \
62 -Dtarget=native-native-musl \62 -Dtarget=native-native-musl \
63 --search-prefix "$PREFIX" \63 --search-prefix "$PREFIX" \
64 --zig-lib-dir "$PWD/../lib" \64 --zig-lib-dir "$PWD/../lib" \
65 -Denable-tidy65 -Denable-tidy \
66 -Dtest-slow-targets
6667
67# Ensure that updating the wasm binary from this commit will result in a viable build.68# Ensure that updating the wasm binary from this commit will result in a viable build.
68stage3-debug/bin/zig build update-zig169stage3-debug/bin/zig build update-zig1
ci/aarch64-linux-release.sh+2-1
...@@ -62,7 +62,8 @@ stage3-release/bin/zig build test docs \...@@ -62,7 +62,8 @@ stage3-release/bin/zig build test docs \
62 -Dtarget=native-native-musl \62 -Dtarget=native-native-musl \
63 --search-prefix "$PREFIX" \63 --search-prefix "$PREFIX" \
64 --zig-lib-dir "$PWD/../lib" \64 --zig-lib-dir "$PWD/../lib" \
65 -Denable-tidy65 -Denable-tidy \
66 -Dtest-slow-targets
6667
67# Ensure that stage3 and stage4 are byte-for-byte identical.68# Ensure that stage3 and stage4 are byte-for-byte identical.
68stage3-release/bin/zig build \69stage3-release/bin/zig build \
ci/aarch64-macos-debug.sh+2-1
...@@ -55,4 +55,5 @@ stage3-debug/bin/zig build test docs \...@@ -55,4 +55,5 @@ stage3-debug/bin/zig build test docs \
55 -Denable-macos-sdk \55 -Denable-macos-sdk \
56 -Dstatic-llvm \56 -Dstatic-llvm \
57 -Dskip-non-native \57 -Dskip-non-native \
58 --search-prefix "$PREFIX"58 --search-prefix "$PREFIX" \
59 -Dtest-slow-targets
ci/aarch64-macos-release.sh+2-1
...@@ -55,7 +55,8 @@ stage3-release/bin/zig build test docs \...@@ -55,7 +55,8 @@ stage3-release/bin/zig build test docs \
55 -Denable-macos-sdk \55 -Denable-macos-sdk \
56 -Dstatic-llvm \56 -Dstatic-llvm \
57 -Dskip-non-native \57 -Dskip-non-native \
58 --search-prefix "$PREFIX"58 --search-prefix "$PREFIX" \
59 -Dtest-slow-targets
5960
60# Ensure that stage3 and stage4 are byte-for-byte identical.61# Ensure that stage3 and stage4 are byte-for-byte identical.
61stage3-release/bin/zig build \62stage3-release/bin/zig build \
ci/aarch64-windows.ps1+2-1
...@@ -67,7 +67,8 @@ Write-Output "Main test suite..."...@@ -67,7 +67,8 @@ Write-Output "Main test suite..."
67 --search-prefix "$PREFIX_PATH" `67 --search-prefix "$PREFIX_PATH" `
68 -Dstatic-llvm `68 -Dstatic-llvm `
69 -Dskip-non-native `69 -Dskip-non-native `
70 -Denable-symlinks-windows70 -Denable-symlinks-windows `
71 -Dtest-slow-targets
71CheckLastExitCode72CheckLastExitCode
7273
73# Ensure that stage3 and stage4 are byte-for-byte identical.74# Ensure that stage3 and stage4 are byte-for-byte identical.
ci/x86_64-linux-debug.sh+2-1
...@@ -70,7 +70,8 @@ stage3-debug/bin/zig build test docs \...@@ -70,7 +70,8 @@ stage3-debug/bin/zig build test docs \
70 -Dtarget=native-native-musl \70 -Dtarget=native-native-musl \
71 --search-prefix "$PREFIX" \71 --search-prefix "$PREFIX" \
72 --zig-lib-dir "$PWD/../lib" \72 --zig-lib-dir "$PWD/../lib" \
73 -Denable-tidy73 -Denable-tidy \
74 -Dtest-slow-targets
7475
75# Ensure that updating the wasm binary from this commit will result in a viable build.76# Ensure that updating the wasm binary from this commit will result in a viable build.
76stage3-debug/bin/zig build update-zig177stage3-debug/bin/zig build update-zig1
ci/x86_64-linux-release.sh+2-1
...@@ -70,7 +70,8 @@ stage3-release/bin/zig build test docs \...@@ -70,7 +70,8 @@ stage3-release/bin/zig build test docs \
70 -Dtarget=native-native-musl \70 -Dtarget=native-native-musl \
71 --search-prefix "$PREFIX" \71 --search-prefix "$PREFIX" \
72 --zig-lib-dir "$PWD/../lib" \72 --zig-lib-dir "$PWD/../lib" \
73 -Denable-tidy73 -Denable-tidy \
74 -Dtest-slow-targets
7475
75# Ensure that stage3 and stage4 are byte-for-byte identical.76# Ensure that stage3 and stage4 are byte-for-byte identical.
76stage3-release/bin/zig build \77stage3-release/bin/zig build \
ci/x86_64-macos-release.sh+2-1
...@@ -59,7 +59,8 @@ stage3/bin/zig build test docs \...@@ -59,7 +59,8 @@ stage3/bin/zig build test docs \
59 -Denable-macos-sdk \59 -Denable-macos-sdk \
60 -Dstatic-llvm \60 -Dstatic-llvm \
61 -Dskip-non-native \61 -Dskip-non-native \
62 --search-prefix "$PREFIX"62 --search-prefix "$PREFIX" \
63 -Dtest-slow-targets
6364
64# Ensure that stage3 and stage4 are byte-for-byte identical.65# Ensure that stage3 and stage4 are byte-for-byte identical.
65stage3/bin/zig build \66stage3/bin/zig build \
ci/x86_64-windows-debug.ps1+2-1
...@@ -68,7 +68,8 @@ Write-Output "Main test suite..."...@@ -68,7 +68,8 @@ Write-Output "Main test suite..."
68 -Dstatic-llvm `68 -Dstatic-llvm `
69 -Dskip-non-native `69 -Dskip-non-native `
70 -Dskip-release `70 -Dskip-release `
71 -Denable-symlinks-windows71 -Denable-symlinks-windows `
72 -Dtest-slow-targets
72CheckLastExitCode73CheckLastExitCode
7374
74Write-Output "Build x86_64-windows-msvc behavior tests using the C backend..."75Write-Output "Build x86_64-windows-msvc behavior tests using the C backend..."
ci/x86_64-windows-release.ps1+2-1
...@@ -67,7 +67,8 @@ Write-Output "Main test suite..."...@@ -67,7 +67,8 @@ Write-Output "Main test suite..."
67 --search-prefix "$PREFIX_PATH" `67 --search-prefix "$PREFIX_PATH" `
68 -Dstatic-llvm `68 -Dstatic-llvm `
69 -Dskip-non-native `69 -Dskip-non-native `
70 -Denable-symlinks-windows70 -Denable-symlinks-windows `
71 -Dtest-slow-targets
71CheckLastExitCode72CheckLastExitCode
7273
73# Ensure that stage3 and stage4 are byte-for-byte identical.74# Ensure that stage3 and stage4 are byte-for-byte identical.
lib/std/zig/system.zig+20-4
...@@ -86,21 +86,37 @@ pub fn getExternalExecutor(...@@ -86,21 +86,37 @@ pub fn getExternalExecutor(
86 .arm => Executor{ .qemu = "qemu-arm" },86 .arm => Executor{ .qemu = "qemu-arm" },
87 .armeb => Executor{ .qemu = "qemu-armeb" },87 .armeb => Executor{ .qemu = "qemu-armeb" },
88 .hexagon => Executor{ .qemu = "qemu-hexagon" },88 .hexagon => Executor{ .qemu = "qemu-hexagon" },
89 .x86 => Executor{ .qemu = "qemu-i386" },
90 .m68k => Executor{ .qemu = "qemu-m68k" },89 .m68k => Executor{ .qemu = "qemu-m68k" },
91 .mips => Executor{ .qemu = "qemu-mips" },90 .mips => Executor{ .qemu = "qemu-mips" },
92 .mipsel => Executor{ .qemu = "qemu-mipsel" },91 .mipsel => Executor{ .qemu = "qemu-mipsel" },
93 .mips64 => Executor{ .qemu = "qemu-mips64" },92 .mips64 => Executor{
94 .mips64el => Executor{ .qemu = "qemu-mips64el" },93 .qemu = if (candidate.abi == .gnuabin32)
94 "qemu-mipsn32"
95 else
96 "qemu-mips64",
97 },
98 .mips64el => Executor{
99 .qemu = if (candidate.abi == .gnuabin32)
100 "qemu-mipsn32el"
101 else
102 "qemu-mips64el",
103 },
95 .powerpc => Executor{ .qemu = "qemu-ppc" },104 .powerpc => Executor{ .qemu = "qemu-ppc" },
96 .powerpc64 => Executor{ .qemu = "qemu-ppc64" },105 .powerpc64 => Executor{ .qemu = "qemu-ppc64" },
97 .powerpc64le => Executor{ .qemu = "qemu-ppc64le" },106 .powerpc64le => Executor{ .qemu = "qemu-ppc64le" },
98 .riscv32 => Executor{ .qemu = "qemu-riscv32" },107 .riscv32 => Executor{ .qemu = "qemu-riscv32" },
99 .riscv64 => Executor{ .qemu = "qemu-riscv64" },108 .riscv64 => Executor{ .qemu = "qemu-riscv64" },
100 .s390x => Executor{ .qemu = "qemu-s390x" },109 .s390x => Executor{ .qemu = "qemu-s390x" },
101 .sparc => Executor{ .qemu = "qemu-sparc" },110 .sparc => Executor{
111 .qemu = if (std.Target.sparc.featureSetHas(candidate.cpu.features, .v9))
112 "qemu-sparc32plus"
113 else
114 "qemu-sparc",
115 },
102 .sparc64 => Executor{ .qemu = "qemu-sparc64" },116 .sparc64 => Executor{ .qemu = "qemu-sparc64" },
117 .x86 => Executor{ .qemu = "qemu-i386" },
103 .x86_64 => Executor{ .qemu = "qemu-x86_64" },118 .x86_64 => Executor{ .qemu = "qemu-x86_64" },
119 .xtensa => Executor{ .qemu = "qemu-xtensa" },
104 else => return bad_result,120 else => return bad_result,
105 };121 };
106 }122 }
src/codegen/llvm.zig+13-2
...@@ -11787,7 +11787,9 @@ fn backendSupportsF16(target: std.Target) bool {...@@ -11787,7 +11787,9 @@ fn backendSupportsF16(target: std.Target) bool {
11787 .mips64el,11787 .mips64el,
11788 .s390x,11788 .s390x,
11789 => false,11789 => false,
11790 .aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8),11790 .aarch64,
11791 .aarch64_be,
11792 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8),
11791 else => true,11793 else => true,
11792 };11794 };
11793}11795}
...@@ -11798,9 +11800,18 @@ fn backendSupportsF16(target: std.Target) bool {...@@ -11798,9 +11800,18 @@ fn backendSupportsF16(target: std.Target) bool {
11798fn backendSupportsF128(target: std.Target) bool {11800fn backendSupportsF128(target: std.Target) bool {
11799 return switch (target.cpu.arch) {11801 return switch (target.cpu.arch) {
11800 .amdgcn,11802 .amdgcn,
11803 .mips64,
11804 .mips64el,
11801 .sparc,11805 .sparc,
11802 => false,11806 => false,
11803 .aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8),11807 .powerpc,
11808 .powerpcle,
11809 .powerpc64,
11810 .powerpc64le,
11811 => target.os.tag != .aix,
11812 .aarch64,
11813 .aarch64_be,
11814 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8),
11804 else => true,11815 else => true,
11805 };11816 };
11806}11817}
test/tests.zig+43-25
...@@ -27,6 +27,12 @@ const TestTarget = struct {...@@ -27,6 +27,12 @@ const TestTarget = struct {
27 use_lld: ?bool = null,27 use_lld: ?bool = null,
28 pic: ?bool = null,28 pic: ?bool = null,
29 strip: ?bool = null,29 strip: ?bool = null,
30
31 // This is intended for targets that are known to be slow to compile. These are acceptable to
32 // run in CI, but should not be run on developer machines by default. As an example, at the time
33 // of writing, this includes LLVM's MIPS backend which takes upwards of 20 minutes longer to
34 // compile tests than other backends.
35 slow_backend: bool = false,
30};36};
3137
32const test_targets = blk: {38const test_targets = blk: {
...@@ -310,8 +316,8 @@ const test_targets = blk: {...@@ -310,8 +316,8 @@ const test_targets = blk: {
310 .os_tag = .linux,316 .os_tag = .linux,
311 .abi = .none,317 .abi = .none,
312 },318 },
319 .slow_backend = true,
313 },320 },
314
315 .{321 .{
316 .target = .{322 .target = .{
317 .cpu_arch = .mips,323 .cpu_arch = .mips,
...@@ -319,17 +325,17 @@ const test_targets = blk: {...@@ -319,17 +325,17 @@ const test_targets = blk: {
319 .abi = .musl,325 .abi = .musl,
320 },326 },
321 .link_libc = true,327 .link_libc = true,
328 .slow_backend = true,
329 },
330 .{
331 .target = .{
332 .cpu_arch = .mips,
333 .os_tag = .linux,
334 .abi = .gnueabihf,
335 },
336 .link_libc = true,
337 .slow_backend = true,
322 },338 },
323
324 // https://github.com/ziglang/zig/issues/4927
325 //.{
326 // .target = .{
327 // .cpu_arch = .mips,
328 // .os_tag = .linux,
329 // .abi = .gnueabihf,
330 // },
331 // .link_libc = true,
332 //},
333339
334 .{340 .{
335 .target = .{341 .target = .{
...@@ -337,8 +343,8 @@ const test_targets = blk: {...@@ -337,8 +343,8 @@ const test_targets = blk: {
337 .os_tag = .linux,343 .os_tag = .linux,
338 .abi = .none,344 .abi = .none,
339 },345 },
346 .slow_backend = true,
340 },347 },
341
342 .{348 .{
343 .target = .{349 .target = .{
344 .cpu_arch = .mipsel,350 .cpu_arch = .mipsel,
...@@ -346,17 +352,17 @@ const test_targets = blk: {...@@ -346,17 +352,17 @@ const test_targets = blk: {
346 .abi = .musl,352 .abi = .musl,
347 },353 },
348 .link_libc = true,354 .link_libc = true,
355 .slow_backend = true,
356 },
357 .{
358 .target = .{
359 .cpu_arch = .mipsel,
360 .os_tag = .linux,
361 .abi = .gnueabihf,
362 },
363 .link_libc = true,
364 .slow_backend = true,
349 },365 },
350
351 // https://github.com/ziglang/zig/issues/4927
352 //.{
353 // .target = .{
354 // .cpu_arch = .mipsel,
355 // .os_tag = .linux,
356 // .abi = .gnueabihf,
357 // },
358 // .link_libc = true,
359 //},
360366
361 .{367 .{
362 .target = .{368 .target = .{
...@@ -407,7 +413,8 @@ const test_targets = blk: {...@@ -407,7 +413,8 @@ const test_targets = blk: {
407 .link_libc = true,413 .link_libc = true,
408 },414 },
409415
410 // Disabled until LLVM fixes their O(N^2) codegen.416 // Disabled until LLVM fixes their O(N^2) codegen. Note that this is so bad that we don't
417 // even want to include this in CI with `slow_backend`.
411 // https://github.com/ziglang/zig/issues/18872418 // https://github.com/ziglang/zig/issues/18872
412 //.{419 //.{
413 // .target = .{420 // .target = .{
...@@ -418,7 +425,8 @@ const test_targets = blk: {...@@ -418,7 +425,8 @@ const test_targets = blk: {
418 // .use_llvm = true,425 // .use_llvm = true,
419 //},426 //},
420427
421 // Disabled until LLVM fixes their O(N^2) codegen.428 // Disabled until LLVM fixes their O(N^2) codegen. Note that this is so bad that we don't
429 // even want to include this in CI with `slow_backend`.
422 // https://github.com/ziglang/zig/issues/18872430 // https://github.com/ziglang/zig/issues/18872
423 //.{431 //.{
424 // .target = .{432 // .target = .{
...@@ -971,6 +979,8 @@ pub fn addRunTranslatedCTests(...@@ -971,6 +979,8 @@ pub fn addRunTranslatedCTests(
971979
972const ModuleTestOptions = struct {980const ModuleTestOptions = struct {
973 test_filters: []const []const u8,981 test_filters: []const []const u8,
982 test_target_filters: []const []const u8,
983 test_slow_targets: bool,
974 root_src: []const u8,984 root_src: []const u8,
975 name: []const u8,985 name: []const u8,
976 desc: []const u8,986 desc: []const u8,
...@@ -987,11 +997,20 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -987,11 +997,20 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
987 const step = b.step(b.fmt("test-{s}", .{options.name}), options.desc);997 const step = b.step(b.fmt("test-{s}", .{options.name}), options.desc);
988998
989 for (test_targets) |test_target| {999 for (test_targets) |test_target| {
1000 if (!options.test_slow_targets and test_target.slow_backend) continue;
1001
990 if (options.skip_non_native and !test_target.target.isNative())1002 if (options.skip_non_native and !test_target.target.isNative())
991 continue;1003 continue;
9921004
993 const resolved_target = b.resolveTargetQuery(test_target.target);1005 const resolved_target = b.resolveTargetQuery(test_target.target);
994 const target = resolved_target.result;1006 const target = resolved_target.result;
1007 const triple_txt = target.zigTriple(b.allocator) catch @panic("OOM");
1008
1009 if (options.test_target_filters.len > 0) {
1010 for (options.test_target_filters) |filter| {
1011 if (std.mem.indexOf(u8, triple_txt, filter) != null) break;
1012 } else continue;
1013 }
9951014
996 if (options.skip_libc and test_target.link_libc == true)1015 if (options.skip_libc and test_target.link_libc == true)
997 continue;1016 continue;
...@@ -1040,7 +1059,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -1040,7 +1059,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
1040 if (!want_this_mode) continue;1059 if (!want_this_mode) continue;
10411060
1042 const libc_suffix = if (test_target.link_libc == true) "-libc" else "";1061 const libc_suffix = if (test_target.link_libc == true) "-libc" else "";
1043 const triple_txt = target.zigTriple(b.allocator) catch @panic("OOM");
1044 const model_txt = target.cpu.model.name;1062 const model_txt = target.cpu.model.name;
10451063
1046 // wasm32-wasi builds need more RAM, idk why1064 // wasm32-wasi builds need more RAM, idk why