aboutsummaryrefslogtreecommitdiff
path: root/lib/std/start.zig
diff options
context:
space:
mode:
authorLuuk de Gram <luuk@degram.dev>2022-02-06 12:49:42 +0100
committerJakub Konka <kubkon@jakubkonka.com>2022-02-08 10:03:29 +0100
commitf50203c83667ed3ad0c57fdc953322a5f9c221ac (patch)
treee00d3de5d985d8a579aa3e1229fc2a9ecd36889d /lib/std/start.zig
parent2302ded9511a6ee5bc3d672e6405df6a955b3622 (diff)
downloadzig-f50203c83667ed3ad0c57fdc953322a5f9c221ac.tar.gz
zig-f50203c83667ed3ad0c57fdc953322a5f9c221ac.zip
wasm: update test runner
This updates the test runner for stage2 to emit to stdout with the passed, skipped and failed tests similar to the LLVM backend. Another change to this is the start function, as it's now more in line with stage1's. The stage2 test infrastructure for wasm/wasi has been updated to reflect this as well.
Diffstat (limited to 'lib/std/start.zig')
-rw-r--r--lib/std/start.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig
index a3cc3d00a8..6e28ca61a3 100644
--- a/lib/std/start.zig
+++ b/lib/std/start.zig
@@ -31,7 +31,7 @@ comptime {
} else if (builtin.os.tag == .windows) {
@export(wWinMainCRTStartup2, .{ .name = "wWinMainCRTStartup" });
} else if (builtin.os.tag == .wasi and @hasDecl(root, "main")) {
- @export(wasmMain2, .{ .name = "_start" });
+ @export(wasiMain2, .{ .name = "_start" });
} else {
if (!@hasDecl(root, "_start")) {
@export(_start2, .{ .name = "_start" });
@@ -100,17 +100,17 @@ fn callMain2() noreturn {
exit2(0);
}
-fn wasmMain2() u8 {
+fn wasiMain2() noreturn {
switch (@typeInfo(@typeInfo(@TypeOf(root.main)).Fn.return_type.?)) {
.Void => {
root.main();
- return 0;
+ std.os.wasi.proc_exit(0);
},
.Int => |info| {
if (info.bits != 8 or info.signedness == .signed) {
@compileError(bad_main_ret);
}
- return root.main();
+ std.os.wasi.proc_exit(root.main());
},
else => @compileError("Bad return type main"),
}