From 9846bb9db8bd0aa6e84780bda459f4642eb45213 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 24 Jun 2023 21:03:46 +0100 Subject: Add local names to WASM object file --- .../wasm/structure/WasmBinaryFormatModuleTests.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/test/java/org') diff --git a/src/test/java/org/shedlang/compiler/backends/wasm/structure/WasmBinaryFormatModuleTests.java b/src/test/java/org/shedlang/compiler/backends/wasm/structure/WasmBinaryFormatModuleTests.java index cb1e7a76..5941c790 100644 --- a/src/test/java/org/shedlang/compiler/backends/wasm/structure/WasmBinaryFormatModuleTests.java +++ b/src/test/java/org/shedlang/compiler/backends/wasm/structure/WasmBinaryFormatModuleTests.java @@ -45,13 +45,25 @@ public class WasmBinaryFormatModuleTests { public void canSerializeModuleWithFunctions(Snapshotter snapshotter) throws IOException, InterruptedException { var module = WasmModule.EMPTY .addFunction(new WasmFunction( - new WasmFuncType(List.of(), List.of(WasmValueType.I32)), - List.of(WasmValueType.F32, WasmValueType.F64), + List.of( + new WasmLocal("paramA", WasmValueType.F32), + new WasmLocal("paramB", WasmValueType.F64) + ), + List.of( + new WasmLocal("localA", WasmValueType.I64), + new WasmLocal("localB", WasmValueType.F64) + ), + List.of(WasmValueType.I32), List.of(new WasmI32Const(0)) )) .addFunction(new WasmFunction( - new WasmFuncType(List.of(), List.of(WasmValueType.I64)), - List.of(), + List.of( + new WasmLocal("paramA", WasmValueType.F32) + ), + List.of( + new WasmLocal("localA", WasmValueType.I64) + ), + List.of(WasmValueType.I64), List.of(new WasmI64Const(0)) )); -- cgit v1.2.3