diff options
-rw-r--r-- | src/s2wasm.h | 1 | ||||
-rw-r--r-- | test/dot_s/hostFinalize.s | 9 | ||||
-rw-r--r-- | test/dot_s/hostFinalize.wast | 13 |
3 files changed, 23 insertions, 0 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h index fea40e749..afebd4d9c 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -724,6 +724,7 @@ class S2WasmBuilder { Name assign = getAssign(); auto curr = allocator->alloc<Host>(); curr->op = op; + curr->finalize(); setOutput(curr, assign); }; auto makeHost1 = [&](HostOp op) { diff --git a/test/dot_s/hostFinalize.s b/test/dot_s/hostFinalize.s new file mode 100644 index 000000000..cd9129d12 --- /dev/null +++ b/test/dot_s/hostFinalize.s @@ -0,0 +1,9 @@ + .text + .type _main, @function +_main: + current_memory $push0= + i32.const $push1=, 1 + i32.add $push2=, $pop0, $pop1 + grow_memory $pop2 + .endfunc + .size _main diff --git a/test/dot_s/hostFinalize.wast b/test/dot_s/hostFinalize.wast new file mode 100644 index 000000000..8b7f96dc6 --- /dev/null +++ b/test/dot_s/hostFinalize.wast @@ -0,0 +1,13 @@ +(module + (memory 1) + (export "memory" memory) + (func $_main + (grow_memory + (i32.add + (current_memory) + (i32.const 1) + ) + ) + ) +) +;; METADATA: { "asmConsts": {},"staticBump": 12, "initializers": [] } |