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

This commit is contained in:
Andrew Kelley 2025-01-13 21:00:17 -08:00
parent 4cc9cfa7e8
commit 1afa6e260e
2 changed files with 10 additions and 0 deletions

View File

@ -447,6 +447,7 @@ pub fn build(b: *std.Build) !void {
.skip_single_threaded = skip_single_threaded, .skip_single_threaded = skip_single_threaded,
.skip_non_native = skip_non_native, .skip_non_native = skip_non_native,
.skip_libc = skip_libc, .skip_libc = skip_libc,
.use_llvm = use_llvm,
.max_rss = 1 * 1024 * 1024 * 1024, .max_rss = 1 * 1024 * 1024 * 1024,
})); }));
@ -462,6 +463,7 @@ pub fn build(b: *std.Build) !void {
.skip_single_threaded = true, .skip_single_threaded = true,
.skip_non_native = skip_non_native, .skip_non_native = skip_non_native,
.skip_libc = skip_libc, .skip_libc = skip_libc,
.use_llvm = use_llvm,
})); }));
test_modules_step.dependOn(tests.addModuleTests(b, .{ test_modules_step.dependOn(tests.addModuleTests(b, .{
@ -476,6 +478,7 @@ pub fn build(b: *std.Build) !void {
.skip_single_threaded = true, .skip_single_threaded = true,
.skip_non_native = skip_non_native, .skip_non_native = skip_non_native,
.skip_libc = true, .skip_libc = true,
.use_llvm = use_llvm,
.no_builtin = true, .no_builtin = true,
})); }));
@ -491,6 +494,7 @@ pub fn build(b: *std.Build) !void {
.skip_single_threaded = true, .skip_single_threaded = true,
.skip_non_native = skip_non_native, .skip_non_native = skip_non_native,
.skip_libc = true, .skip_libc = true,
.use_llvm = use_llvm,
.no_builtin = true, .no_builtin = true,
})); }));
@ -506,6 +510,7 @@ pub fn build(b: *std.Build) !void {
.skip_single_threaded = skip_single_threaded, .skip_single_threaded = skip_single_threaded,
.skip_non_native = skip_non_native, .skip_non_native = skip_non_native,
.skip_libc = skip_libc, .skip_libc = skip_libc,
.use_llvm = use_llvm,
// I observed a value of 4572626944 on the M2 CI. // I observed a value of 4572626944 on the M2 CI.
.max_rss = 5029889638, .max_rss = 5029889638,
})); }));

View File

@ -1375,6 +1375,7 @@ const ModuleTestOptions = struct {
skip_single_threaded: bool, skip_single_threaded: bool,
skip_non_native: bool, skip_non_native: bool,
skip_libc: bool, skip_libc: bool,
use_llvm: ?bool = null,
max_rss: usize = 0, max_rss: usize = 0,
no_builtin: bool = false, no_builtin: bool = false,
build_options: ?*std.Build.Step.Options = null, build_options: ?*std.Build.Step.Options = null,
@ -1411,6 +1412,10 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
if (options.skip_single_threaded and test_target.single_threaded == true) if (options.skip_single_threaded and test_target.single_threaded == true)
continue; continue;
if (options.use_llvm) |use_llvm| {
if (test_target.use_llvm != use_llvm) continue;
}
// TODO get compiler-rt tests passing for self-hosted backends. // TODO get compiler-rt tests passing for self-hosted backends.
if ((target.cpu.arch != .x86_64 or target.ofmt != .elf) and if ((target.cpu.arch != .x86_64 or target.ofmt != .elf) and
test_target.use_llvm == false and mem.eql(u8, options.name, "compiler-rt")) test_target.use_llvm == false and mem.eql(u8, options.name, "compiler-rt"))