From 00ff5335825b417ab706ab049f0a36b9519cc647 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 11 Jan 2023 16:06:58 +0900 Subject: [PATCH] Make wat test export memory as well 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 https://github.com/WebAssembly/wasi-threads/issues/22 --- test/testsuite/wasi_threads_exit_main_block.wat | 2 +- test/testsuite/wasi_threads_exit_main_busy.wat | 2 +- test/testsuite/wasi_threads_exit_main_wasi.wat | 2 +- test/testsuite/wasi_threads_exit_nonmain_block.wat | 2 +- test/testsuite/wasi_threads_exit_nonmain_busy.wat | 2 +- test/testsuite/wasi_threads_exit_nonmain_wasi.wat | 2 +- test/testsuite/wasi_threads_spawn.wat | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/testsuite/wasi_threads_exit_main_block.wat b/test/testsuite/wasi_threads_exit_main_block.wat index e0a0539..1d2dbd2 100644 --- a/test/testsuite/wasi_threads_exit_main_block.wat +++ b/test/testsuite/wasi_threads_exit_main_block.wat @@ -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) diff --git a/test/testsuite/wasi_threads_exit_main_busy.wat b/test/testsuite/wasi_threads_exit_main_busy.wat index 9d96f38..f8263b6 100644 --- a/test/testsuite/wasi_threads_exit_main_busy.wat +++ b/test/testsuite/wasi_threads_exit_main_busy.wat @@ -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) diff --git a/test/testsuite/wasi_threads_exit_main_wasi.wat b/test/testsuite/wasi_threads_exit_main_wasi.wat index bf09d5e..44d0db9 100644 --- a/test/testsuite/wasi_threads_exit_main_wasi.wat +++ b/test/testsuite/wasi_threads_exit_main_wasi.wat @@ -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)) diff --git a/test/testsuite/wasi_threads_exit_nonmain_block.wat b/test/testsuite/wasi_threads_exit_nonmain_block.wat index 02e3800..b990715 100644 --- a/test/testsuite/wasi_threads_exit_nonmain_block.wat +++ b/test/testsuite/wasi_threads_exit_nonmain_block.wat @@ -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) diff --git a/test/testsuite/wasi_threads_exit_nonmain_busy.wat b/test/testsuite/wasi_threads_exit_nonmain_busy.wat index 78d979d..aaa1c42 100644 --- a/test/testsuite/wasi_threads_exit_nonmain_busy.wat +++ b/test/testsuite/wasi_threads_exit_nonmain_busy.wat @@ -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) diff --git a/test/testsuite/wasi_threads_exit_nonmain_wasi.wat b/test/testsuite/wasi_threads_exit_nonmain_wasi.wat index 56142f9..8d03f0e 100644 --- a/test/testsuite/wasi_threads_exit_nonmain_wasi.wat +++ b/test/testsuite/wasi_threads_exit_nonmain_wasi.wat @@ -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)) diff --git a/test/testsuite/wasi_threads_spawn.wat b/test/testsuite/wasi_threads_spawn.wat index 69a987e..c92edf7 100644 --- a/test/testsuite/wasi_threads_spawn.wat +++ b/test/testsuite/wasi_threads_spawn.wat @@ -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)