zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit bebc1f49cf2e480fbd5dc2a409ee1bc0fe3de331 (tree)
parent 2d1d012f1194e1e26f123891e12921d59ffe9e10
Author: Noam Preil <pleasantatk@gmail.com>
Date:   Wed, 27 May 2020 09:20:06 -0400

[Stage2/Testing] Add (failing) test

Diffstat:
Mtest/stage2/compile_errors.zig | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/test/stage2/compile_errors.zig b/test/stage2/compile_errors.zig @@ -23,6 +23,20 @@ pub fn addCases(ctx: *TestContext) !void { .msg = "unrecognized identifier: %test", }}, &[_]ErrorMsg{}, &[_]ErrorMsg{}); + ctx.addZIRError("call with non-existent target", linux_x64, + \\@noreturn = primitive(noreturn) + \\ + \\@start_fnty = fntype([], @noreturn, cc=Naked) + \\@start = fn(@start_fnty, { + \\ %0 = call(@notafunc, []) + \\}) + , &[_]ErrorMsg{ + .{ + .byte_offset = 118, + .msg = "unrecognized identifier: @notafunc", + }, + }, &[_]ErrorMsg{}, &[_]ErrorMsg{}); + //try ctx.testCompileError( // \\export fn entry() void {} // \\export fn entry() void {}