diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-01-29 14:01:12 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-01-29 14:01:12 -0500 |
| commit | 1c60f3145098cda92a7bd90ed0fce4bd75a03d1c (patch) | |
| tree | 11e9bf1b797e217169f2d2d4d3e3fa8bfa151571 /test/compile_errors.zig | |
| parent | 2b5e0b66a27d2a83cb596a28c9792a86523401b3 (diff) | |
| download | zig-1c60f3145098cda92a7bd90ed0fce4bd75a03d1c.tar.gz zig-1c60f3145098cda92a7bd90ed0fce4bd75a03d1c.zip | |
add compile error for calling naked function
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index fe167c472c..3b43205773 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -1,6 +1,16 @@ const tests = @import("tests.zig"); pub fn addCases(cases: &tests.CompileErrorContext) void { + cases.add("calling function with naked calling convention", + \\export fn entry() void { + \\ foo(); + \\} + \\nakedcc fn foo() void { } + , + ".tmp_source.zig:2:5: error: unable to call function with naked calling convention", + ".tmp_source.zig:4:9: note: declared here"); + + cases.add("function with invalid return type", \\export fn foo() boid {} , ".tmp_source.zig:1:17: error: use of undeclared identifier 'boid'"); |
