aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNoam Preil <pleasantatk@gmail.com>2020-07-07 19:35:33 -0400
committerNoam Preil <pleasantatk@gmail.com>2020-07-07 19:35:33 -0400
commitcf09b335d8b7ad5b43ceefd169b4c2e6be8ed249 (patch)
tree9a0a75d48eb34dc75d75972bfc8362a9a7a83197 /test
parentcf86aa8772f266cb475711aeee7b0c1b2083e6aa (diff)
downloadzig-cf09b335d8b7ad5b43ceefd169b4c2e6be8ed249.tar.gz
zig-cf09b335d8b7ad5b43ceefd169b4c2e6be8ed249.zip
CBE: Working function call w/ no args or return value
Diffstat (limited to 'test')
-rw-r--r--test/stage2/cbe.zig21
1 files changed, 17 insertions, 4 deletions
diff --git a/test/stage2/cbe.zig b/test/stage2/cbe.zig
index 86f966af82..88eb6c5953 100644
--- a/test/stage2/cbe.zig
+++ b/test/stage2/cbe.zig
@@ -9,13 +9,26 @@ const linux_x64 = std.zig.CrossTarget{
};
pub fn addCases(ctx: *TestContext) !void {
- // These tests should work on every platform
ctx.c11("empty start function", linux_x64,
\\export fn _start() noreturn {}
,
- // A newline is always generated after every function; this ensures, among
- // other things, that there is always a newline at the end of the file
- \\_Noreturn void _start(void) {}
+ \\_Noreturn void _start(void) {}
+ \\
+ );
+ ctx.c11("less empty start function", linux_x64,
+ \\fn main() noreturn {}
+ \\
+ \\export fn _start() noreturn {
+ \\ main();
+ \\}
+ ,
+ \\_Noreturn void main(void);
+ \\
+ \\_Noreturn void _start(void) {
+ \\ main();
+ \\}
+ \\
+ \\_Noreturn void main(void) {}
\\
);
}