Skip to content

Commit

Permalink
wasm2c: run multi-memory tests
Browse files Browse the repository at this point in the history
This runs and passes 5 of the 9 multi-memory tests (although
one of them, binary.wast, is a nop for wasm2c itself).

The other 4 tests would require reference types or bulk memory:

	imports.wast
	load.wast
	memory-multi.wast
	store.wast
  • Loading branch information
keithw committed Feb 17, 2022
1 parent eb0e248 commit 426e286
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/tools/wasm2c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static void ParseOptions(int argc, char** argv) {
exit(1);
}
s_features.disable_bulk_memory();
s_features.enable_multi_memory();
}

// TODO(binji): copied from binary-writer-spec.cc, probably should share.
Expand Down
1 change: 1 addition & 0 deletions test/run-spec-wasm2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ def main(args):
error_cmdline=options.error_cmdline)
wast2json.verbose = options.print_cmd
wast2json.AppendOptionalArgs({'-v': options.verbose})
wast2json.AppendArg('--enable-multi-memory')

json_file_path = utils.ChangeDir(
utils.ChangeExt(options.file, '.json'), out_dir)
Expand Down
5 changes: 5 additions & 0 deletions test/wasm2c/spec/multi-memory/binary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
;;; TOOL: run-spec-wasm2c
;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/binary.wast
(;; STDOUT ;;;
0/0 tests passed.
;;; STDOUT ;;)
5 changes: 5 additions & 0 deletions test/wasm2c/spec/multi-memory/data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
;;; TOOL: run-spec-wasm2c
;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/data.wast
(;; STDOUT ;;;
14/14 tests passed.
;;; STDOUT ;;)
5 changes: 5 additions & 0 deletions test/wasm2c/spec/multi-memory/memory.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
;;; TOOL: run-spec-wasm2c
;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory.wast
(;; STDOUT ;;;
45/45 tests passed.
;;; STDOUT ;;)
5 changes: 5 additions & 0 deletions test/wasm2c/spec/multi-memory/memory_grow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
;;; TOOL: run-spec-wasm2c
;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_grow.wast
(;; STDOUT ;;;
131/131 tests passed.
;;; STDOUT ;;)
5 changes: 5 additions & 0 deletions test/wasm2c/spec/multi-memory/memory_size.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
;;; TOOL: run-spec-wasm2c
;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_size.wast
(;; STDOUT ;;;
40/40 tests passed.
;;; STDOUT ;;)

0 comments on commit 426e286

Please sign in to comment.