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.

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

Export is checked: wasm-micro-runtime

Export is necessary?: wasmtime

References:
https://github.com/WebAssembly/WASI/blob/main/legacy/application-abi.md#current-unstable-abi
#22
  • Loading branch information
yamt committed Jan 11, 2023
1 parent 845ba39 commit 00ff533
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 00ff533

Please sign in to comment.