diff options
| author | Noam Preil <pleasantatk@gmail.com> | 2020-06-26 02:42:02 -0400 |
|---|---|---|
| committer | Noam Preil <pleasantatk@gmail.com> | 2020-06-26 02:42:02 -0400 |
| commit | 649da2df5234f504f2f22afe9e0b4cf7eeb9ef35 (patch) | |
| tree | 2e7873b9d8bdead87e2d3698e6462d7d86133b54 /test | |
| parent | c88edbc46fbbdc5a97c9703d09097af5f8d2a653 (diff) | |
| download | zig-649da2df5234f504f2f22afe9e0b4cf7eeb9ef35.tar.gz zig-649da2df5234f504f2f22afe9e0b4cf7eeb9ef35.zip | |
Stage2/Testing: Add convenience wrappers
Diffstat (limited to 'test')
| -rw-r--r-- | test/stage2/compare_output.zig | 2 | ||||
| -rw-r--r-- | test/stage2/compile_errors.zig | 6 | ||||
| -rw-r--r-- | test/stage2/zir.zig | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/test/stage2/compare_output.zig b/test/stage2/compare_output.zig index 902c1e493f..d49f16876e 100644 --- a/test/stage2/compare_output.zig +++ b/test/stage2/compare_output.zig @@ -17,7 +17,7 @@ pub fn addCases(ctx: *TestContext) !void { } { - var case = ctx.addExe("hello world with updates", linux_x64, .Zig); + var case = ctx.exe("hello world with updates", linux_x64); // Regular old hello world case.addCompareOutput( \\export fn _start() noreturn { diff --git a/test/stage2/compile_errors.zig b/test/stage2/compile_errors.zig index 1ee8e9184b..905f106f94 100644 --- a/test/stage2/compile_errors.zig +++ b/test/stage2/compile_errors.zig @@ -9,7 +9,7 @@ const linux_x64 = std.zig.CrossTarget{ }; pub fn addCases(ctx: *TestContext) !void { - ctx.addError("call undefined local", linux_x64, .ZIR, + ctx.compileErrorZIR("call undefined local", linux_x64, \\@noreturn = primitive(noreturn) \\ \\@start_fnty = fntype([], @noreturn, cc=Naked) @@ -19,7 +19,7 @@ pub fn addCases(ctx: *TestContext) !void { // TODO: address inconsistency in this message and the one in the next test , &[_][]const u8{":5:13: error: unrecognized identifier: %test"}); - ctx.addError("call with non-existent target", linux_x64, .ZIR, + ctx.compileErrorZIR("call with non-existent target", linux_x64, \\@noreturn = primitive(noreturn) \\ \\@start_fnty = fntype([], @noreturn, cc=Naked) @@ -31,7 +31,7 @@ pub fn addCases(ctx: *TestContext) !void { , &[_][]const u8{":5:13: error: decl 'notafunc' not found"}); // TODO: this error should occur at the call site, not the fntype decl - ctx.addError("call naked function", linux_x64, .ZIR, + ctx.compileErrorZIR("call naked function", linux_x64, \\@noreturn = primitive(noreturn) \\ \\@start_fnty = fntype([], @noreturn, cc=Naked) diff --git a/test/stage2/zir.zig b/test/stage2/zir.zig index 17d5ce9b5b..052ada667e 100644 --- a/test/stage2/zir.zig +++ b/test/stage2/zir.zig @@ -9,7 +9,7 @@ const linux_x64 = std.zig.CrossTarget{ }; pub fn addCases(ctx: *TestContext) !void { - ctx.addTransform("referencing decls which appear later in the file", linux_x64, .ZIR, + ctx.transformZIR("referencing decls which appear later in the file", linux_x64, \\@void = primitive(void) \\@fnty = fntype([], @void, cc=C) \\ @@ -32,7 +32,7 @@ pub fn addCases(ctx: *TestContext) !void { \\}) \\ ); - ctx.addTransform("elemptr, add, cmp, condbr, return, breakpoint", linux_x64, .ZIR, + ctx.transformZIR("elemptr, add, cmp, condbr, return, breakpoint", linux_x64, \\@void = primitive(void) \\@usize = primitive(usize) \\@fnty = fntype([], @void, cc=C) @@ -86,7 +86,7 @@ pub fn addCases(ctx: *TestContext) !void { ); { - var case = ctx.addObj("reference cycle with compile error in the cycle", linux_x64, .ZIR); + var case = ctx.objZIR("reference cycle with compile error in the cycle", linux_x64); case.addTransform( \\@void = primitive(void) \\@fnty = fntype([], @void, cc=C) @@ -207,7 +207,7 @@ pub fn addCases(ctx: *TestContext) !void { return; } - ctx.addCompareOutput("hello world ZIR", .ZIR, + ctx.compareOutputZIR("hello world ZIR", \\@noreturn = primitive(noreturn) \\@void = primitive(void) \\@usize = primitive(usize) @@ -265,7 +265,7 @@ pub fn addCases(ctx: *TestContext) !void { \\ ); - ctx.addCompareOutput("function call with no args no return value", .ZIR, + ctx.compareOutputZIR("function call with no args no return value", \\@noreturn = primitive(noreturn) \\@void = primitive(void) \\@usize = primitive(usize) |
