diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-05-16 12:19:31 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-05-16 12:19:31 -0400 |
| commit | cd5f69794d63ece18cd8f8aa0e2ce8bc16a31ab7 (patch) | |
| tree | 8874dcf7f2ddade357cff053eaad230dcde834a5 /test | |
| parent | 69a5f0d7973f2a3fefb69bc30c7dc1f0b430bba2 (diff) | |
| download | zig-cd5f69794d63ece18cd8f8aa0e2ce8bc16a31ab7.tar.gz zig-cd5f69794d63ece18cd8f8aa0e2ce8bc16a31ab7.zip | |
cross compile the stage2 tests for the target that they work for
Diffstat (limited to 'test')
| -rw-r--r-- | test/stage2/zir.zig | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/stage2/zir.zig b/test/stage2/zir.zig index 78b6d3c1b2..868ded42ed 100644 --- a/test/stage2/zir.zig +++ b/test/stage2/zir.zig @@ -1,7 +1,15 @@ +const std = @import("std"); const TestContext = @import("../../src-self-hosted/test.zig").TestContext; +// self-hosted does not yet support PE executable files / COFF object files +// or mach-o files. So we do the ZIR transform test cases cross compiling for +// x86_64-linux. +const linux_x64 = std.zig.CrossTarget{ + .cpu_arch = .x86_64, + .os_tag = .linux, +}; pub fn addCases(ctx: *TestContext) void { - ctx.addZIRTransform("elemptr, add, cmp, condbr, return, breakpoint", + ctx.addZIRTransform("elemptr, add, cmp, condbr, return, breakpoint", linux_x64, \\@void = primitive(void) \\@usize = primitive(usize) \\@fnty = fntype([], @void, cc=C) @@ -49,8 +57,8 @@ pub fn addCases(ctx: *TestContext) void { \\ ); - if (@import("std").Target.current.os.tag != .linux or - @import("std").Target.current.cpu.arch != .x86_64) + if (std.Target.current.os.tag != .linux or + std.Target.current.cpu.arch != .x86_64) { // TODO implement self-hosted PE (.exe file) linking // TODO implement more ZIR so we don't depend on x86_64-linux |
