authorgravatar for noam@pixelhero.devNoam Preil <noam@pixelhero.dev> 2020-05-27 14:09:31-04:00
committergravatar for noam@pixelhero.devNoam Preil <noam@pixelhero.dev> 2020-06-15 17:52:21-04:00
log2ed07a36f8b225d4abd531e80b73cf97e51ae0bb
tree25978c47f3df3de36460e9dbe95fba5829d346ab
parentbf8b3a4394be6b1b512531cb5217147d8bead180
signaturelock-open Commit is signed but in an unrecognized format.

[Stage2/Testing] Attempt to call nakedcc function


1 files changed, 27 insertions(+), 9 deletions(-)

test/stage2/compile_errors.zig+27-9
......@@ -11,7 +11,7 @@ const linux_x64 = std.zig.CrossTarget{
1111pub fn addCases(ctx: *TestContext) !void {
1212 // TODO: re-enable these tests.
1313 // https://github.com/ziglang/zig/issues/1364
14 ctx.addZIRError("test", linux_x64,
14 ctx.addZIRError("call undefined local", linux_x64,
1515 \\@noreturn = primitive(noreturn)
1616 \\
1717 \\@start_fnty = fntype([], @noreturn, cc=Naked)
......@@ -20,14 +20,32 @@ pub fn addCases(ctx: *TestContext) !void {
2020 \\})
2121 , &[_][]const u8{"5:13:unrecognized identifier: %test"});
2222
23 // ctx.addZIRError("call with non-existent target", linux_x64,
24 // \\@noreturn = primitive(noreturn)
25 // \\
26 // \\@start_fnty = fntype([], @noreturn, cc=Naked)
27 // \\@start = fn(@start_fnty, {
28 // \\ %0 = call(@notafunc, [])
29 // \\})
30 // , &[_][]const u8{"5:13:unrecognized identifier: @notafunc"});
23 // TODO: fix this test
24 // ctx.addZIRError("call with non-existent target", linux_x64,
25 // \\@noreturn = primitive(noreturn)
26 // \\
27 // \\@start_fnty = fntype([], @noreturn, cc=Naked)
28 // \\@start = fn(@start_fnty, {
29 // \\ %0 = call(@notafunc, [])
30 // \\})
31 // \\@0 = str("_start")
32 // \\@1 = ref(@0)
33 // \\@2 = export(@1, @start)
34 // , &[_][]const u8{"5:13:unrecognized identifier: @notafunc"});
35
36 // TODO: this error should occur at the call site, not the fntype decl
37 ctx.addZIRError("call naked function", linux_x64,
38 \\@noreturn = primitive(noreturn)
39 \\
40 \\@start_fnty = fntype([], @noreturn, cc=Naked)
41 \\@s = fn(@start_fnty, {})
42 \\@start = fn(@start_fnty, {
43 \\ %0 = call(@s, [])
44 \\})
45 \\@0 = str("_start")
46 \\@1 = ref(@0)
47 \\@2 = export(@1, @start)
48 , &[_][]const u8{"4:9:unable to call function with naked calling convention"});
3149
3250 //try ctx.testCompileError(
3351 // \\export fn entry() void {}