diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-06-25 13:24:26 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-06-25 13:24:26 +0100 |
| commit | cd63fb7d39491f917cf65c77d33f465de2e2dbda (patch) | |
| tree | c13e6be36f0a232b4c96541d97c604b266881f2b /src/test/java/org | |
| parent | e139747e1593885bc90f2ae5427a6215475b76fd (diff) | |
Write globals to symbol table
Diffstat (limited to 'src/test/java/org')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/backends/wasm/structure/WasmBinaryFormatModuleTests.java | 18 |
1 files changed, 10 insertions, 8 deletions
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 78054d23..58c39b85 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 @@ -164,18 +164,18 @@ public class WasmBinaryFormatModuleTests { .addImport(new WasmImport( "ModuleName1", "EntityName1", - new WasmImportDescriptor.Global(new WasmGlobalType( - WasmValueType.I32, - WasmMutability.MUTABLE - )) + new WasmImportDescriptor.Global( + "Global1", + new WasmGlobalType(WasmValueType.I32, WasmMutability.MUTABLE) + ) )) .addImport(new WasmImport( "ModuleName2", "EntityName2", - new WasmImportDescriptor.Global(new WasmGlobalType( - WasmValueType.I64, - WasmMutability.IMMUTABLE - )) + new WasmImportDescriptor.Global( + "Global2", + new WasmGlobalType(WasmValueType.I64, WasmMutability.IMMUTABLE) + ) )); var result = serializeModule(module); @@ -216,10 +216,12 @@ public class WasmBinaryFormatModuleTests { public void canSerializeModuleWithGlobals(Snapshotter snapshotter) throws IOException, InterruptedException { var module = WasmModule.EMPTY .addGlobal(new WasmGlobal( + "Global1", new WasmGlobalType(WasmValueType.I32, WasmMutability.MUTABLE), new WasmExpression(List.of(new WasmI32Const(7))) )) .addGlobal(new WasmGlobal( + "Global2", new WasmGlobalType(WasmValueType.I64, WasmMutability.IMMUTABLE), new WasmExpression(List.of(new WasmI64Const(9))) )); |
