Update behavior tests

This commit is contained in:
Luuk de Gram 2022-03-03 19:16:30 +01:00 committed by Andrew Kelley
parent 43cb19ea4d
commit 21f0503c01
3 changed files with 8 additions and 0 deletions

View File

@ -2315,6 +2315,7 @@ pub const FuncGen = struct {
.wrap_errunion_err => try self.airWrapErrUnionErr(inst),
.wasm_memory_size => try self.airWasmMemorySize(inst),
.wasm_memory_grow => try self.airWasmMemoryGrow(inst),
.constant => unreachable,
.const_ty => unreachable,

View File

@ -96,6 +96,10 @@ test {
_ = @import("behavior/void.zig");
_ = @import("behavior/while.zig");
if (builtin.zig_backend == .stage2_wasm) {
_ = @import("behavior/wasm.zig");
}
if (builtin.zig_backend != .stage1) {
_ = @import("behavior/decltest.zig");
}

View File

@ -1,7 +1,10 @@
const std = @import("std");
const expect = std.testing.expect;
const builtin = @import("builtin");
test "memory size and grow" {
if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // TODO
var prev = @wasmMemorySize(0);
try expect(prev == @wasmMemoryGrow(0, 1));
try expect(prev + 1 == @wasmMemorySize(0));