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 {...@@ -447,6 +447,7 @@ pub fn build(b: *std.Build) !void {
447 .skip_single_threaded = skip_single_threaded,447 .skip_single_threaded = skip_single_threaded,
448 .skip_non_native = skip_non_native,448 .skip_non_native = skip_non_native,
449 .skip_libc = skip_libc,449 .skip_libc = skip_libc,
450 .use_llvm = use_llvm,
450 .max_rss = 1 * 1024 * 1024 * 1024,451 .max_rss = 1 * 1024 * 1024 * 1024,
451 }));452 }));
452453
...@@ -462,6 +463,7 @@ pub fn build(b: *std.Build) !void {...@@ -462,6 +463,7 @@ pub fn build(b: *std.Build) !void {
462 .skip_single_threaded = true,463 .skip_single_threaded = true,
463 .skip_non_native = skip_non_native,464 .skip_non_native = skip_non_native,
464 .skip_libc = skip_libc,465 .skip_libc = skip_libc,
466 .use_llvm = use_llvm,
465 }));467 }));
466468
467 test_modules_step.dependOn(tests.addModuleTests(b, .{469 test_modules_step.dependOn(tests.addModuleTests(b, .{
...@@ -476,6 +478,7 @@ pub fn build(b: *std.Build) !void {...@@ -476,6 +478,7 @@ pub fn build(b: *std.Build) !void {
476 .skip_single_threaded = true,478 .skip_single_threaded = true,
477 .skip_non_native = skip_non_native,479 .skip_non_native = skip_non_native,
478 .skip_libc = true,480 .skip_libc = true,
481 .use_llvm = use_llvm,
479 .no_builtin = true,482 .no_builtin = true,
480 }));483 }));
481484
...@@ -491,6 +494,7 @@ pub fn build(b: *std.Build) !void {...@@ -491,6 +494,7 @@ pub fn build(b: *std.Build) !void {
491 .skip_single_threaded = true,494 .skip_single_threaded = true,
492 .skip_non_native = skip_non_native,495 .skip_non_native = skip_non_native,
493 .skip_libc = true,496 .skip_libc = true,
497 .use_llvm = use_llvm,
494 .no_builtin = true,498 .no_builtin = true,
495 }));499 }));
496500
...@@ -506,6 +510,7 @@ pub fn build(b: *std.Build) !void {...@@ -506,6 +510,7 @@ pub fn build(b: *std.Build) !void {
506 .skip_single_threaded = skip_single_threaded,510 .skip_single_threaded = skip_single_threaded,
507 .skip_non_native = skip_non_native,511 .skip_non_native = skip_non_native,
508 .skip_libc = skip_libc,512 .skip_libc = skip_libc,
513 .use_llvm = use_llvm,
509 // I observed a value of 4572626944 on the M2 CI.514 // I observed a value of 4572626944 on the M2 CI.
510 .max_rss = 5029889638,515 .max_rss = 5029889638,
511 }));516 }));
test/tests.zig+5
...@@ -1375,6 +1375,7 @@ const ModuleTestOptions = struct {...@@ -1375,6 +1375,7 @@ const ModuleTestOptions = struct {
1375 skip_single_threaded: bool,1375 skip_single_threaded: bool,
1376 skip_non_native: bool,1376 skip_non_native: bool,
1377 skip_libc: bool,1377 skip_libc: bool,
1378 use_llvm: ?bool = null,
1378 max_rss: usize = 0,1379 max_rss: usize = 0,
1379 no_builtin: bool = false,1380 no_builtin: bool = false,
1380 build_options: ?*std.Build.Step.Options = null,1381 build_options: ?*std.Build.Step.Options = null,
...@@ -1411,6 +1412,10 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -1411,6 +1412,10 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
1411 if (options.skip_single_threaded and test_target.single_threaded == true)1412 if (options.skip_single_threaded and test_target.single_threaded == true)
1412 continue;1413 continue;
14131414
1415 if (options.use_llvm) |use_llvm| {
1416 if (test_target.use_llvm != use_llvm) continue;
1417 }
1418
1414 // TODO get compiler-rt tests passing for self-hosted backends.1419 // TODO get compiler-rt tests passing for self-hosted backends.
1415 if ((target.cpu.arch != .x86_64 or target.ofmt != .elf) and1420 if ((target.cpu.arch != .x86_64 or target.ofmt != .elf) and
1416 test_target.use_llvm == false and mem.eql(u8, options.name, "compiler-rt"))1421 test_target.use_llvm == false and mem.eql(u8, options.name, "compiler-rt"))