mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 00:26:57 +00:00
test-cases: fix incorrectly linking libc when backend is llvm
Now link_libc=1 must be used to link with libc, instead of the test harness assuming that using the llvm backend means additionally linking with libc.
This commit is contained in:
parent
1dbb616e73
commit
171977dc1c
@ -9,7 +9,8 @@ pub fn main() void {
|
||||
// run
|
||||
// backend=llvm
|
||||
// target=x86_64-linux-gnu
|
||||
// link_libc=1
|
||||
//
|
||||
// f64: 2.000000
|
||||
// f32: 10.000000
|
||||
//
|
||||
//
|
||||
|
@ -14,4 +14,5 @@ fn foo(comptime info: std.builtin.Type) !void {
|
||||
|
||||
// run
|
||||
// is_test=1
|
||||
// backend=llvm
|
||||
//
|
||||
|
@ -7,6 +7,7 @@ pub fn main() void {
|
||||
// run
|
||||
// backend=llvm
|
||||
// target=x86_64-linux,x86_64-macos
|
||||
// link_libc=1
|
||||
//
|
||||
// hello world!
|
||||
//
|
||||
|
@ -382,6 +382,7 @@ fn addFromDirInner(
|
||||
const backends = try manifest.getConfigForKeyAlloc(ctx.arena, "backend", Backend);
|
||||
const targets = try manifest.getConfigForKeyAlloc(ctx.arena, "target", CrossTarget);
|
||||
const is_test = try manifest.getConfigForKeyAssertSingle("is_test", bool);
|
||||
const link_libc = try manifest.getConfigForKeyAssertSingle("link_libc", bool);
|
||||
const output_mode = try manifest.getConfigForKeyAssertSingle("output_mode", std.builtin.OutputMode);
|
||||
|
||||
var cases = std.ArrayList(usize).init(ctx.arena);
|
||||
@ -397,7 +398,7 @@ fn addFromDirInner(
|
||||
.updates = std.ArrayList(Cases.Update).init(ctx.cases.allocator),
|
||||
.is_test = is_test,
|
||||
.output_mode = output_mode,
|
||||
.link_libc = backend == .llvm,
|
||||
.link_libc = link_libc,
|
||||
.deps = std.ArrayList(DepModule).init(ctx.cases.allocator),
|
||||
});
|
||||
try cases.append(next);
|
||||
@ -745,6 +746,8 @@ const TestManifestConfigDefaults = struct {
|
||||
};
|
||||
} else if (std.mem.eql(u8, key, "is_test")) {
|
||||
return "0";
|
||||
} else if (std.mem.eql(u8, key, "link_libc")) {
|
||||
return "0";
|
||||
} else unreachable;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user