diff options
Diffstat (limited to 'src/test/java')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/backends/wasm/WasmPatioCodeGenTests.java | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/test/java/org/shedlang/compiler/backends/wasm/WasmPatioCodeGenTests.java b/src/test/java/org/shedlang/compiler/backends/wasm/WasmPatioCodeGenTests.java index 798f773f..b3c0960f 100644 --- a/src/test/java/org/shedlang/compiler/backends/wasm/WasmPatioCodeGenTests.java +++ b/src/test/java/org/shedlang/compiler/backends/wasm/WasmPatioCodeGenTests.java @@ -3,9 +3,10 @@ package org.shedlang.compiler.backends.wasm; import org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormat; import org.shedlang.compiler.backends.wasm.structure.ast.instructions.WasmCall; import org.shedlang.compiler.backends.wasm.structure.ast.instructions.WasmExpression; -import org.shedlang.compiler.backends.wasm.structure.ast.instructions.WasmLocalGet; -import org.shedlang.compiler.backends.wasm.structure.ast.instructions.WasmMemoryGrow; -import org.shedlang.compiler.backends.wasm.structure.ast.modules.*; +import org.shedlang.compiler.backends.wasm.structure.ast.modules.WasmFuncName; +import org.shedlang.compiler.backends.wasm.structure.ast.modules.WasmFunction; +import org.shedlang.compiler.backends.wasm.structure.ast.modules.WasmImport; +import org.shedlang.compiler.backends.wasm.structure.ast.modules.WasmImportDescriptor; import org.shedlang.compiler.backends.wasm.structure.ast.types.WasmFuncType; import org.shedlang.compiler.backends.wasm.structure.ast.types.WasmValueType; import org.shedlang.compiler.patio.PatioExampleTests; @@ -24,17 +25,7 @@ public class WasmPatioCodeGenTests extends PatioExampleTests { protected ExecutionResult run(PatioCompilationUnit patio) throws IOException, InterruptedException { var wasmModule = WasmPatioCodeGen.generateCompilationUnit(patio); - // TODO: put these in separate module, remove duplication - wasmModule = wasmModule.addFunction(new WasmFunction( - "wasm_memory_grow", - List.of(new WasmLocal("pages", WasmValueType.I32)), - List.of(), - List.of(WasmValueType.I32), - new WasmExpression(List.of( - new WasmLocalGet(new WasmLocalIndex(0)), - new WasmMemoryGrow() - )) - )); + wasmModule = WasmBackend.generateNativeRuntime(wasmModule); wasmModule = wasmModule.addFunction(new WasmFunction( "_start", |
