mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
test: Configure emit_asm/emit_bin correctly for some targets in llvm_targets.
This commit is contained in:
parent
5411358956
commit
b31b309b53
1 changed files with 19 additions and 0 deletions
|
|
@ -174,6 +174,23 @@ pub fn exeFromCompiledC(ctx: *Cases, name: []const u8, target_query: std.Target.
|
|||
}
|
||||
|
||||
pub fn addObjLlvm(ctx: *Cases, name: []const u8, target: std.Build.ResolvedTarget) *Case {
|
||||
const can_emit_asm = switch (target.result.cpu.arch) {
|
||||
.csky,
|
||||
.xtensa,
|
||||
=> false,
|
||||
else => true,
|
||||
};
|
||||
const can_emit_bin = switch (target.result.cpu.arch) {
|
||||
.arc,
|
||||
.csky,
|
||||
.nvptx,
|
||||
.nvptx64,
|
||||
.xcore,
|
||||
.xtensa,
|
||||
=> false,
|
||||
else => true,
|
||||
};
|
||||
|
||||
ctx.cases.append(.{
|
||||
.name = name,
|
||||
.target = target,
|
||||
|
|
@ -182,6 +199,8 @@ pub fn addObjLlvm(ctx: *Cases, name: []const u8, target: std.Build.ResolvedTarge
|
|||
.output_mode = .Obj,
|
||||
.deps = std.ArrayList(DepModule).init(ctx.arena),
|
||||
.backend = .llvm,
|
||||
.emit_bin = can_emit_bin,
|
||||
.emit_asm = can_emit_asm,
|
||||
}) catch @panic("out of memory");
|
||||
return &ctx.cases.items[ctx.cases.items.len - 1];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue