From d23c99d036ab31f7de21bc4a90b651c4cfd4a356 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Thu, 14 Jun 2018 15:16:43 -0700 Subject: Add support for multi-value proposal (#861) Use the `--enable-multi-value` flag to enable. A lot of code already "worked" with multi-value, and just needed to remove the restrictions. Most of the other changes are modifying the callback APIs to be more general, e.g. taking more than 1 result type. * Types are now stored as the negative values; this works nicely with the encoding of inline function types (used for block signatures), which are always positive values. * Remove `BlockSignature` and use `BlockDeclaration` instead, which is just a typedef to `FuncSignature`. This allows for explicit or implicit type specifications on the block signatures. * Allow for >1 "keep" values in the DropKeep interpreter instruction --- test/interp/if-multi.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/interp/if-multi.txt (limited to 'test/interp/if-multi.txt') diff --git a/test/interp/if-multi.txt b/test/interp/if-multi.txt new file mode 100644 index 00000000..64881b33 --- /dev/null +++ b/test/interp/if-multi.txt @@ -0,0 +1,28 @@ +;;; TOOL: run-interp +;;; ARGS*: --enable-multi-value +(module + (func (export "if-multi-result") (result i32) + i32.const 1 + if (result i32 f32) + i32.const 2 + f32.const 3 + else + unreachable + end + i32.trunc_s/f32 + i32.add) + + (func (export "if-param") (result f32) + f32.const 3 + i32.const 0 + if (param f32) (result f32) + unreachable + else + f32.const 100 + f32.add + end) +) +(;; STDOUT ;;; +if-multi-result() => i32:5 +if-param() => f32:103.000000 +;;; STDOUT ;;) -- cgit v1.2.3