diff options
| author | Noam Preil <pleasantatk@gmail.com> | 2020-05-27 14:09:31 -0400 |
|---|---|---|
| committer | Noam Preil <pleasantatk@gmail.com> | 2020-06-15 17:52:21 -0400 |
| commit | 2ed07a36f8b225d4abd531e80b73cf97e51ae0bb (patch) | |
| tree | 25978c47f3df3de36460e9dbe95fba5829d346ab | |
| parent | bf8b3a4394be6b1b512531cb5217147d8bead180 (diff) | |
| download | zig-2ed07a36f8b225d4abd531e80b73cf97e51ae0bb.tar.gz zig-2ed07a36f8b225d4abd531e80b73cf97e51ae0bb.zip | |
[Stage2/Testing] Attempt to call nakedcc function
| -rw-r--r-- | test/stage2/compile_errors.zig | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/test/stage2/compile_errors.zig b/test/stage2/compile_errors.zig index 50bfea5210..865ececf18 100644 --- a/test/stage2/compile_errors.zig +++ b/test/stage2/compile_errors.zig @@ -11,7 +11,7 @@ const linux_x64 = std.zig.CrossTarget{ pub fn addCases(ctx: *TestContext) !void { // TODO: re-enable these tests. // https://github.com/ziglang/zig/issues/1364 - ctx.addZIRError("test", linux_x64, + ctx.addZIRError("call undefined local", linux_x64, \\@noreturn = primitive(noreturn) \\ \\@start_fnty = fntype([], @noreturn, cc=Naked) @@ -20,14 +20,32 @@ pub fn addCases(ctx: *TestContext) !void { \\}) , &[_][]const u8{"5:13:unrecognized identifier: %test"}); - // 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, []) - // \\}) - // , &[_][]const u8{"5:13:unrecognized identifier: @notafunc"}); + // TODO: fix this test + // 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, []) + // \\}) + // \\@0 = str("_start") + // \\@1 = ref(@0) + // \\@2 = export(@1, @start) + // , &[_][]const u8{"5:13:unrecognized identifier: @notafunc"}); + + // TODO: this error should occur at the call site, not the fntype decl + ctx.addZIRError("call naked function", linux_x64, + \\@noreturn = primitive(noreturn) + \\ + \\@start_fnty = fntype([], @noreturn, cc=Naked) + \\@s = fn(@start_fnty, {}) + \\@start = fn(@start_fnty, { + \\ %0 = call(@s, []) + \\}) + \\@0 = str("_start") + \\@1 = ref(@0) + \\@2 = export(@1, @start) + , &[_][]const u8{"4:9:unable to call function with naked calling convention"}); //try ctx.testCompileError( // \\export fn entry() void {} |
