diff options
author | Sam Clegg <sbc@chromium.org> | 2024-05-20 13:44:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-20 20:44:25 +0000 |
commit | 5999c996c36abeba912599b5fba83d0b2989ed4c (patch) | |
tree | 0063182a5940307729726dc810b02cee0f3aa5fe | |
parent | 3e336052ea820be3e2da722f4a02f68d75283a6d (diff) | |
download | binaryen-5999c996c36abeba912599b5fba83d0b2989ed4c.tar.gz binaryen-5999c996c36abeba912599b5fba83d0b2989ed4c.tar.bz2 binaryen-5999c996c36abeba912599b5fba83d0b2989ed4c.zip |
[table64] Preserve 64-bit table flag when writing binaries (#6610)
-rw-r--r-- | src/wasm/wasm-binary.cpp | 2 | ||||
-rw-r--r-- | test/lit/table64.wast | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index befafde59..ec06692a4 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -365,7 +365,7 @@ void WasmBinaryWriter::writeImports() { table->max, table->hasMax(), /*shared=*/false, - /*is64*/ false); + table->is64()); }); finishSection(start); } diff --git a/test/lit/table64.wast b/test/lit/table64.wast new file mode 100644 index 000000000..86405fcf8 --- /dev/null +++ b/test/lit/table64.wast @@ -0,0 +1,11 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. +;; RUN: wasm-opt %s -all --roundtrip -S -o - | filecheck %s + + +;; Most table64 test coverage is handled by the spec tests. +;; Here we test what the spec doesn't cover, currently just the i64 flag +;; is preserved on table imports during roundtripping. +(module + (import "env" "table" (table i64 1 funcref)) +) +;; CHECK: (import "env" "table" (table $timport$0 i64 1 funcref)) |