aboutsummaryrefslogtreecommitdiff
path: root/test/src/Cases.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-11-28 21:56:45 +0100
committerAlex Rønne Petersen <alex@alexrp.com>2024-11-28 22:04:00 +0100
commit78b8ce5095abf6516dc414b8cf487acedbd0ce99 (patch)
tree3d3abfc33595667d5645a9e34ee76c0f3d8fb665 /test/src/Cases.zig
parent0bf054f4c54d23678939828a5b72627ce4d27e94 (diff)
downloadzig-78b8ce5095abf6516dc414b8cf487acedbd0ce99.tar.gz
zig-78b8ce5095abf6516dc414b8cf487acedbd0ce99.zip
test: Change llvm_targets to actually emit an object for each target.
Without doing this, we don't actually test whether the data layout string we generate matches LLVM's. A number of targets had to be commented out due to this change: * Some are using a non-working experimental LLVM backend (arc, csky, ...). * Some don't have working LLD support (lanai, sparc, ...). * Some don't have working self-hosted linker support (nvptx). * Some are using ABIs that haven't been standardized (loongarch32). Finally, all non-x86 uefi targets are hopelessly broken and can't really be fixed until we change our emit logic to lower *-uefi-* verbatim rather than to *-windows-*. See: https://github.com/ziglang/zig/issues/21630
Diffstat (limited to 'test/src/Cases.zig')
-rw-r--r--test/src/Cases.zig18
1 files changed, 1 insertions, 17 deletions
diff --git a/test/src/Cases.zig b/test/src/Cases.zig
index 2a601637e6..208e8a6ce1 100644
--- a/test/src/Cases.zig
+++ b/test/src/Cases.zig
@@ -204,34 +204,18 @@ pub fn exeFromCompiledC(ctx: *Cases, name: []const u8, target_query: std.Target.
return &ctx.cases.items[ctx.cases.items.len - 1];
}
-pub fn noEmitUsingLlvmBackend(ctx: *Cases, name: []const u8, target: std.Build.ResolvedTarget) *Case {
+pub fn addObjLlvm(ctx: *Cases, name: []const u8, target: std.Build.ResolvedTarget) *Case {
ctx.cases.append(Case{
.name = name,
.target = target,
.updates = std.ArrayList(Update).init(ctx.cases.allocator),
.output_mode = .Obj,
- .emit_bin = false,
.deps = std.ArrayList(DepModule).init(ctx.arena),
.backend = .llvm,
}) catch @panic("out of memory");
return &ctx.cases.items[ctx.cases.items.len - 1];
}
-/// Adds a test case that uses the LLVM backend to emit an executable.
-/// Currently this implies linking libc, because only then we can generate a testable executable.
-pub fn exeUsingLlvmBackend(ctx: *Cases, name: []const u8, target: std.Build.ResolvedTarget) *Case {
- ctx.cases.append(Case{
- .name = name,
- .target = target,
- .updates = std.ArrayList(Update).init(ctx.cases.allocator),
- .output_mode = .Exe,
- .deps = std.ArrayList(DepModule).init(ctx.arena),
- .backend = .llvm,
- .link_libc = true,
- }) catch @panic("out of memory");
- return &ctx.cases.items[ctx.cases.items.len - 1];
-}
-
pub fn addObj(
ctx: *Cases,
name: []const u8,