mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
pass -fno-builtin when testing lib/c.zig, lib/compiler_rt.zig
This commit is contained in:
parent
06d9f88f97
commit
c01d8c8b20
4 changed files with 11 additions and 2 deletions
|
|
@ -489,6 +489,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,
|
||||||
|
.no_builtin = true,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
test_step.dependOn(tests.addModuleTests(b, .{
|
test_step.dependOn(tests.addModuleTests(b, .{
|
||||||
|
|
@ -501,6 +502,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,
|
||||||
|
.no_builtin = true,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
test_step.dependOn(tests.addCompareOutputTests(b, test_filters, optimization_modes));
|
test_step.dependOn(tests.addCompareOutputTests(b, test_filters, optimization_modes));
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,8 @@ is_linking_libc: bool = false,
|
||||||
/// Computed during make().
|
/// Computed during make().
|
||||||
is_linking_libcpp: bool = false,
|
is_linking_libcpp: bool = false,
|
||||||
|
|
||||||
|
no_builtin: bool = false,
|
||||||
|
|
||||||
pub const ExpectedCompileErrors = union(enum) {
|
pub const ExpectedCompileErrors = union(enum) {
|
||||||
contains: []const u8,
|
contains: []const u8,
|
||||||
exact: []const []const u8,
|
exact: []const []const u8,
|
||||||
|
|
@ -1572,6 +1574,10 @@ fn make(step: *Step, prog_node: std.Progress.Node) !void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (compile.no_builtin) {
|
||||||
|
try zig_args.append("-fno-builtin");
|
||||||
|
}
|
||||||
|
|
||||||
if (b.sysroot) |sysroot| {
|
if (b.sysroot) |sysroot| {
|
||||||
try zig_args.appendSlice(&[_][]const u8{ "--sysroot", sysroot });
|
try zig_args.appendSlice(&[_][]const u8{ "--sysroot", sysroot });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3115,8 +3115,7 @@ pub const Object = struct {
|
||||||
|
|
||||||
try variable_index.setInitializer(try o.lowerValue(decl_val), &o.builder);
|
try variable_index.setInitializer(try o.lowerValue(decl_val), &o.builder);
|
||||||
variable_index.setLinkage(.internal, &o.builder);
|
variable_index.setLinkage(.internal, &o.builder);
|
||||||
const llvm_miscompiles_const_anon = o.module.getTarget().isDarwin();
|
variable_index.setMutability(.constant, &o.builder);
|
||||||
if (!llvm_miscompiles_const_anon) variable_index.setMutability(.constant, &o.builder);
|
|
||||||
variable_index.setUnnamedAddr(.unnamed_addr, &o.builder);
|
variable_index.setUnnamedAddr(.unnamed_addr, &o.builder);
|
||||||
variable_index.setAlignment(alignment.toLlvm(), &o.builder);
|
variable_index.setAlignment(alignment.toLlvm(), &o.builder);
|
||||||
return variable_index;
|
return variable_index;
|
||||||
|
|
|
||||||
|
|
@ -984,6 +984,7 @@ const ModuleTestOptions = struct {
|
||||||
skip_non_native: bool,
|
skip_non_native: bool,
|
||||||
skip_libc: bool,
|
skip_libc: bool,
|
||||||
max_rss: usize = 0,
|
max_rss: usize = 0,
|
||||||
|
no_builtin: bool = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
|
pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
|
||||||
|
|
@ -1070,6 +1071,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
|
||||||
.pic = test_target.pic,
|
.pic = test_target.pic,
|
||||||
.strip = test_target.strip,
|
.strip = test_target.strip,
|
||||||
});
|
});
|
||||||
|
if (options.no_builtin) these_tests.no_builtin = true;
|
||||||
const single_threaded_suffix = if (test_target.single_threaded == true) "-single" else "";
|
const single_threaded_suffix = if (test_target.single_threaded == true) "-single" else "";
|
||||||
const backend_suffix = if (test_target.use_llvm == true)
|
const backend_suffix = if (test_target.use_llvm == true)
|
||||||
"-llvm"
|
"-llvm"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue