From 18a67918d0dcda0497581c2c54fec336443b1cbc Mon Sep 17 00:00:00 2001 From: Virgil Date: Fri, 10 Jan 2025 19:28:51 +0200 Subject: [PATCH] Add tests for parsing wasm types --- .gitignore | 1 + Makefile | 30 ++++++++- pykwasm/src/pykwasm/kdist/plugin.py | 10 +++ .../wasm-semantics/binary-parser-test.md | 32 +++++++++ .../kdist/wasm-semantics/binary-parser.md | 4 +- tests/binary-parsing/empty-module.wast | 2 + tests/binary-parsing/empty-module.wast.out | 65 +++++++++++++++++++ tests/binary-parsing/failing | 1 + tests/binary-parsing/type-empty.wast | 3 + tests/binary-parsing/type-empty.wast.out | 65 +++++++++++++++++++ .../binary-parsing/type-param-externref.wast | 3 + .../type-param-externref.wast.out | 65 +++++++++++++++++++ tests/binary-parsing/type-param-f32.wast | 3 + tests/binary-parsing/type-param-f32.wast.out | 65 +++++++++++++++++++ tests/binary-parsing/type-param-f64.wast | 3 + tests/binary-parsing/type-param-f64.wast.out | 65 +++++++++++++++++++ tests/binary-parsing/type-param-funcref.wast | 3 + .../type-param-funcref.wast.out | 65 +++++++++++++++++++ tests/binary-parsing/type-param-i32.wast | 3 + tests/binary-parsing/type-param-i32.wast.out | 65 +++++++++++++++++++ tests/binary-parsing/type-param-i64.wast | 3 + tests/binary-parsing/type-param-i64.wast.out | 65 +++++++++++++++++++ tests/binary-parsing/type-param-v128.wast | 3 + tests/binary-parsing/type-params.wast | 3 + tests/binary-parsing/type-params.wast.out | 65 +++++++++++++++++++ tests/binary-parsing/type-result.wast | 3 + tests/binary-parsing/type-result.wast.out | 65 +++++++++++++++++++ tests/binary-parsing/types.wast | 4 ++ tests/binary-parsing/types.wast.out | 65 +++++++++++++++++++ 29 files changed, 826 insertions(+), 3 deletions(-) create mode 100644 pykwasm/src/pykwasm/kdist/wasm-semantics/binary-parser-test.md create mode 100644 tests/binary-parsing/empty-module.wast create mode 100644 tests/binary-parsing/empty-module.wast.out create mode 100644 tests/binary-parsing/failing create mode 100644 tests/binary-parsing/type-empty.wast create mode 100644 tests/binary-parsing/type-empty.wast.out create mode 100644 tests/binary-parsing/type-param-externref.wast create mode 100644 tests/binary-parsing/type-param-externref.wast.out create mode 100644 tests/binary-parsing/type-param-f32.wast create mode 100644 tests/binary-parsing/type-param-f32.wast.out create mode 100644 tests/binary-parsing/type-param-f64.wast create mode 100644 tests/binary-parsing/type-param-f64.wast.out create mode 100644 tests/binary-parsing/type-param-funcref.wast create mode 100644 tests/binary-parsing/type-param-funcref.wast.out create mode 100644 tests/binary-parsing/type-param-i32.wast create mode 100644 tests/binary-parsing/type-param-i32.wast.out create mode 100644 tests/binary-parsing/type-param-i64.wast create mode 100644 tests/binary-parsing/type-param-i64.wast.out create mode 100644 tests/binary-parsing/type-param-v128.wast create mode 100644 tests/binary-parsing/type-params.wast create mode 100644 tests/binary-parsing/type-params.wast.out create mode 100644 tests/binary-parsing/type-result.wast create mode 100644 tests/binary-parsing/type-result.wast.out create mode 100644 tests/binary-parsing/types.wast create mode 100644 tests/binary-parsing/types.wast.out diff --git a/.gitignore b/.gitignore index fb1f0913b..e2bafe2c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /.kwasm-logs/ /tests/*/*-out +/tmp *.pdf *.sty diff --git a/Makefile b/Makefile index 6aabc2151..a9006fc9e 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ endif pykwasm: $(POETRY) install -.PHONY: build build-simple build-prove build-wrc20 +.PHONY: build build-simple build-prove build-wrc20 build-binary-parser-test build: pykwasm $(KDIST) -v build -j3 @@ -33,6 +33,9 @@ build-prove: pykwasm build-wrc20: pykwasm $(KDIST) -v build wasm-semantics.wrc20 -j3 +build-binary-parser-test: pykwasm + $(KDIST) -v build wasm-semantics.binary-parser-test -j3 + .PHONY: clean clean: pykwasm $(KDIST) clean @@ -271,6 +274,31 @@ simple_tests_passing := $(filter-out $(simple_tests_failing), $(simple_tests)) test-simple: $(simple_tests_passing:=.run) +### Parsing Tests + +build/binary-parsing/%.bprun: tests/binary-parsing/% # build-binary-parser-test TODO: Figure out how to depend on this without rerunning the test each time. + mkdir -p build/binary-parsing + wat2wasm $< -o $@.wasm + cat $@.wasm \ + | xxd -ps \ + | sed 's/\(..\)/\\x\1/g' \ + | sed 's/^\(.*\)/\\dv{SortBytes{}}("\1")/' \ + > $@.kore + krun \ + --parser cat \ + $@.kore \ + --definition $(shell $(KDIST) which wasm-semantics.binary-parser-test) \ + > $@-out + $(CHECK) $@-out $<.out + touch $@ + +binary_parsing_tests := $(wildcard tests/binary-parsing/*.wast) +binary_parsing_failing := $(shell cat tests/binary-parsing/failing) +binary_parsing_passing := $(filter-out $(binary_parsing_failing), $(binary_parsing_tests)) +binary_parsing_results := $(patsubst tests/binary-parsing/%, build/binary-parsing/%.bprun, $(binary_parsing_passing)) + +test-binary-parsing: $(binary_parsing_results) + ### Conformance Tests conformance_tests:=$(wildcard tests/wasm-tests/test/core/*.wast) diff --git a/pykwasm/src/pykwasm/kdist/plugin.py b/pykwasm/src/pykwasm/kdist/plugin.py index 93ad806cd..6048b2714 100644 --- a/pykwasm/src/pykwasm/kdist/plugin.py +++ b/pykwasm/src/pykwasm/kdist/plugin.py @@ -137,4 +137,14 @@ def ulm_wasm_args(src_dir: Path, ulm_test: bool = False) -> dict[str, Any]: 'ulm-wasm-test': KompileTarget( lambda src_dir: ulm_wasm_args(src_dir, ulm_test=True), ), + 'binary-parser-test': KompileTarget( + lambda src_dir: { + 'backend': PykBackend.LLVM, + 'main_file': src_dir / 'wasm-semantics/binary-parser-test.md', + 'main_module': 'BINARY-PARSER-TEST', + 'syntax_module': 'BINARY-PARSER-TEST-SYNTAX', + 'md_selector': 'k', + 'warnings_to_errors': True, + }, + ), } diff --git a/pykwasm/src/pykwasm/kdist/wasm-semantics/binary-parser-test.md b/pykwasm/src/pykwasm/kdist/wasm-semantics/binary-parser-test.md new file mode 100644 index 000000000..a5935ec32 --- /dev/null +++ b/pykwasm/src/pykwasm/kdist/wasm-semantics/binary-parser-test.md @@ -0,0 +1,32 @@ +```k +requires "binary-parser.md" +requires "wasm.md" + +module BINARY-PARSER-TEST-SYNTAX +endmodule + +module BINARY-PARSER-TEST + imports BINARY-PARSER-TEST-SYNTAX + + imports BINARY-PARSER + + syntax KItem ::= parseBinary(Bytes) + + configuration + parseBinary($PGM) + + + + rule parseBinary(B:Bytes) => parseModule(B) + + rule addDefnToModule + ( false => true + , _D:Defn + , #module(... metadata: _ => #meta (... id: , funcIds: .Map , filename: "error: test addDefnToModule branch called." ))) + [owise] + + rule parseSection(U:UnparsedSection) + => parseError("parseSection test default", ListItem(U)) + [owise] +endmodule +``` \ No newline at end of file diff --git a/pykwasm/src/pykwasm/kdist/wasm-semantics/binary-parser.md b/pykwasm/src/pykwasm/kdist/wasm-semantics/binary-parser.md index 1987e12e3..01e6f75fa 100644 --- a/pykwasm/src/pykwasm/kdist/wasm-semantics/binary-parser.md +++ b/pykwasm/src/pykwasm/kdist/wasm-semantics/binary-parser.md @@ -650,7 +650,7 @@ endmodule ``` ```k -module BINARY-PARSER [private] +module BINARY-PARSER //[private] imports BINARY-PARSER-DATA imports LIST imports STRING @@ -956,7 +956,7 @@ module BINARY-PARSER [private] requires Index +Int lengthBytes(Constant) <=Int lengthBytes(Buffer) andBool substrBytes(Buffer, Index, Index +Int lengthBytes(Constant)) ==K Constant rule parseConstant(bwi(Buffer:Bytes, Index:Int), Constant:Bytes) - => parseError("parseConstant", ListItem(Buffer) ListItem(lengthBytes(Buffer)) ListItem(Index) ListItem(Constant)) + => parseError("parseConstant", ListItem(lengthBytes(Buffer)) ListItem(Index) ListItem(Constant) ListItem(Buffer)) [owise] rule parseConstant(E:ParseError, _:Bytes) => E diff --git a/tests/binary-parsing/empty-module.wast b/tests/binary-parsing/empty-module.wast new file mode 100644 index 000000000..6ee5d58fe --- /dev/null +++ b/tests/binary-parsing/empty-module.wast @@ -0,0 +1,2 @@ +(module $mymodule +) diff --git a/tests/binary-parsing/empty-module.wast.out b/tests/binary-parsing/empty-module.wast.out new file mode 100644 index 000000000..1e570548d --- /dev/null +++ b/tests/binary-parsing/empty-module.wast.out @@ -0,0 +1,65 @@ + + + #module (... types: .EmptyStmts , funcs: .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K + + + + .K + + + .ValStack + + + + .List + + + .Int + + + + .Map + + + .Map + + + .ModuleInstCellMap + + + 0 + + + + .FuncDefCellMap + + + 0 + + + .TabInstCellMap + + + 0 + + + .List + + + .GlobalInstCellMap + + + 0 + + + .ElemInstCellMap + + + 0 + + + + true + + + diff --git a/tests/binary-parsing/failing b/tests/binary-parsing/failing new file mode 100644 index 000000000..f46364b41 --- /dev/null +++ b/tests/binary-parsing/failing @@ -0,0 +1 @@ +tests/binary-parsing/type-param-v128.wast diff --git a/tests/binary-parsing/type-empty.wast b/tests/binary-parsing/type-empty.wast new file mode 100644 index 000000000..4595ffb34 --- /dev/null +++ b/tests/binary-parsing/type-empty.wast @@ -0,0 +1,3 @@ +(module $mymodule + (type (;0;) (func)) +) diff --git a/tests/binary-parsing/type-empty.wast.out b/tests/binary-parsing/type-empty.wast.out new file mode 100644 index 000000000..e48f60fb1 --- /dev/null +++ b/tests/binary-parsing/type-empty.wast.out @@ -0,0 +1,65 @@ + + + #module (... types: #type (... type: [ .ValTypes ] -> [ .ValTypes ] , metadata: ) .EmptyStmts , funcs: .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K + + + + .K + + + .ValStack + + + + .List + + + .Int + + + + .Map + + + .Map + + + .ModuleInstCellMap + + + 0 + + + + .FuncDefCellMap + + + 0 + + + .TabInstCellMap + + + 0 + + + .List + + + .GlobalInstCellMap + + + 0 + + + .ElemInstCellMap + + + 0 + + + + true + + + diff --git a/tests/binary-parsing/type-param-externref.wast b/tests/binary-parsing/type-param-externref.wast new file mode 100644 index 000000000..5e6569f11 --- /dev/null +++ b/tests/binary-parsing/type-param-externref.wast @@ -0,0 +1,3 @@ +(module $mymodule + (type (;0;) (func (param externref))) +) diff --git a/tests/binary-parsing/type-param-externref.wast.out b/tests/binary-parsing/type-param-externref.wast.out new file mode 100644 index 000000000..df71cb56e --- /dev/null +++ b/tests/binary-parsing/type-param-externref.wast.out @@ -0,0 +1,65 @@ + + + #module (... types: #type (... type: [ externref .ValTypes ] -> [ .ValTypes ] , metadata: ) .EmptyStmts , funcs: .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K + + + + .K + + + .ValStack + + + + .List + + + .Int + + + + .Map + + + .Map + + + .ModuleInstCellMap + + + 0 + + + + .FuncDefCellMap + + + 0 + + + .TabInstCellMap + + + 0 + + + .List + + + .GlobalInstCellMap + + + 0 + + + .ElemInstCellMap + + + 0 + + + + true + + + diff --git a/tests/binary-parsing/type-param-f32.wast b/tests/binary-parsing/type-param-f32.wast new file mode 100644 index 000000000..d4459b9dd --- /dev/null +++ b/tests/binary-parsing/type-param-f32.wast @@ -0,0 +1,3 @@ +(module $mymodule + (type (;0;) (func (param f32))) +) diff --git a/tests/binary-parsing/type-param-f32.wast.out b/tests/binary-parsing/type-param-f32.wast.out new file mode 100644 index 000000000..ea4c7c639 --- /dev/null +++ b/tests/binary-parsing/type-param-f32.wast.out @@ -0,0 +1,65 @@ + + + #module (... types: #type (... type: [ f32 .ValTypes ] -> [ .ValTypes ] , metadata: ) .EmptyStmts , funcs: .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K + + + + .K + + + .ValStack + + + + .List + + + .Int + + + + .Map + + + .Map + + + .ModuleInstCellMap + + + 0 + + + + .FuncDefCellMap + + + 0 + + + .TabInstCellMap + + + 0 + + + .List + + + .GlobalInstCellMap + + + 0 + + + .ElemInstCellMap + + + 0 + + + + true + + + diff --git a/tests/binary-parsing/type-param-f64.wast b/tests/binary-parsing/type-param-f64.wast new file mode 100644 index 000000000..b10fcc1de --- /dev/null +++ b/tests/binary-parsing/type-param-f64.wast @@ -0,0 +1,3 @@ +(module $mymodule + (type (;0;) (func (param f64))) +) diff --git a/tests/binary-parsing/type-param-f64.wast.out b/tests/binary-parsing/type-param-f64.wast.out new file mode 100644 index 000000000..34f80cbcd --- /dev/null +++ b/tests/binary-parsing/type-param-f64.wast.out @@ -0,0 +1,65 @@ + + + #module (... types: #type (... type: [ f64 .ValTypes ] -> [ .ValTypes ] , metadata: ) .EmptyStmts , funcs: .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K + + + + .K + + + .ValStack + + + + .List + + + .Int + + + + .Map + + + .Map + + + .ModuleInstCellMap + + + 0 + + + + .FuncDefCellMap + + + 0 + + + .TabInstCellMap + + + 0 + + + .List + + + .GlobalInstCellMap + + + 0 + + + .ElemInstCellMap + + + 0 + + + + true + + + diff --git a/tests/binary-parsing/type-param-funcref.wast b/tests/binary-parsing/type-param-funcref.wast new file mode 100644 index 000000000..851ecd3df --- /dev/null +++ b/tests/binary-parsing/type-param-funcref.wast @@ -0,0 +1,3 @@ +(module $mymodule + (type (;0;) (func (param funcref))) +) diff --git a/tests/binary-parsing/type-param-funcref.wast.out b/tests/binary-parsing/type-param-funcref.wast.out new file mode 100644 index 000000000..c6b7fbcca --- /dev/null +++ b/tests/binary-parsing/type-param-funcref.wast.out @@ -0,0 +1,65 @@ + + + #module (... types: #type (... type: [ funcref .ValTypes ] -> [ .ValTypes ] , metadata: ) .EmptyStmts , funcs: .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K + + + + .K + + + .ValStack + + + + .List + + + .Int + + + + .Map + + + .Map + + + .ModuleInstCellMap + + + 0 + + + + .FuncDefCellMap + + + 0 + + + .TabInstCellMap + + + 0 + + + .List + + + .GlobalInstCellMap + + + 0 + + + .ElemInstCellMap + + + 0 + + + + true + + + diff --git a/tests/binary-parsing/type-param-i32.wast b/tests/binary-parsing/type-param-i32.wast new file mode 100644 index 000000000..dfbc9d2ec --- /dev/null +++ b/tests/binary-parsing/type-param-i32.wast @@ -0,0 +1,3 @@ +(module $mymodule + (type (;0;) (func (param i32))) +) diff --git a/tests/binary-parsing/type-param-i32.wast.out b/tests/binary-parsing/type-param-i32.wast.out new file mode 100644 index 000000000..e949abcf1 --- /dev/null +++ b/tests/binary-parsing/type-param-i32.wast.out @@ -0,0 +1,65 @@ + + + #module (... types: #type (... type: [ i32 .ValTypes ] -> [ .ValTypes ] , metadata: ) .EmptyStmts , funcs: .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K + + + + .K + + + .ValStack + + + + .List + + + .Int + + + + .Map + + + .Map + + + .ModuleInstCellMap + + + 0 + + + + .FuncDefCellMap + + + 0 + + + .TabInstCellMap + + + 0 + + + .List + + + .GlobalInstCellMap + + + 0 + + + .ElemInstCellMap + + + 0 + + + + true + + + diff --git a/tests/binary-parsing/type-param-i64.wast b/tests/binary-parsing/type-param-i64.wast new file mode 100644 index 000000000..04216cd61 --- /dev/null +++ b/tests/binary-parsing/type-param-i64.wast @@ -0,0 +1,3 @@ +(module $mymodule + (type (;0;) (func (param i64))) +) diff --git a/tests/binary-parsing/type-param-i64.wast.out b/tests/binary-parsing/type-param-i64.wast.out new file mode 100644 index 000000000..901f4b0fc --- /dev/null +++ b/tests/binary-parsing/type-param-i64.wast.out @@ -0,0 +1,65 @@ + + + #module (... types: #type (... type: [ i64 .ValTypes ] -> [ .ValTypes ] , metadata: ) .EmptyStmts , funcs: .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K + + + + .K + + + .ValStack + + + + .List + + + .Int + + + + .Map + + + .Map + + + .ModuleInstCellMap + + + 0 + + + + .FuncDefCellMap + + + 0 + + + .TabInstCellMap + + + 0 + + + .List + + + .GlobalInstCellMap + + + 0 + + + .ElemInstCellMap + + + 0 + + + + true + + + diff --git a/tests/binary-parsing/type-param-v128.wast b/tests/binary-parsing/type-param-v128.wast new file mode 100644 index 000000000..47e7dc9ce --- /dev/null +++ b/tests/binary-parsing/type-param-v128.wast @@ -0,0 +1,3 @@ +(module $mymodule + (type (;0;) (func (param v128))) +) diff --git a/tests/binary-parsing/type-params.wast b/tests/binary-parsing/type-params.wast new file mode 100644 index 000000000..91ee551f4 --- /dev/null +++ b/tests/binary-parsing/type-params.wast @@ -0,0 +1,3 @@ +(module $mymodule + (type (;0;) (func (param i32 i32 i32 i32 i32))) +) diff --git a/tests/binary-parsing/type-params.wast.out b/tests/binary-parsing/type-params.wast.out new file mode 100644 index 000000000..23f69678e --- /dev/null +++ b/tests/binary-parsing/type-params.wast.out @@ -0,0 +1,65 @@ + + + #module (... types: #type (... type: [ i32 i32 i32 i32 i32 .ValTypes ] -> [ .ValTypes ] , metadata: ) .EmptyStmts , funcs: .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K + + + + .K + + + .ValStack + + + + .List + + + .Int + + + + .Map + + + .Map + + + .ModuleInstCellMap + + + 0 + + + + .FuncDefCellMap + + + 0 + + + .TabInstCellMap + + + 0 + + + .List + + + .GlobalInstCellMap + + + 0 + + + .ElemInstCellMap + + + 0 + + + + true + + + diff --git a/tests/binary-parsing/type-result.wast b/tests/binary-parsing/type-result.wast new file mode 100644 index 000000000..da75dbbe7 --- /dev/null +++ b/tests/binary-parsing/type-result.wast @@ -0,0 +1,3 @@ +(module $mymodule + (type (;0;) (func (result i32))) +) diff --git a/tests/binary-parsing/type-result.wast.out b/tests/binary-parsing/type-result.wast.out new file mode 100644 index 000000000..bec9e8370 --- /dev/null +++ b/tests/binary-parsing/type-result.wast.out @@ -0,0 +1,65 @@ + + + #module (... types: #type (... type: [ .ValTypes ] -> [ i32 .ValTypes ] , metadata: ) .EmptyStmts , funcs: .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K + + + + .K + + + .ValStack + + + + .List + + + .Int + + + + .Map + + + .Map + + + .ModuleInstCellMap + + + 0 + + + + .FuncDefCellMap + + + 0 + + + .TabInstCellMap + + + 0 + + + .List + + + .GlobalInstCellMap + + + 0 + + + .ElemInstCellMap + + + 0 + + + + true + + + diff --git a/tests/binary-parsing/types.wast b/tests/binary-parsing/types.wast new file mode 100644 index 000000000..7cdc2ae63 --- /dev/null +++ b/tests/binary-parsing/types.wast @@ -0,0 +1,4 @@ +(module $mymodule + (type (;0;) (func (param i32))) + (type (;1;) (func (param i64))) +) diff --git a/tests/binary-parsing/types.wast.out b/tests/binary-parsing/types.wast.out new file mode 100644 index 000000000..74fe71c62 --- /dev/null +++ b/tests/binary-parsing/types.wast.out @@ -0,0 +1,65 @@ + + + #module (... types: #type (... type: [ i32 .ValTypes ] -> [ .ValTypes ] , metadata: ) #type (... type: [ i64 .ValTypes ] -> [ .ValTypes ] , metadata: ) .EmptyStmts , funcs: .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K + + + + .K + + + .ValStack + + + + .List + + + .Int + + + + .Map + + + .Map + + + .ModuleInstCellMap + + + 0 + + + + .FuncDefCellMap + + + 0 + + + .TabInstCellMap + + + 0 + + + .List + + + .GlobalInstCellMap + + + 0 + + + .ElemInstCellMap + + + 0 + + + + true + + +