Skip to content

Commit

Permalink
Make wat test export memory as well
Browse files Browse the repository at this point in the history
While it's a bit redundant to both import and export a memory,
it's what WASI implementations expect.

Emscripten, toywasm:
Import alone is fine. But export wouldn't hurt.

wasm-micro-runtime:
Export is checked. Nothing actually seems to rely on it though.

wasmtime:
Export is necessary?

References:
https://github.com/WebAssembly/WASI/blob/main/legacy/application-abi.md#current-unstable-abi
WebAssembly#22
  • Loading branch information
yamt committed Jan 23, 2023
1 parent 50ea450 commit d555b17
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/testsuite/wasi_threads_exit_main_block.wat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(module
(memory (import "foo" "bar") 1 1 shared)
(memory (export "memory") (import "foo" "bar") 1 1 shared)
(func $thread_spawn (import "wasi" "thread_spawn") (param i32) (result i32))
(func $proc_exit (import "wasi_snapshot_preview1" "proc_exit") (param i32))
(func (export "wasi_thread_start") (param i32 i32)
Expand Down
2 changes: 1 addition & 1 deletion test/testsuite/wasi_threads_exit_main_busy.wat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(module
(memory (import "foo" "bar") 1 1 shared)
(memory (export "memory") (import "foo" "bar") 1 1 shared)
(func $thread_spawn (import "wasi" "thread_spawn") (param i32) (result i32))
(func $proc_exit (import "wasi_snapshot_preview1" "proc_exit") (param i32))
(func (export "wasi_thread_start") (param i32 i32)
Expand Down
2 changes: 1 addition & 1 deletion test/testsuite/wasi_threads_exit_main_wasi.wat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(module
(memory (import "foo" "bar") 1 1 shared)
(memory (export "memory") (import "foo" "bar") 1 1 shared)
(func $thread_spawn (import "wasi" "thread_spawn") (param i32) (result i32))
(func $proc_exit (import "wasi_snapshot_preview1" "proc_exit") (param i32))
(func $poll_oneoff (import "wasi_snapshot_preview1" "poll_oneoff") (param i32 i32 i32 i32) (result i32))
Expand Down
2 changes: 1 addition & 1 deletion test/testsuite/wasi_threads_exit_nonmain_block.wat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(module
(memory (import "foo" "bar") 1 1 shared)
(memory (export "memory") (import "foo" "bar") 1 1 shared)
(func $thread_spawn (import "wasi" "thread_spawn") (param i32) (result i32))
(func $proc_exit (import "wasi_snapshot_preview1" "proc_exit") (param i32))
(func (export "wasi_thread_start") (param i32 i32)
Expand Down
2 changes: 1 addition & 1 deletion test/testsuite/wasi_threads_exit_nonmain_busy.wat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(module
(memory (import "foo" "bar") 1 1 shared)
(memory (export "memory") (import "foo" "bar") 1 1 shared)
(func $thread_spawn (import "wasi" "thread_spawn") (param i32) (result i32))
(func $proc_exit (import "wasi_snapshot_preview1" "proc_exit") (param i32))
(func (export "wasi_thread_start") (param i32 i32)
Expand Down
2 changes: 1 addition & 1 deletion test/testsuite/wasi_threads_exit_nonmain_wasi.wat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(module
(memory (import "foo" "bar") 1 1 shared)
(memory (export "memory") (import "foo" "bar") 1 1 shared)
(func $thread_spawn (import "wasi" "thread_spawn") (param i32) (result i32))
(func $proc_exit (import "wasi_snapshot_preview1" "proc_exit") (param i32))
(func $poll_oneoff (import "wasi_snapshot_preview1" "poll_oneoff") (param i32 i32 i32 i32) (result i32))
Expand Down
2 changes: 1 addition & 1 deletion test/testsuite/wasi_threads_spawn.wat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(module
(memory (import "foo" "bar") 1 1 shared)
(memory (export "memory") (import "foo" "bar") 1 1 shared)
(func $thread_spawn (import "wasi" "thread_spawn") (param i32) (result i32))
(func $proc_exit (import "wasi_snapshot_preview1" "proc_exit") (param i32))
(func (export "wasi_thread_start") (param i32 i32)
Expand Down

0 comments on commit d555b17

Please sign in to comment.