authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-13 21:00:17-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-15 15:11:36-08:00
log1afa6e260e37597f14bd53eb25de34fd3d663096
tree107f1a2ab2f638f9889d13916a46c6fcca42ee7b
parent4cc9cfa7e88b0dd4b47bedba9f190f6731422da6

build: respect -Duse-llvm option when doing behavior tests


2 files changed, 10 insertions(+), 0 deletions(-)

build.zig+5
......@@ -447,6 +447,7 @@ pub fn build(b: *std.Build) !void {
447447 .skip_single_threaded = skip_single_threaded,
448448 .skip_non_native = skip_non_native,
449449 .skip_libc = skip_libc,
450 .use_llvm = use_llvm,
450451 .max_rss = 1 * 1024 * 1024 * 1024,
451452 }));
452453
......@@ -462,6 +463,7 @@ pub fn build(b: *std.Build) !void {
462463 .skip_single_threaded = true,
463464 .skip_non_native = skip_non_native,
464465 .skip_libc = skip_libc,
466 .use_llvm = use_llvm,
465467 }));
466468
467469 test_modules_step.dependOn(tests.addModuleTests(b, .{
......@@ -476,6 +478,7 @@ pub fn build(b: *std.Build) !void {
476478 .skip_single_threaded = true,
477479 .skip_non_native = skip_non_native,
478480 .skip_libc = true,
481 .use_llvm = use_llvm,
479482 .no_builtin = true,
480483 }));
481484
......@@ -491,6 +494,7 @@ pub fn build(b: *std.Build) !void {
491494 .skip_single_threaded = true,
492495 .skip_non_native = skip_non_native,
493496 .skip_libc = true,
497 .use_llvm = use_llvm,
494498 .no_builtin = true,
495499 }));
496500
......@@ -506,6 +510,7 @@ pub fn build(b: *std.Build) !void {
506510 .skip_single_threaded = skip_single_threaded,
507511 .skip_non_native = skip_non_native,
508512 .skip_libc = skip_libc,
513 .use_llvm = use_llvm,
509514 // I observed a value of 4572626944 on the M2 CI.
510515 .max_rss = 5029889638,
511516 }));
test/tests.zig+5
......@@ -1375,6 +1375,7 @@ const ModuleTestOptions = struct {
13751375 skip_single_threaded: bool,
13761376 skip_non_native: bool,
13771377 skip_libc: bool,
1378 use_llvm: ?bool = null,
13781379 max_rss: usize = 0,
13791380 no_builtin: bool = false,
13801381 build_options: ?*std.Build.Step.Options = null,
......@@ -1411,6 +1412,10 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
14111412 if (options.skip_single_threaded and test_target.single_threaded == true)
14121413 continue;
14131414
1415 if (options.use_llvm) |use_llvm| {
1416 if (test_target.use_llvm != use_llvm) continue;
1417 }
1418
14141419 // TODO get compiler-rt tests passing for self-hosted backends.
14151420 if ((target.cpu.arch != .x86_64 or target.ofmt != .elf) and
14161421 test_target.use_llvm == false and mem.eql(u8, options.name, "compiler-rt"))