diff options
author | Alex Crichton <alex@alexcrichton.com> | 2019-02-14 11:07:03 -0600 |
---|---|---|
committer | Ben Smith <binjimin@gmail.com> | 2019-02-14 09:07:03 -0800 |
commit | 2b33a37dc49c033ba9b34f438233f204002415d9 (patch) | |
tree | c7c091542e4287b2e19dfb644e5186ce42235cf0 /test/roundtrip | |
parent | 19191efaf1b5b92b0357b303be1b25cf439be9a2 (diff) | |
download | wabt-2b33a37dc49c033ba9b34f438233f204002415d9.tar.gz wabt-2b33a37dc49c033ba9b34f438233f204002415d9.tar.bz2 wabt-2b33a37dc49c033ba9b34f438233f204002415d9.zip |
Add support for the reference types proposal (#938)
* Add support for the reference types proposal
This commit adds support for the reference types proposal to wabt.
Namely it adds new opcodes like `table.{get,set,grow}` as well as adds a
new `anyref` type. These are plumbed throughout for various operations
in relatively simple fashions, no support was added for a subtyping
relationship between `anyref` and `anyfunc` just yet.
This also raises the restriction that multiple tables are disallowed,
allowing multiple tables to exist when `--enable-reference-types` is
passed.
* Allow nonzero table indices in `call_indirect`
Plumb support throughout for the `call_indirect` instruction (and
`return_call_indirect`) to work with multi-table modules according to
the reference types proposal.
Diffstat (limited to 'test/roundtrip')
-rw-r--r-- | test/roundtrip/fold-reference-types.txt | 22 | ||||
-rw-r--r-- | test/roundtrip/generate-func-type-names.txt | 2 | ||||
-rw-r--r-- | test/roundtrip/generate-some-names.txt | 2 |
3 files changed, 24 insertions, 2 deletions
diff --git a/test/roundtrip/fold-reference-types.txt b/test/roundtrip/fold-reference-types.txt new file mode 100644 index 00000000..23412a5f --- /dev/null +++ b/test/roundtrip/fold-reference-types.txt @@ -0,0 +1,22 @@ +;;; TOOL: run-roundtrip +;;; ARGS: --stdout --fold-exprs --enable-reference-types + +(module + (table $t 1 anyref) + (func + i32.const 0 + i32.const 0 + table.get $t + table.set $t + ) +) +(;; STDOUT ;;; +(module + (type (;0;) (func)) + (func (;0;) (type 0) + (table.set 0 + (i32.const 0) + (table.get 0 + (i32.const 0)))) + (table (;0;) 1 anyref)) +;;; STDOUT ;;) diff --git a/test/roundtrip/generate-func-type-names.txt b/test/roundtrip/generate-func-type-names.txt index d5af88f7..7b9c177d 100644 --- a/test/roundtrip/generate-func-type-names.txt +++ b/test/roundtrip/generate-func-type-names.txt @@ -18,7 +18,7 @@ (func $f1 (type $t0)) (func $f2 (type $t1) (result i32) i32.const 0 - call_indirect (type $t0) + call_indirect (type $t0) $T0 i32.const 1) (table $T0 1 1 anyfunc) (elem $e0 (i32.const 0) $foo.bar)) diff --git a/test/roundtrip/generate-some-names.txt b/test/roundtrip/generate-some-names.txt index 4af66724..5ea9d620 100644 --- a/test/roundtrip/generate-some-names.txt +++ b/test/roundtrip/generate-some-names.txt @@ -45,7 +45,7 @@ drop i32.const 0 i32.const 1 - call_indirect (type $t0) + call_indirect (type $t0) $T0 drop local.get $param1 drop |