| author | |
| committer | |
| log | 21f0503c0137b7bb59edd87e17e1649152d342ba |
| tree | 6f969592d8bfde0f00fa2edf39d53862d821df99 |
| parent | 43cb19ea4da63dcaa8a18a06e3ab23f1c822c1fe |
3 files changed, 8 insertions(+), 0 deletions(-)
src/codegen/llvm.zig+1| ... | @@ -2315,6 +2315,7 @@ pub const FuncGen = struct { | ... | @@ -2315,6 +2315,7 @@ pub const FuncGen = struct { |
| 2315 | .wrap_errunion_err => try self.airWrapErrUnionErr(inst), | 2315 | .wrap_errunion_err => try self.airWrapErrUnionErr(inst), |
| 2316 | 2316 | ||
| 2317 | .wasm_memory_size => try self.airWasmMemorySize(inst), | 2317 | .wasm_memory_size => try self.airWasmMemorySize(inst), |
| 2318 | .wasm_memory_grow => try self.airWasmMemoryGrow(inst), | ||
| 2318 | 2319 | ||
| 2319 | .constant => unreachable, | 2320 | .constant => unreachable, |
| 2320 | .const_ty => unreachable, | 2321 | .const_ty => unreachable, |
test/behavior.zig+4| ... | @@ -96,6 +96,10 @@ test { | ... | @@ -96,6 +96,10 @@ test { |
| 96 | _ = @import("behavior/void.zig"); | 96 | _ = @import("behavior/void.zig"); |
| 97 | _ = @import("behavior/while.zig"); | 97 | _ = @import("behavior/while.zig"); |
| 98 | 98 | ||
| 99 | if (builtin.zig_backend == .stage2_wasm) { | ||
| 100 | _ = @import("behavior/wasm.zig"); | ||
| 101 | } | ||
| 102 | |||
| 99 | if (builtin.zig_backend != .stage1) { | 103 | if (builtin.zig_backend != .stage1) { |
| 100 | _ = @import("behavior/decltest.zig"); | 104 | _ = @import("behavior/decltest.zig"); |
| 101 | } | 105 | } |
test/behavior/wasm.zig+3| ... | @@ -1,7 +1,10 @@ | ... | @@ -1,7 +1,10 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const expect = std.testing.expect; | 2 | const expect = std.testing.expect; |
| 3 | const builtin = @import("builtin"); | ||
| 3 | 4 | ||
| 4 | test "memory size and grow" { | 5 | test "memory size and grow" { |
| 6 | if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // TODO | ||
| 7 | |||
| 5 | var prev = @wasmMemorySize(0); | 8 | var prev = @wasmMemorySize(0); |
| 6 | try expect(prev == @wasmMemoryGrow(0, 1)); | 9 | try expect(prev == @wasmMemoryGrow(0, 1)); |
| 7 | try expect(prev + 1 == @wasmMemorySize(0)); | 10 | try expect(prev + 1 == @wasmMemorySize(0)); |