diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-03-09 13:32:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-09 13:32:03 -0800 |
commit | be4be557567251a73f40bfd7a48220b33f5ddc58 (patch) | |
tree | d4aa0a25a1c7331b56404c76eea1a6cfa971c44e /test/example | |
parent | d6508e1f9cef33c43016e4da7dd4b94392f280a9 (diff) | |
download | binaryen-be4be557567251a73f40bfd7a48220b33f5ddc58.tar.gz binaryen-be4be557567251a73f40bfd7a48220b33f5ddc58.tar.bz2 binaryen-be4be557567251a73f40bfd7a48220b33f5ddc58.zip |
use a single space for pretty printing of wasts, so massive wasts are less unruly (#928)
Diffstat (limited to 'test/example')
-rw-r--r-- | test/example/c-api-hello-world.txt | 14 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 3826 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt.txt | 1880 | ||||
-rw-r--r-- | test/example/c-api-unused-mem.txt | 192 | ||||
-rw-r--r-- | test/example/relooper-fuzz.txt | 992 | ||||
-rw-r--r-- | test/example/relooper-fuzz1.txt | 924 |
6 files changed, 3914 insertions, 3914 deletions
diff --git a/test/example/c-api-hello-world.txt b/test/example/c-api-hello-world.txt index 0ca9a0ae3..640074360 100644 --- a/test/example/c-api-hello-world.txt +++ b/test/example/c-api-hello-world.txt @@ -1,10 +1,10 @@ (module - (type $iii (func (param i32 i32) (result i32))) - (memory $0 0) - (func $adder (type $iii) (param $0 i32) (param $1 i32) (result i32) - (i32.add - (get_local $0) - (get_local $1) - ) + (type $iii (func (param i32 i32) (result i32))) + (memory $0 0) + (func $adder (type $iii) (param $0 i32) (param $1 i32) (result i32) + (i32.add + (get_local $0) + (get_local $1) ) + ) ) diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 4eee5c0c0..2c25a70ab 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -4,1065 +4,1065 @@ BinaryenInt64: 2 BinaryenFloat32: 3 BinaryenFloat64: 4 (f32.neg - (f32.const -33.61199951171875) + (f32.const -33.61199951171875) ) (module - (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) - (type $fiF (func (param i32 f64) (result f32))) - (type $v (func)) - (type $3 (func)) - (import "module" "base" (func $an-imported (param i32 f64) (result f32))) - (table 1 1 anyfunc) - (elem (i32.const 0) "$kitchen()sinker") - (memory $0 1 256) - (data (i32.const 10) "hello, world") - (export "kitchen_sinker" (func "$kitchen()sinker")) - (export "mem" (memory $0)) - (start $starter) - (func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) - (local $4 i32) - (block $the-body i32 - (block $the-nothing - (drop - (block $the-value i32 - (drop - (i32.clz - (i32.const -10) - ) - ) - (drop - (i64.ctz - (i64.const -22) - ) - ) - (drop - (i32.popcnt - (i32.const -10) - ) - ) - (drop - (f32.neg - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.abs - (f64.const -9005.841) - ) - ) - (drop - (f32.ceil - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.floor - (f64.const -9005.841) - ) - ) - (drop - (f32.trunc - (f32.const -33.61199951171875) - ) - ) - (drop - (f32.nearest - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.sqrt - (f64.const -9005.841) - ) - ) - (drop - (i32.eqz - (i32.const -10) - ) - ) - (drop - (i64.extend_s/i32 - (i32.const -10) - ) - ) - (drop - (i64.extend_u/i32 - (i32.const -10) - ) - ) - (drop - (i32.wrap/i64 - (i64.const -22) - ) - ) - (drop - (i32.trunc_s/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_s/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_u/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_u/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_s/f64 - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_s/f64 - (f64.const -9005.841) - ) - ) - (drop - (i32.trunc_u/f64 - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_u/f64 - (f64.const -9005.841) - ) - ) - (drop - (i32.reinterpret/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.reinterpret/f64 - (f64.const -9005.841) - ) - ) - (drop - (f32.convert_s/i32 - (i32.const -10) - ) - ) - (drop - (f64.convert_s/i32 - (i32.const -10) - ) - ) - (drop - (f32.convert_u/i32 - (i32.const -10) - ) - ) - (drop - (f64.convert_u/i32 - (i32.const -10) - ) - ) - (drop - (f32.convert_s/i64 - (i64.const -22) - ) - ) - (drop - (f64.convert_s/i64 - (i64.const -22) - ) - ) - (drop - (f32.convert_u/i64 - (i64.const -22) - ) - ) - (drop - (f64.convert_u/i64 - (i64.const -22) - ) - ) - (drop - (f64.promote/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (f32.demote/f64 - (f64.const -9005.841) - ) - ) - (drop - (f32.reinterpret/i32 - (i32.const -10) - ) - ) - (drop - (f64.reinterpret/i64 - (i64.const -22) - ) - ) - (drop - (i32.add - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (f64.sub - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (i32.div_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.div_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i64.rem_s - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.rem_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.and - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.or - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.xor - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.shl - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i64.shr_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.shr_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.rotl - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.rotr - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (f32.div - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.copysign - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f32.min - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.max - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (i32.eq - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (f32.ne - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (i32.lt_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.lt_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i64.le_s - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.le_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.gt_s - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.gt_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.ge_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.ge_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (f32.lt - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.le - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f64.gt - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f32.ge - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (block - ) - (if - (i32.const 1) - (drop - (i32.const 2) - ) - (drop - (i32.const 3) - ) - ) - (if - (i32.const 4) - (drop - (i32.const 5) - ) - ) - (drop - (loop $in i32 - (i32.const 0) - ) - ) - (drop - (loop i32 - (i32.const 0) - ) - ) - (drop - (br_if $the-value - (i32.const 1) - (i32.const 0) - ) - ) - (br_if $the-nothing - (i32.const 2) - ) - (br $the-value - (i32.const 3) - ) - (br $the-nothing) - (br_table $the-value $the-value - (i32.const 1) - (i32.const 0) - ) - (br_table $the-nothing $the-nothing - (i32.const 2) - ) - (drop - (i32.eqz - (call "$kitchen()sinker" - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - ) - ) - ) - (drop - (i32.eqz - (i32.trunc_s/f32 - (call $an-imported - (i32.const 13) - (f64.const 3.7) - ) - ) - ) - ) - (drop - (i32.eqz - (call_indirect $iiIfF - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - (i32.const 2449) - ) - ) - ) - (drop - (get_local $0) - ) - (set_local $0 - (i32.const 101) - ) - (drop - (tee_local $0 - (i32.const 102) - ) - ) - (drop - (i32.load - (i32.const 1) - ) - ) - (drop - (i64.load16_s offset=2 align=1 - (i32.const 8) - ) - ) - (drop - (f32.load - (i32.const 2) - ) - ) - (drop - (f64.load offset=2 - (i32.const 9) - ) - ) - (i32.store - (i32.const 10) - (i32.const 11) - ) - (i64.store offset=2 align=4 - (i32.const 110) - (i64.const 111) - ) - (drop - (select - (i32.const 3) - (i32.const 5) - (i32.const 1) - ) - ) - (return - (i32.const 1337) - ) - (nop) - (unreachable) - ) - ) + (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) + (type $fiF (func (param i32 f64) (result f32))) + (type $v (func)) + (type $3 (func)) + (import "module" "base" (func $an-imported (param i32 f64) (result f32))) + (table 1 1 anyfunc) + (elem (i32.const 0) "$kitchen()sinker") + (memory $0 1 256) + (data (i32.const 10) "hello, world") + (export "kitchen_sinker" (func "$kitchen()sinker")) + (export "mem" (memory $0)) + (start $starter) + (func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) + (local $4 i32) + (block $the-body i32 + (block $the-nothing + (drop + (block $the-value i32 + (drop + (i32.clz + (i32.const -10) + ) + ) + (drop + (i64.ctz + (i64.const -22) + ) + ) + (drop + (i32.popcnt + (i32.const -10) + ) + ) + (drop + (f32.neg + (f32.const -33.61199951171875) + ) + ) + (drop + (f64.abs + (f64.const -9005.841) + ) + ) + (drop + (f32.ceil + (f32.const -33.61199951171875) + ) + ) + (drop + (f64.floor + (f64.const -9005.841) + ) + ) + (drop + (f32.trunc + (f32.const -33.61199951171875) + ) + ) + (drop + (f32.nearest + (f32.const -33.61199951171875) + ) + ) + (drop + (f64.sqrt + (f64.const -9005.841) + ) + ) + (drop + (i32.eqz + (i32.const -10) + ) + ) + (drop + (i64.extend_s/i32 + (i32.const -10) + ) + ) + (drop + (i64.extend_u/i32 + (i32.const -10) + ) + ) + (drop + (i32.wrap/i64 + (i64.const -22) + ) + ) + (drop + (i32.trunc_s/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_s/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_u/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_u/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_s/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_s/f64 + (f64.const -9005.841) + ) + ) + (drop + (i32.trunc_u/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_u/f64 + (f64.const -9005.841) + ) + ) + (drop + (i32.reinterpret/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.reinterpret/f64 + (f64.const -9005.841) + ) + ) + (drop + (f32.convert_s/i32 + (i32.const -10) + ) + ) + (drop + (f64.convert_s/i32 + (i32.const -10) + ) + ) + (drop + (f32.convert_u/i32 + (i32.const -10) + ) + ) + (drop + (f64.convert_u/i32 + (i32.const -10) + ) + ) + (drop + (f32.convert_s/i64 + (i64.const -22) + ) + ) + (drop + (f64.convert_s/i64 + (i64.const -22) + ) + ) + (drop + (f32.convert_u/i64 + (i64.const -22) + ) + ) + (drop + (f64.convert_u/i64 + (i64.const -22) + ) + ) + (drop + (f64.promote/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (f32.demote/f64 + (f64.const -9005.841) + ) + ) + (drop + (f32.reinterpret/i32 + (i32.const -10) + ) + ) + (drop + (f64.reinterpret/i64 + (i64.const -22) + ) + ) + (drop + (i32.add + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (f64.sub + (f64.const -9005.841) + (f64.const -9007.333) + ) + ) + (drop + (i32.div_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.div_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i64.rem_s + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.rem_u + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i32.and + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.or + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.xor + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.shl + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i64.shr_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.shr_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i32.rotl + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.rotr + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (f32.div + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (f64.copysign + (f64.const -9005.841) + (f64.const -9007.333) + ) + ) + (drop + (f32.min + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (f64.max + (f64.const -9005.841) + (f64.const -9007.333) + ) + ) + (drop + (i32.eq + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (f32.ne + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (i32.lt_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.lt_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i64.le_s + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.le_u + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.gt_s + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.gt_u + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i32.ge_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.ge_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (f32.lt + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (f64.le + (f64.const -9005.841) + (f64.const -9007.333) + ) + ) + (drop + (f64.gt + (f64.const -9005.841) + (f64.const -9007.333) + ) + ) + (drop + (f32.ge + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (block + ) + (if + (i32.const 1) + (drop + (i32.const 2) + ) + (drop + (i32.const 3) + ) ) - (i32.const 42) + (if + (i32.const 4) + (drop + (i32.const 5) + ) + ) + (drop + (loop $in i32 + (i32.const 0) + ) + ) + (drop + (loop i32 + (i32.const 0) + ) + ) + (drop + (br_if $the-value + (i32.const 1) + (i32.const 0) + ) + ) + (br_if $the-nothing + (i32.const 2) + ) + (br $the-value + (i32.const 3) + ) + (br $the-nothing) + (br_table $the-value $the-value + (i32.const 1) + (i32.const 0) + ) + (br_table $the-nothing $the-nothing + (i32.const 2) + ) + (drop + (i32.eqz + (call "$kitchen()sinker" + (i32.const 13) + (i64.const 37) + (f32.const 1.2999999523162842) + (f64.const 3.7) + ) + ) + ) + (drop + (i32.eqz + (i32.trunc_s/f32 + (call $an-imported + (i32.const 13) + (f64.const 3.7) + ) + ) + ) + ) + (drop + (i32.eqz + (call_indirect $iiIfF + (i32.const 13) + (i64.const 37) + (f32.const 1.2999999523162842) + (f64.const 3.7) + (i32.const 2449) + ) + ) + ) + (drop + (get_local $0) + ) + (set_local $0 + (i32.const 101) + ) + (drop + (tee_local $0 + (i32.const 102) + ) + ) + (drop + (i32.load + (i32.const 1) + ) + ) + (drop + (i64.load16_s offset=2 align=1 + (i32.const 8) + ) + ) + (drop + (f32.load + (i32.const 2) + ) + ) + (drop + (f64.load offset=2 + (i32.const 9) + ) + ) + (i32.store + (i32.const 10) + (i32.const 11) + ) + (i64.store offset=2 align=4 + (i32.const 110) + (i64.const 111) + ) + (drop + (select + (i32.const 3) + (i32.const 5) + (i32.const 1) + ) + ) + (return + (i32.const 1337) + ) + (nop) + (unreachable) + ) ) + ) + (i32.const 42) ) - (func $starter (type $v) - (nop) - ) + ) + (func $starter (type $v) + (nop) + ) ) raw: (module - (type $v (func)) - (type $vi (func (param i32))) - (type $i (func (result i32))) - (import "module" "check" (func $check (param i32))) - (memory $0 0) - (func $just-one-block (type $v) - (local $0 i32) - (call $check - (i32.const 1337) + (type $v (func)) + (type $vi (func (param i32))) + (type $i (func (result i32))) + (import "module" "check" (func $check (param i32))) + (memory $0 0) + (func $just-one-block (type $v) + (local $0 i32) + (call $check + (i32.const 1337) + ) + ) + (func $two-blocks (type $v) + (local $0 i32) + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (br $block$2$break) + ) + ) + (block + (call $check + (i32.const 1) + ) + ) + ) + (func $two-blocks-plus-code (type $v) + (local $0 i32) + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (drop + (i32.const 77) ) + (br $block$2$break) + ) ) - (func $two-blocks (type $v) - (local $0 i32) - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (br $block$2$break) - ) + (block + (call $check + (i32.const 1) + ) + ) + ) + (func $loop (type $v) + (local $0 i32) + (loop $shape$0$continue + (block $block$2$break + (call $check + (i32.const 0) ) (block - (call $check - (i32.const 1) - ) + (br $block$2$break) ) - ) - (func $two-blocks-plus-code (type $v) - (local $0 i32) - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (drop - (i32.const 77) - ) - (br $block$2$break) - ) + ) + (block + (call $check + (i32.const 1) ) (block - (call $check - (i32.const 1) - ) + (br $shape$0$continue) ) + ) ) - (func $loop (type $v) - (local $0 i32) - (loop $shape$0$continue - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (br $block$2$break) - ) - ) - (block - (call $check - (i32.const 1) - ) - (block - (br $shape$0$continue) - ) - ) + ) + (func $loop-plus-code (type $v) + (local $0 i32) + (loop $shape$0$continue + (block $block$2$break + (call $check + (i32.const 0) ) - ) - (func $loop-plus-code (type $v) - (local $0 i32) - (loop $shape$0$continue - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (drop - (i32.const 33) - ) - (br $block$2$break) - ) - ) - (block - (call $check - (i32.const 1) - ) - (block - (drop - (i32.const -66) - ) - (br $shape$0$continue) - ) - ) + (block + (drop + (i32.const 33) + ) + (br $block$2$break) ) - ) - (func $split (type $v) - (local $0 i32) + ) + (block (call $check - (i32.const 0) + (i32.const 1) ) - (if - (i32.const 55) - (block - (call $check - (i32.const 1) - ) - ) - (block - (call $check - (i32.const 2) - ) - ) + (block + (drop + (i32.const -66) + ) + (br $shape$0$continue) ) + ) + ) + ) + (func $split (type $v) + (local $0 i32) + (call $check + (i32.const 0) ) - (func $split-plus-code (type $v) - (local $0 i32) + (if + (i32.const 55) + (block (call $check - (i32.const 0) + (i32.const 1) ) - (if - (i32.const 55) - (block - (drop - (i32.const 10) - ) - (block - (call $check - (i32.const 1) - ) - ) - ) - (block - (drop - (i32.const 20) - ) - (block - (call $check - (i32.const 2) - ) - ) - ) + ) + (block + (call $check + (i32.const 2) ) + ) ) - (func $if (type $v) - (local $0 i32) - (block $block$3$break - (call $check - (i32.const 0) - ) - (if - (i32.const 55) - (block - (call $check - (i32.const 1) - ) - (block - (br $block$3$break) - ) - ) - (br $block$3$break) - ) + ) + (func $split-plus-code (type $v) + (local $0 i32) + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (drop + (i32.const 10) ) (block - (call $check - (i32.const 2) - ) + (call $check + (i32.const 1) + ) ) + ) + (block + (drop + (i32.const 20) + ) + (block + (call $check + (i32.const 2) + ) + ) + ) + ) + ) + (func $if (type $v) + (local $0 i32) + (block $block$3$break + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (call $check + (i32.const 1) + ) + (block + (br $block$3$break) + ) + ) + (br $block$3$break) + ) + ) + (block + (call $check + (i32.const 2) + ) ) - (func $if-plus-code (type $v) - (local $0 i32) - (block $block$3$break + ) + (func $if-plus-code (type $v) + (local $0 i32) + (block $block$3$break + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (drop + (i32.const -1) + ) + (block (call $check - (i32.const 0) + (i32.const 1) ) - (if - (i32.const 55) - (block - (drop - (i32.const -1) - ) - (block - (call $check - (i32.const 1) - ) - (block - (drop - (i32.const -3) - ) - (br $block$3$break) - ) - ) - ) - (block - (drop - (i32.const -2) - ) - (br $block$3$break) - ) + (block + (drop + (i32.const -3) + ) + (br $block$3$break) ) + ) ) (block - (call $check - (i32.const 2) - ) + (drop + (i32.const -2) + ) + (br $block$3$break) ) + ) ) - (func $if-else (type $v) - (local $0 i32) + (block + (call $check + (i32.const 2) + ) + ) + ) + (func $if-else (type $v) + (local $0 i32) + (block $block$4$break + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (call $check + (i32.const 1) + ) + (block + (br $block$4$break) + ) + ) + (block + (call $check + (i32.const 2) + ) + (block + (br $block$4$break) + ) + ) + ) + ) + (block + (call $check + (i32.const 3) + ) + ) + ) + (func $loop-tail (type $v) + (local $0 i32) + (block $block$3$break + (loop $shape$0$continue + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (br $block$2$break) + ) + ) + (block + (call $check + (i32.const 1) + ) + (if + (i32.const 10) + (br $shape$0$continue) + (br $block$3$break) + ) + ) + ) + ) + (block + (call $check + (i32.const 2) + ) + ) + ) + (func $nontrivial-loop-plus-phi-to-head (type $v) + (local $0 i32) + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (drop + (i32.const 10) + ) + (br $block$2$break) + ) + ) + (block + (block $block$7$break (block $block$4$break - (call $check - (i32.const 0) - ) - (if - (i32.const 55) + (loop $shape$1$continue + (block $block$3$break + (call $check + (i32.const 1) + ) + (if + (i32.const -2) + (br $block$3$break) (block - (call $check - (i32.const 1) - ) - (block - (br $block$4$break) - ) + (drop + (i32.const 20) + ) + (br $block$7$break) ) + ) + ) + (block + (call $check + (i32.const 2) + ) + (if + (i32.const -6) + (br $block$4$break) (block - (call $check - (i32.const 2) - ) - (block - (br $block$4$break) - ) + (drop + (i32.const 30) + ) + (br $shape$1$continue) ) + ) ) + ) ) (block + (block $block$6$break (call $check - (i32.const 3) + (i32.const 3) ) - ) - ) - (func $loop-tail (type $v) - (local $0 i32) - (block $block$3$break - (loop $shape$0$continue - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (br $block$2$break) - ) + (if + (i32.const -10) + (block + (call $check + (i32.const 4) ) (block - (call $check - (i32.const 1) - ) - (if - (i32.const 10) - (br $shape$0$continue) - (br $block$3$break) - ) + (br $block$6$break) ) + ) + (br $block$6$break) ) - ) - (block + ) + (block (call $check - (i32.const 2) + (i32.const 5) ) + (block + (drop + (i32.const 40) + ) + (br $block$7$break) + ) + ) + ) + ) + (block + (call $check + (i32.const 6) ) + ) ) - (func $nontrivial-loop-plus-phi-to-head (type $v) - (local $0 i32) - (block $block$2$break - (call $check - (i32.const 0) - ) + ) + (func $switch (type $v) + (local $0 i32) + (call $check + (i32.const 0) + ) + (block $switch$1$leave + (block $switch$1$default + (block $switch$1$case$3 + (block $switch$1$case$2 + (br_table $switch$1$default $switch$1$default $switch$1$case$2 $switch$1$default $switch$1$case$3 $switch$1$case$2 $switch$1$default + (i32.const -99) + ) + ) + (block (block - (drop - (i32.const 10) - ) - (br $block$2$break) + (call $check + (i32.const 1) + ) ) + ) + (br $switch$1$leave) ) (block - (block $block$7$break - (block $block$4$break - (loop $shape$1$continue - (block $block$3$break - (call $check - (i32.const 1) - ) - (if - (i32.const -2) - (br $block$3$break) - (block - (drop - (i32.const 20) - ) - (br $block$7$break) - ) - ) - ) - (block - (call $check - (i32.const 2) - ) - (if - (i32.const -6) - (br $block$4$break) - (block - (drop - (i32.const 30) - ) - (br $shape$1$continue) - ) - ) - ) - ) - ) - (block - (block $block$6$break - (call $check - (i32.const 3) - ) - (if - (i32.const -10) - (block - (call $check - (i32.const 4) - ) - (block - (br $block$6$break) - ) - ) - (br $block$6$break) - ) - ) - (block - (call $check - (i32.const 5) - ) - (block - (drop - (i32.const 40) - ) - (br $block$7$break) - ) - ) - ) - ) - (block - (call $check - (i32.const 6) - ) + (drop + (i32.const 55) + ) + (block + (call $check + (i32.const 2) ) + ) ) + (br $switch$1$leave) + ) + (block + (block + (call $check + (i32.const 3) + ) + ) + ) + (br $switch$1$leave) ) - (func $switch (type $v) - (local $0 i32) - (call $check + ) + (func $duffs-device (type $v) + (local $0 i32) + (local $1 i32) + (local $2 i64) + (local $3 i32) + (local $4 f32) + (local $5 f64) + (local $6 i32) + (block + (block $block$3$break + (block $block$2$break + (call $check (i32.const 0) - ) - (block $switch$1$leave - (block $switch$1$default - (block $switch$1$case$3 - (block $switch$1$case$2 - (br_table $switch$1$default $switch$1$default $switch$1$case$2 $switch$1$default $switch$1$case$3 $switch$1$case$2 $switch$1$default - (i32.const -99) - ) - ) - (block - (block - (call $check - (i32.const 1) - ) - ) - ) - (br $switch$1$leave) - ) - (block - (drop - (i32.const 55) - ) - (block - (call $check - (i32.const 2) - ) - ) - ) - (br $switch$1$leave) + ) + (if + (i32.const 10) + (block + (set_local $3 + (i32.const 2) + ) + (br $block$2$break) ) (block - (block - (call $check - (i32.const 3) - ) - ) + (set_local $3 + (i32.const 3) + ) + (br $block$3$break) ) - (br $switch$1$leave) + ) ) + ) ) - (func $duffs-device (type $v) - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i32) - (local $4 f32) - (local $5 f64) - (local $6 i32) + (loop $shape$1$continue + (if + (i32.eq + (get_local $3) + (i32.const 2) + ) (block - (block $block$3$break - (block $block$2$break - (call $check - (i32.const 0) - ) - (if - (i32.const 10) - (block - (set_local $3 - (i32.const 2) - ) - (br $block$2$break) - ) - (block - (set_local $3 - (i32.const 3) - ) - (br $block$3$break) - ) - ) - ) - ) + (set_local $3 + (i32.const 0) + ) + (call $check + (i32.const 1) + ) + (block + (set_local $3 + (i32.const 3) + ) + (br $shape$1$continue) + ) ) - (loop $shape$1$continue - (if - (i32.eq - (get_local $3) - (i32.const 2) - ) - (block - (set_local $3 - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (block - (set_local $3 - (i32.const 3) - ) - (br $shape$1$continue) - ) - ) - (if - (i32.eq - (get_local $3) - (i32.const 3) - ) - (block - (set_local $3 - (i32.const 0) - ) - (call $check - (i32.const 2) - ) - (block - (set_local $3 - (i32.const 2) - ) - (br $shape$1$continue) - ) - ) - ) + (if + (i32.eq + (get_local $3) + (i32.const 3) + ) + (block + (set_local $3 + (i32.const 0) ) - ) - ) - (func $return (type $i) (result i32) - (local $0 i32) - (block $the-list (call $check - (i32.const 42) + (i32.const 2) ) - (return - (i32.const 1337) + (block + (set_local $3 + (i32.const 2) + ) + (br $shape$1$continue) ) + ) ) + ) ) + ) + (func $return (type $i) (result i32) + (local $0 i32) + (block $the-list + (call $check + (i32.const 42) + ) + (return + (i32.const 1337) + ) + ) + ) ) optimized: (module - (type $v (func)) - (type $vi (func (param i32))) - (type $i (func (result i32))) - (memory $0 0) + (type $v (func)) + (type $vi (func (param i32))) + (type $i (func (result i32))) + (memory $0 0) ) module loaded from binary form: (module - (type $0 (func (param i32 i32) (result i32))) - (memory $0 0) - (func $adder (type $0) (param $var$0 i32) (param $var$1 i32) (result i32) - (i32.add - (get_local $var$0) - (get_local $var$1) - ) + (type $0 (func (param i32 i32) (result i32))) + (memory $0 0) + (func $adder (type $0) (param $var$0 i32) (param $var$1 i32) (result i32) + (i32.add + (get_local $var$0) + (get_local $var$1) ) + ) ) (module - (type $vi (func (param i32))) - (type $v (func)) - (import "spectest" "print" (func $print-i32 (param i32))) - (memory $0 0) - (start $starter) - (func $starter (type $v) - (call $print-i32 - (i32.const 1234) - ) + (type $vi (func (param i32))) + (type $v (func)) + (import "spectest" "print" (func $print-i32 (param i32))) + (memory $0 0) + (start $starter) + (func $starter (type $v) + (call $print-i32 + (i32.const 1234) ) + ) ) (i32.const 1234) (module - (type $v (func)) - (memory $0 0) - (func $func (type $v) - (local $0 i32) - (set_local $0 - (i64.const 1234) - ) + (type $v (func)) + (memory $0 0) + (func $func (type $v) + (local $0 i32) + (set_local $0 + (i64.const 1234) ) + ) ) validation: 0 // beginning a Binaryen API trace @@ -1344,7 +1344,7 @@ int main() { expressions[242] = BinaryenUnreachable(the_module); BinaryenExpressionPrint(expressions[36]); (f32.neg - (f32.const -33.61199951171875) + (f32.const -33.61199951171875) ) { BinaryenExpressionRef children[] = { expressions[30], expressions[32], expressions[34], expressions[36], expressions[38], expressions[40], expressions[42], expressions[44], expressions[46], expressions[48], expressions[50], expressions[52], expressions[54], expressions[56], expressions[58], expressions[60], expressions[62], expressions[64], expressions[66], expressions[68], expressions[70], expressions[72], expressions[74], expressions[76], expressions[78], expressions[80], expressions[82], expressions[84], expressions[86], expressions[88], expressions[90], expressions[92], expressions[94], expressions[96], expressions[98], expressions[100], expressions[103], expressions[106], expressions[109], expressions[112], expressions[115], expressions[118], expressions[121], expressions[124], expressions[127], expressions[130], expressions[133], expressions[136], expressions[139], expressions[142], expressions[145], expressions[148], expressions[151], expressions[154], expressions[157], expressions[160], expressions[163], expressions[166], expressions[169], expressions[172], expressions[175], expressions[178], expressions[181], expressions[184], expressions[187], expressions[190], expressions[193], expressions[196], expressions[197], expressions[198], expressions[199], expressions[201], expressions[203], expressions[204], expressions[206], expressions[208], expressions[209], expressions[210], expressions[212], expressions[214], expressions[217], expressions[220], expressions[222], expressions[224], expressions[227], expressions[229], expressions[231], expressions[233], expressions[235], expressions[236], expressions[237], expressions[238], expressions[240], expressions[241], expressions[242] }; @@ -1400,534 +1400,534 @@ int main() { BinaryenModuleValidate(the_module); BinaryenModulePrint(the_module); (module - (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) - (type $fiF (func (param i32 f64) (result f32))) - (type $v (func)) - (type $3 (func)) - (import "module" "base" (func $an-imported (param i32 f64) (result f32))) - (table 1 1 anyfunc) - (elem (i32.const 0) "$kitchen()sinker") - (memory $0 1 256) - (data (i32.const 10) "hello, world") - (export "kitchen_sinker" (func "$kitchen()sinker")) - (export "mem" (memory $0)) - (start $starter) - (func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) - (local $4 i32) - (block $the-body i32 - (block $the-nothing - (drop - (block $the-value i32 - (drop - (i32.clz - (i32.const -10) - ) - ) - (drop - (i64.ctz - (i64.const -22) - ) - ) - (drop - (i32.popcnt - (i32.const -10) - ) - ) - (drop - (f32.neg - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.abs - (f64.const -9005.841) - ) - ) - (drop - (f32.ceil - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.floor - (f64.const -9005.841) - ) - ) - (drop - (f32.trunc - (f32.const -33.61199951171875) - ) - ) - (drop - (f32.nearest - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.sqrt - (f64.const -9005.841) - ) - ) - (drop - (i32.eqz - (i32.const -10) - ) - ) - (drop - (i64.extend_s/i32 - (i32.const -10) - ) - ) - (drop - (i64.extend_u/i32 - (i32.const -10) - ) - ) - (drop - (i32.wrap/i64 - (i64.const -22) - ) - ) - (drop - (i32.trunc_s/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_s/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_u/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_u/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_s/f64 - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_s/f64 - (f64.const -9005.841) - ) - ) - (drop - (i32.trunc_u/f64 - (f64.const -9005.841) - ) - ) - (drop - (i64.trunc_u/f64 - (f64.const -9005.841) - ) - ) - (drop - (i32.reinterpret/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.reinterpret/f64 - (f64.const -9005.841) - ) - ) - (drop - (f32.convert_s/i32 - (i32.const -10) - ) - ) - (drop - (f64.convert_s/i32 - (i32.const -10) - ) - ) - (drop - (f32.convert_u/i32 - (i32.const -10) - ) - ) - (drop - (f64.convert_u/i32 - (i32.const -10) - ) - ) - (drop - (f32.convert_s/i64 - (i64.const -22) - ) - ) - (drop - (f64.convert_s/i64 - (i64.const -22) - ) - ) - (drop - (f32.convert_u/i64 - (i64.const -22) - ) - ) - (drop - (f64.convert_u/i64 - (i64.const -22) - ) - ) - (drop - (f64.promote/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (f32.demote/f64 - (f64.const -9005.841) - ) - ) - (drop - (f32.reinterpret/i32 - (i32.const -10) - ) - ) - (drop - (f64.reinterpret/i64 - (i64.const -22) - ) - ) - (drop - (i32.add - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (f64.sub - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (i32.div_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.div_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i64.rem_s - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.rem_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.and - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.or - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.xor - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.shl - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i64.shr_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.shr_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.rotl - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.rotr - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (f32.div - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.copysign - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f32.min - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.max - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (i32.eq - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (f32.ne - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (i32.lt_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.lt_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i64.le_s - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.le_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.gt_s - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.gt_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.ge_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.ge_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (f32.lt - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.le - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f64.gt - (f64.const -9005.841) - (f64.const -9007.333) - ) - ) - (drop - (f32.ge - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (block - ) - (if - (i32.const 1) - (drop - (i32.const 2) - ) - (drop - (i32.const 3) - ) - ) - (if - (i32.const 4) - (drop - (i32.const 5) - ) - ) - (drop - (loop $in i32 - (i32.const 0) - ) - ) - (drop - (loop i32 - (i32.const 0) - ) - ) - (drop - (br_if $the-value - (i32.const 1) - (i32.const 0) - ) - ) - (br_if $the-nothing - (i32.const 2) - ) - (br $the-value - (i32.const 3) - ) - (br $the-nothing) - (br_table $the-value $the-value - (i32.const 1) - (i32.const 0) - ) - (br_table $the-nothing $the-nothing - (i32.const 2) - ) - (drop - (i32.eqz - (call "$kitchen()sinker" - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - ) - ) - ) - (drop - (i32.eqz - (i32.trunc_s/f32 - (call $an-imported - (i32.const 13) - (f64.const 3.7) - ) - ) - ) - ) - (drop - (i32.eqz - (call_indirect $iiIfF - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - (i32.const 2449) - ) - ) - ) - (drop - (get_local $0) - ) - (set_local $0 - (i32.const 101) - ) - (drop - (tee_local $0 - (i32.const 102) - ) - ) - (drop - (i32.load - (i32.const 1) - ) - ) - (drop - (i64.load16_s offset=2 align=1 - (i32.const 8) - ) - ) - (drop - (f32.load - (i32.const 2) - ) - ) - (drop - (f64.load offset=2 - (i32.const 9) - ) - ) - (i32.store - (i32.const 10) - (i32.const 11) - ) - (i64.store offset=2 align=4 - (i32.const 110) - (i64.const 111) - ) - (drop - (select - (i32.const 3) - (i32.const 5) - (i32.const 1) - ) - ) - (return - (i32.const 1337) - ) - (nop) - (unreachable) - ) - ) + (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) + (type $fiF (func (param i32 f64) (result f32))) + (type $v (func)) + (type $3 (func)) + (import "module" "base" (func $an-imported (param i32 f64) (result f32))) + (table 1 1 anyfunc) + (elem (i32.const 0) "$kitchen()sinker") + (memory $0 1 256) + (data (i32.const 10) "hello, world") + (export "kitchen_sinker" (func "$kitchen()sinker")) + (export "mem" (memory $0)) + (start $starter) + (func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) + (local $4 i32) + (block $the-body i32 + (block $the-nothing + (drop + (block $the-value i32 + (drop + (i32.clz + (i32.const -10) + ) + ) + (drop + (i64.ctz + (i64.const -22) + ) + ) + (drop + (i32.popcnt + (i32.const -10) + ) + ) + (drop + (f32.neg + (f32.const -33.61199951171875) + ) + ) + (drop + (f64.abs + (f64.const -9005.841) + ) + ) + (drop + (f32.ceil + (f32.const -33.61199951171875) + ) + ) + (drop + (f64.floor + (f64.const -9005.841) + ) + ) + (drop + (f32.trunc + (f32.const -33.61199951171875) + ) + ) + (drop + (f32.nearest + (f32.const -33.61199951171875) + ) + ) + (drop + (f64.sqrt + (f64.const -9005.841) + ) + ) + (drop + (i32.eqz + (i32.const -10) + ) + ) + (drop + (i64.extend_s/i32 + (i32.const -10) + ) + ) + (drop + (i64.extend_u/i32 + (i32.const -10) + ) + ) + (drop + (i32.wrap/i64 + (i64.const -22) + ) + ) + (drop + (i32.trunc_s/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_s/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_u/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_u/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_s/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_s/f64 + (f64.const -9005.841) + ) + ) + (drop + (i32.trunc_u/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_u/f64 + (f64.const -9005.841) + ) + ) + (drop + (i32.reinterpret/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.reinterpret/f64 + (f64.const -9005.841) + ) + ) + (drop + (f32.convert_s/i32 + (i32.const -10) + ) + ) + (drop + (f64.convert_s/i32 + (i32.const -10) + ) + ) + (drop + (f32.convert_u/i32 + (i32.const -10) + ) + ) + (drop + (f64.convert_u/i32 + (i32.const -10) + ) + ) + (drop + (f32.convert_s/i64 + (i64.const -22) + ) + ) + (drop + (f64.convert_s/i64 + (i64.const -22) + ) + ) + (drop + (f32.convert_u/i64 + (i64.const -22) + ) + ) + (drop + (f64.convert_u/i64 + (i64.const -22) + ) + ) + (drop + (f64.promote/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (f32.demote/f64 + (f64.const -9005.841) + ) + ) + (drop + (f32.reinterpret/i32 + (i32.const -10) + ) + ) + (drop + (f64.reinterpret/i64 + (i64.const -22) + ) + ) + (drop + (i32.add + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (f64.sub + (f64.const -9005.841) + (f64.const -9007.333) + ) + ) + (drop + (i32.div_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.div_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i64.rem_s + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.rem_u + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i32.and + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.or + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.xor + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.shl + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i64.shr_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.shr_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i32.rotl + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.rotr + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (f32.div + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (f64.copysign + (f64.const -9005.841) + (f64.const -9007.333) + ) + ) + (drop + (f32.min + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (f64.max + (f64.const -9005.841) + (f64.const -9007.333) + ) + ) + (drop + (i32.eq + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (f32.ne + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (i32.lt_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.lt_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i64.le_s + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.le_u + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.gt_s + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.gt_u + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i32.ge_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.ge_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (f32.lt + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (f64.le + (f64.const -9005.841) + (f64.const -9007.333) + ) + ) + (drop + (f64.gt + (f64.const -9005.841) + (f64.const -9007.333) + ) + ) + (drop + (f32.ge + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (block + ) + (if + (i32.const 1) + (drop + (i32.const 2) + ) + (drop + (i32.const 3) + ) + ) + (if + (i32.const 4) + (drop + (i32.const 5) + ) + ) + (drop + (loop $in i32 + (i32.const 0) + ) + ) + (drop + (loop i32 + (i32.const 0) + ) + ) + (drop + (br_if $the-value + (i32.const 1) + (i32.const 0) + ) + ) + (br_if $the-nothing + (i32.const 2) + ) + (br $the-value + (i32.const 3) + ) + (br $the-nothing) + (br_table $the-value $the-value + (i32.const 1) + (i32.const 0) + ) + (br_table $the-nothing $the-nothing + (i32.const 2) + ) + (drop + (i32.eqz + (call "$kitchen()sinker" + (i32.const 13) + (i64.const 37) + (f32.const 1.2999999523162842) + (f64.const 3.7) + ) + ) + ) + (drop + (i32.eqz + (i32.trunc_s/f32 + (call $an-imported + (i32.const 13) + (f64.const 3.7) + ) + ) + ) + ) + (drop + (i32.eqz + (call_indirect $iiIfF + (i32.const 13) + (i64.const 37) + (f32.const 1.2999999523162842) + (f64.const 3.7) + (i32.const 2449) + ) + ) + ) + (drop + (get_local $0) + ) + (set_local $0 + (i32.const 101) + ) + (drop + (tee_local $0 + (i32.const 102) + ) + ) + (drop + (i32.load + (i32.const 1) + ) + ) + (drop + (i64.load16_s offset=2 align=1 + (i32.const 8) + ) + ) + (drop + (f32.load + (i32.const 2) + ) + ) + (drop + (f64.load offset=2 + (i32.const 9) + ) + ) + (i32.store + (i32.const 10) + (i32.const 11) + ) + (i64.store offset=2 align=4 + (i32.const 110) + (i64.const 111) + ) + (drop + (select + (i32.const 3) + (i32.const 5) + (i32.const 1) + ) + ) + (return + (i32.const 1337) ) - (i32.const 42) + (nop) + (unreachable) + ) ) + ) + (i32.const 42) ) - (func $starter (type $v) - (nop) - ) + ) + (func $starter (type $v) + (nop) + ) ) BinaryenModuleDispose(the_module); functionTypes.clear(); @@ -2391,490 +2391,490 @@ int main() { raw: BinaryenModulePrint(the_module); (module - (type $v (func)) - (type $vi (func (param i32))) - (type $i (func (result i32))) - (import "module" "check" (func $check (param i32))) - (memory $0 0) - (func $just-one-block (type $v) - (local $0 i32) - (call $check - (i32.const 1337) + (type $v (func)) + (type $vi (func (param i32))) + (type $i (func (result i32))) + (import "module" "check" (func $check (param i32))) + (memory $0 0) + (func $just-one-block (type $v) + (local $0 i32) + (call $check + (i32.const 1337) + ) + ) + (func $two-blocks (type $v) + (local $0 i32) + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (br $block$2$break) + ) + ) + (block + (call $check + (i32.const 1) + ) + ) + ) + (func $two-blocks-plus-code (type $v) + (local $0 i32) + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (drop + (i32.const 77) ) + (br $block$2$break) + ) ) - (func $two-blocks (type $v) - (local $0 i32) - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (br $block$2$break) - ) + (block + (call $check + (i32.const 1) + ) + ) + ) + (func $loop (type $v) + (local $0 i32) + (loop $shape$0$continue + (block $block$2$break + (call $check + (i32.const 0) ) (block - (call $check - (i32.const 1) - ) + (br $block$2$break) ) - ) - (func $two-blocks-plus-code (type $v) - (local $0 i32) - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (drop - (i32.const 77) - ) - (br $block$2$break) - ) + ) + (block + (call $check + (i32.const 1) ) (block - (call $check - (i32.const 1) - ) + (br $shape$0$continue) ) + ) ) - (func $loop (type $v) - (local $0 i32) - (loop $shape$0$continue - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (br $block$2$break) - ) - ) - (block - (call $check - (i32.const 1) - ) - (block - (br $shape$0$continue) - ) - ) + ) + (func $loop-plus-code (type $v) + (local $0 i32) + (loop $shape$0$continue + (block $block$2$break + (call $check + (i32.const 0) ) - ) - (func $loop-plus-code (type $v) - (local $0 i32) - (loop $shape$0$continue - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (drop - (i32.const 33) - ) - (br $block$2$break) - ) - ) - (block - (call $check - (i32.const 1) - ) - (block - (drop - (i32.const -66) - ) - (br $shape$0$continue) - ) - ) + (block + (drop + (i32.const 33) + ) + (br $block$2$break) ) - ) - (func $split (type $v) - (local $0 i32) + ) + (block (call $check - (i32.const 0) + (i32.const 1) ) - (if - (i32.const 55) - (block - (call $check - (i32.const 1) - ) - ) - (block - (call $check - (i32.const 2) - ) - ) + (block + (drop + (i32.const -66) + ) + (br $shape$0$continue) ) + ) + ) + ) + (func $split (type $v) + (local $0 i32) + (call $check + (i32.const 0) ) - (func $split-plus-code (type $v) - (local $0 i32) + (if + (i32.const 55) + (block (call $check - (i32.const 0) + (i32.const 1) ) - (if - (i32.const 55) - (block - (drop - (i32.const 10) - ) - (block - (call $check - (i32.const 1) - ) - ) - ) - (block - (drop - (i32.const 20) - ) - (block - (call $check - (i32.const 2) - ) - ) - ) + ) + (block + (call $check + (i32.const 2) ) + ) ) - (func $if (type $v) - (local $0 i32) - (block $block$3$break - (call $check - (i32.const 0) - ) - (if - (i32.const 55) - (block - (call $check - (i32.const 1) - ) - (block - (br $block$3$break) - ) - ) - (br $block$3$break) - ) + ) + (func $split-plus-code (type $v) + (local $0 i32) + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (drop + (i32.const 10) ) (block - (call $check - (i32.const 2) - ) + (call $check + (i32.const 1) + ) ) + ) + (block + (drop + (i32.const 20) + ) + (block + (call $check + (i32.const 2) + ) + ) + ) ) - (func $if-plus-code (type $v) - (local $0 i32) - (block $block$3$break + ) + (func $if (type $v) + (local $0 i32) + (block $block$3$break + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (call $check + (i32.const 1) + ) + (block + (br $block$3$break) + ) + ) + (br $block$3$break) + ) + ) + (block + (call $check + (i32.const 2) + ) + ) + ) + (func $if-plus-code (type $v) + (local $0 i32) + (block $block$3$break + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (drop + (i32.const -1) + ) + (block (call $check - (i32.const 0) + (i32.const 1) ) - (if - (i32.const 55) - (block - (drop - (i32.const -1) - ) - (block - (call $check - (i32.const 1) - ) - (block - (drop - (i32.const -3) - ) - (br $block$3$break) - ) - ) - ) - (block - (drop - (i32.const -2) - ) - (br $block$3$break) - ) + (block + (drop + (i32.const -3) + ) + (br $block$3$break) ) + ) ) (block - (call $check - (i32.const 2) - ) + (drop + (i32.const -2) + ) + (br $block$3$break) ) + ) + ) + (block + (call $check + (i32.const 2) + ) ) - (func $if-else (type $v) - (local $0 i32) + ) + (func $if-else (type $v) + (local $0 i32) + (block $block$4$break + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (call $check + (i32.const 1) + ) + (block + (br $block$4$break) + ) + ) + (block + (call $check + (i32.const 2) + ) + (block + (br $block$4$break) + ) + ) + ) + ) + (block + (call $check + (i32.const 3) + ) + ) + ) + (func $loop-tail (type $v) + (local $0 i32) + (block $block$3$break + (loop $shape$0$continue + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (br $block$2$break) + ) + ) + (block + (call $check + (i32.const 1) + ) + (if + (i32.const 10) + (br $shape$0$continue) + (br $block$3$break) + ) + ) + ) + ) + (block + (call $check + (i32.const 2) + ) + ) + ) + (func $nontrivial-loop-plus-phi-to-head (type $v) + (local $0 i32) + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (drop + (i32.const 10) + ) + (br $block$2$break) + ) + ) + (block + (block $block$7$break (block $block$4$break - (call $check - (i32.const 0) - ) - (if - (i32.const 55) + (loop $shape$1$continue + (block $block$3$break + (call $check + (i32.const 1) + ) + (if + (i32.const -2) + (br $block$3$break) (block - (call $check - (i32.const 1) - ) - (block - (br $block$4$break) - ) + (drop + (i32.const 20) + ) + (br $block$7$break) ) + ) + ) + (block + (call $check + (i32.const 2) + ) + (if + (i32.const -6) + (br $block$4$break) (block - (call $check - (i32.const 2) - ) - (block - (br $block$4$break) - ) + (drop + (i32.const 30) + ) + (br $shape$1$continue) ) + ) ) + ) ) (block + (block $block$6$break (call $check - (i32.const 3) + (i32.const 3) ) - ) - ) - (func $loop-tail (type $v) - (local $0 i32) - (block $block$3$break - (loop $shape$0$continue - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (br $block$2$break) - ) + (if + (i32.const -10) + (block + (call $check + (i32.const 4) ) (block - (call $check - (i32.const 1) - ) - (if - (i32.const 10) - (br $shape$0$continue) - (br $block$3$break) - ) + (br $block$6$break) ) + ) + (br $block$6$break) ) - ) - (block + ) + (block (call $check - (i32.const 2) + (i32.const 5) + ) + (block + (drop + (i32.const 40) + ) + (br $block$7$break) ) + ) + ) + ) + (block + (call $check + (i32.const 6) ) + ) ) - (func $nontrivial-loop-plus-phi-to-head (type $v) - (local $0 i32) - (block $block$2$break - (call $check - (i32.const 0) - ) + ) + (func $switch (type $v) + (local $0 i32) + (call $check + (i32.const 0) + ) + (block $switch$1$leave + (block $switch$1$default + (block $switch$1$case$3 + (block $switch$1$case$2 + (br_table $switch$1$default $switch$1$default $switch$1$case$2 $switch$1$default $switch$1$case$3 $switch$1$case$2 $switch$1$default + (i32.const -99) + ) + ) + (block (block - (drop - (i32.const 10) - ) - (br $block$2$break) + (call $check + (i32.const 1) + ) ) + ) + (br $switch$1$leave) ) (block - (block $block$7$break - (block $block$4$break - (loop $shape$1$continue - (block $block$3$break - (call $check - (i32.const 1) - ) - (if - (i32.const -2) - (br $block$3$break) - (block - (drop - (i32.const 20) - ) - (br $block$7$break) - ) - ) - ) - (block - (call $check - (i32.const 2) - ) - (if - (i32.const -6) - (br $block$4$break) - (block - (drop - (i32.const 30) - ) - (br $shape$1$continue) - ) - ) - ) - ) - ) - (block - (block $block$6$break - (call $check - (i32.const 3) - ) - (if - (i32.const -10) - (block - (call $check - (i32.const 4) - ) - (block - (br $block$6$break) - ) - ) - (br $block$6$break) - ) - ) - (block - (call $check - (i32.const 5) - ) - (block - (drop - (i32.const 40) - ) - (br $block$7$break) - ) - ) - ) - ) - (block - (call $check - (i32.const 6) - ) + (drop + (i32.const 55) + ) + (block + (call $check + (i32.const 2) ) + ) + ) + (br $switch$1$leave) + ) + (block + (block + (call $check + (i32.const 3) + ) ) + ) + (br $switch$1$leave) ) - (func $switch (type $v) - (local $0 i32) - (call $check + ) + (func $duffs-device (type $v) + (local $0 i32) + (local $1 i32) + (local $2 i64) + (local $3 i32) + (local $4 f32) + (local $5 f64) + (local $6 i32) + (block + (block $block$3$break + (block $block$2$break + (call $check (i32.const 0) - ) - (block $switch$1$leave - (block $switch$1$default - (block $switch$1$case$3 - (block $switch$1$case$2 - (br_table $switch$1$default $switch$1$default $switch$1$case$2 $switch$1$default $switch$1$case$3 $switch$1$case$2 $switch$1$default - (i32.const -99) - ) - ) - (block - (block - (call $check - (i32.const 1) - ) - ) - ) - (br $switch$1$leave) - ) - (block - (drop - (i32.const 55) - ) - (block - (call $check - (i32.const 2) - ) - ) - ) - (br $switch$1$leave) + ) + (if + (i32.const 10) + (block + (set_local $3 + (i32.const 2) + ) + (br $block$2$break) ) (block - (block - (call $check - (i32.const 3) - ) - ) + (set_local $3 + (i32.const 3) + ) + (br $block$3$break) ) - (br $switch$1$leave) + ) ) + ) ) - (func $duffs-device (type $v) - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i32) - (local $4 f32) - (local $5 f64) - (local $6 i32) + (loop $shape$1$continue + (if + (i32.eq + (get_local $3) + (i32.const 2) + ) (block - (block $block$3$break - (block $block$2$break - (call $check - (i32.const 0) - ) - (if - (i32.const 10) - (block - (set_local $3 - (i32.const 2) - ) - (br $block$2$break) - ) - (block - (set_local $3 - (i32.const 3) - ) - (br $block$3$break) - ) - ) - ) - ) + (set_local $3 + (i32.const 0) + ) + (call $check + (i32.const 1) + ) + (block + (set_local $3 + (i32.const 3) + ) + (br $shape$1$continue) + ) ) - (loop $shape$1$continue - (if - (i32.eq - (get_local $3) - (i32.const 2) - ) - (block - (set_local $3 - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (block - (set_local $3 - (i32.const 3) - ) - (br $shape$1$continue) - ) - ) - (if - (i32.eq - (get_local $3) - (i32.const 3) - ) - (block - (set_local $3 - (i32.const 0) - ) - (call $check - (i32.const 2) - ) - (block - (set_local $3 - (i32.const 2) - ) - (br $shape$1$continue) - ) - ) - ) + (if + (i32.eq + (get_local $3) + (i32.const 3) + ) + (block + (set_local $3 + (i32.const 0) ) - ) - ) - (func $return (type $i) (result i32) - (local $0 i32) - (block $the-list (call $check - (i32.const 42) + (i32.const 2) ) - (return - (i32.const 1337) + (block + (set_local $3 + (i32.const 2) + ) + (br $shape$1$continue) ) + ) ) + ) + ) + ) + (func $return (type $i) (result i32) + (local $0 i32) + (block $the-list + (call $check + (i32.const 42) + ) + (return + (i32.const 1337) + ) ) + ) ) BinaryenModuleValidate(the_module); BinaryenModuleOptimize(the_module); @@ -2882,10 +2882,10 @@ raw: optimized: BinaryenModulePrint(the_module); (module - (type $v (func)) - (type $vi (func (param i32))) - (type $i (func (result i32))) - (memory $0 0) + (type $v (func)) + (type $vi (func (param i32))) + (type $i (func (result i32))) + (memory $0 0) ) BinaryenModuleDispose(the_module); functionTypes.clear(); diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt index cbccff232..4583004e3 100644 --- a/test/example/c-api-kitchen-sink.txt.txt +++ b/test/example/c-api-kitchen-sink.txt.txt @@ -1,1025 +1,1025 @@ (f32.neg - (f32.const -33.61199951171875) + (f32.const -33.61199951171875) ) (module - (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) - (type $fiF (func (param i32 f64) (result f32))) - (type $v (func)) - (type $3 (func)) - (import "module" "base" (func $an-imported (param i32 f64) (result f32))) - (table 1 1 anyfunc) - (elem (i32.const 0) "$kitchen()sinker") - (memory $0 1 256) - (data (i32.const 10) "hello, world") - (export "kitchen_sinker" (func "$kitchen()sinker")) - (export "mem" (memory $0)) - (start $starter) - (func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) - (local $4 i32) - (block $the-body i32 - (block $the-nothing - (drop - (block $the-value i32 - (drop - (i32.clz - (i32.const -10) - ) - ) - (drop - (i64.ctz - (i64.const -22) - ) - ) - (drop - (i32.popcnt - (i32.const -10) - ) - ) - (drop - (f32.neg - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.abs - (f64.const -9005.84) - ) - ) - (drop - (f32.ceil - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.floor - (f64.const -9005.84) - ) - ) - (drop - (f32.trunc - (f32.const -33.61199951171875) - ) - ) - (drop - (f32.nearest - (f32.const -33.61199951171875) - ) - ) - (drop - (f64.sqrt - (f64.const -9005.84) - ) - ) - (drop - (i32.eqz - (i32.const -10) - ) - ) - (drop - (i64.extend_s/i32 - (i32.const -10) - ) - ) - (drop - (i64.extend_u/i32 - (i32.const -10) - ) - ) - (drop - (i32.wrap/i64 - (i64.const -22) - ) - ) - (drop - (i32.trunc_s/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_s/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_u/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.trunc_u/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i32.trunc_s/f64 - (f64.const -9005.84) - ) - ) - (drop - (i64.trunc_s/f64 - (f64.const -9005.84) - ) - ) - (drop - (i32.trunc_u/f64 - (f64.const -9005.84) - ) - ) - (drop - (i64.trunc_u/f64 - (f64.const -9005.84) - ) - ) - (drop - (i32.reinterpret/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (i64.reinterpret/f64 - (f64.const -9005.84) - ) - ) - (drop - (f32.convert_s/i32 - (i32.const -10) - ) - ) - (drop - (f64.convert_s/i32 - (i32.const -10) - ) - ) - (drop - (f32.convert_u/i32 - (i32.const -10) - ) - ) - (drop - (f64.convert_u/i32 - (i32.const -10) - ) - ) - (drop - (f32.convert_s/i64 - (i64.const -22) - ) - ) - (drop - (f64.convert_s/i64 - (i64.const -22) - ) - ) - (drop - (f32.convert_u/i64 - (i64.const -22) - ) - ) - (drop - (f64.convert_u/i64 - (i64.const -22) - ) - ) - (drop - (f64.promote/f32 - (f32.const -33.61199951171875) - ) - ) - (drop - (f32.demote/f64 - (f64.const -9005.84) - ) - ) - (drop - (f32.reinterpret/i32 - (i32.const -10) - ) - ) - (drop - (f64.reinterpret/i64 - (i64.const -22) - ) - ) - (drop - (i32.add - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (f64.sub - (f64.const -9005.84) - (f64.const -9007.33) - ) - ) - (drop - (i32.div_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.div_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i64.rem_s - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.rem_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.and - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.or - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.xor - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.shl - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i64.shr_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.shr_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.rotl - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.rotr - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (f32.div - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.copysign - (f64.const -9005.84) - (f64.const -9007.33) - ) - ) - (drop - (f32.min - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.max - (f64.const -9005.84) - (f64.const -9007.33) - ) - ) - (drop - (i32.eq - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (f32.ne - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (i32.lt_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.lt_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i64.le_s - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.le_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.gt_s - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (i32.gt_u - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i32.ge_s - (i32.const -10) - (i32.const -11) - ) - ) - (drop - (i64.ge_u - (i64.const -22) - (i64.const -23) - ) - ) - (drop - (f32.lt - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (drop - (f64.le - (f64.const -9005.84) - (f64.const -9007.33) - ) - ) - (drop - (f64.gt - (f64.const -9005.84) - (f64.const -9007.33) - ) - ) - (drop - (f32.ge - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - ) - (block - ) - (if - (i32.const 1) - (drop - (i32.const 2) - ) - (drop - (i32.const 3) - ) - ) - (if - (i32.const 4) - (drop - (i32.const 5) - ) - ) - (drop - (loop $in i32 - (i32.const 0) - ) - ) - (drop - (loop i32 - (i32.const 0) - ) - ) - (drop - (br_if $the-value - (i32.const 1) - (i32.const 0) - ) - ) - (br_if $the-nothing - (i32.const 2) - ) - (br $the-value - (i32.const 3) - ) - (br $the-nothing) - (br_table $the-value $the-value - (i32.const 1) - (i32.const 0) - ) - (br_table $the-nothing $the-nothing - (i32.const 2) - ) - (drop - (i32.eqz - (call "$kitchen()sinker" - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - ) - ) - ) - (drop - (i32.eqz - (i32.trunc_s/f32 - (call $an-imported - (i32.const 13) - (f64.const 3.7) - ) - ) - ) - ) - (drop - (i32.eqz - (call_indirect $iiIfF - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) - (i32.const 2449) - ) - ) - ) - (drop - (get_local $0) - ) - (set_local $0 - (i32.const 101) - ) - (drop - (tee_local $0 - (i32.const 102) - ) - ) - (drop - (i32.load - (i32.const 1) - ) - ) - (drop - (i64.load16_s offset=2 align=1 - (i32.const 8) - ) - ) - (drop - (f32.load - (i32.const 2) - ) - ) - (drop - (f64.load offset=2 - (i32.const 9) - ) - ) - (i32.store - (i32.const 10) - (i32.const 11) - ) - (i64.store offset=2 align=4 - (i32.const 110) - (i64.const 111) - ) - (drop - (select - (i32.const 3) - (i32.const 5) - (i32.const 1) - ) - ) - (return - (i32.const 1337) - ) - (nop) - (unreachable) - ) - ) + (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) + (type $fiF (func (param i32 f64) (result f32))) + (type $v (func)) + (type $3 (func)) + (import "module" "base" (func $an-imported (param i32 f64) (result f32))) + (table 1 1 anyfunc) + (elem (i32.const 0) "$kitchen()sinker") + (memory $0 1 256) + (data (i32.const 10) "hello, world") + (export "kitchen_sinker" (func "$kitchen()sinker")) + (export "mem" (memory $0)) + (start $starter) + (func "$kitchen()sinker" (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) + (local $4 i32) + (block $the-body i32 + (block $the-nothing + (drop + (block $the-value i32 + (drop + (i32.clz + (i32.const -10) + ) ) - (i32.const 42) - ) - ) - (func $starter (type $v) - (nop) - ) -) -(module - (type $v (func)) - (type $vi (func (param i32))) - (type $i (func (result i32))) - (import "module" "check" (func $check (param i32))) - (memory $0 0) - (func $just-one-block (type $v) - (local $0 i32) - (call $check - (i32.const 1337) - ) - ) - (func $two-blocks (type $v) - (local $0 i32) - (block $block$2$break - (call $check - (i32.const 0) + (drop + (i64.ctz + (i64.const -22) + ) + ) + (drop + (i32.popcnt + (i32.const -10) + ) + ) + (drop + (f32.neg + (f32.const -33.61199951171875) + ) + ) + (drop + (f64.abs + (f64.const -9005.84) + ) + ) + (drop + (f32.ceil + (f32.const -33.61199951171875) + ) + ) + (drop + (f64.floor + (f64.const -9005.84) + ) + ) + (drop + (f32.trunc + (f32.const -33.61199951171875) + ) + ) + (drop + (f32.nearest + (f32.const -33.61199951171875) + ) + ) + (drop + (f64.sqrt + (f64.const -9005.84) + ) + ) + (drop + (i32.eqz + (i32.const -10) + ) + ) + (drop + (i64.extend_s/i32 + (i32.const -10) + ) + ) + (drop + (i64.extend_u/i32 + (i32.const -10) + ) + ) + (drop + (i32.wrap/i64 + (i64.const -22) + ) + ) + (drop + (i32.trunc_s/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_s/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_u/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_u/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_s/f64 + (f64.const -9005.84) + ) + ) + (drop + (i64.trunc_s/f64 + (f64.const -9005.84) + ) + ) + (drop + (i32.trunc_u/f64 + (f64.const -9005.84) + ) + ) + (drop + (i64.trunc_u/f64 + (f64.const -9005.84) + ) + ) + (drop + (i32.reinterpret/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.reinterpret/f64 + (f64.const -9005.84) + ) + ) + (drop + (f32.convert_s/i32 + (i32.const -10) + ) + ) + (drop + (f64.convert_s/i32 + (i32.const -10) + ) + ) + (drop + (f32.convert_u/i32 + (i32.const -10) + ) + ) + (drop + (f64.convert_u/i32 + (i32.const -10) + ) + ) + (drop + (f32.convert_s/i64 + (i64.const -22) + ) + ) + (drop + (f64.convert_s/i64 + (i64.const -22) + ) + ) + (drop + (f32.convert_u/i64 + (i64.const -22) + ) + ) + (drop + (f64.convert_u/i64 + (i64.const -22) + ) + ) + (drop + (f64.promote/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (f32.demote/f64 + (f64.const -9005.84) + ) + ) + (drop + (f32.reinterpret/i32 + (i32.const -10) + ) + ) + (drop + (f64.reinterpret/i64 + (i64.const -22) + ) + ) + (drop + (i32.add + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (f64.sub + (f64.const -9005.84) + (f64.const -9007.33) + ) + ) + (drop + (i32.div_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.div_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i64.rem_s + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.rem_u + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i32.and + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.or + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.xor + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.shl + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i64.shr_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.shr_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i32.rotl + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.rotr + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (f32.div + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (f64.copysign + (f64.const -9005.84) + (f64.const -9007.33) + ) + ) + (drop + (f32.min + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (f64.max + (f64.const -9005.84) + (f64.const -9007.33) + ) + ) + (drop + (i32.eq + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (f32.ne + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (i32.lt_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.lt_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i64.le_s + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.le_u + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.gt_s + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (i32.gt_u + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i32.ge_s + (i32.const -10) + (i32.const -11) + ) + ) + (drop + (i64.ge_u + (i64.const -22) + (i64.const -23) + ) + ) + (drop + (f32.lt + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + ) + (drop + (f64.le + (f64.const -9005.84) + (f64.const -9007.33) + ) + ) + (drop + (f64.gt + (f64.const -9005.84) + (f64.const -9007.33) + ) + ) + (drop + (f32.ge + (f32.const -33.61199951171875) + (f32.const -62.5) + ) ) (block - (br $block$2$break) ) - ) - (block - (call $check - (i32.const 1) + (if + (i32.const 1) + (drop + (i32.const 2) + ) + (drop + (i32.const 3) + ) ) - ) - ) - (func $two-blocks-plus-code (type $v) - (local $0 i32) - (block $block$2$break - (call $check + (if + (i32.const 4) + (drop + (i32.const 5) + ) + ) + (drop + (loop $in i32 (i32.const 0) + ) ) - (block - (drop - (i32.const 77) - ) - (br $block$2$break) + (drop + (loop i32 + (i32.const 0) + ) ) - ) - (block - (call $check + (drop + (br_if $the-value (i32.const 1) + (i32.const 0) + ) ) - ) - ) - (func $loop (type $v) - (local $0 i32) - (loop $shape$0$continue - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (br $block$2$break) - ) + (br_if $the-nothing + (i32.const 2) ) - (block - (call $check - (i32.const 1) - ) - (block - (br $shape$0$continue) - ) + (br $the-value + (i32.const 3) ) - ) - ) - (func $loop-plus-code (type $v) - (local $0 i32) - (loop $shape$0$continue - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (drop - (i32.const 33) - ) - (br $block$2$break) + (br $the-nothing) + (br_table $the-value $the-value + (i32.const 1) + (i32.const 0) + ) + (br_table $the-nothing $the-nothing + (i32.const 2) + ) + (drop + (i32.eqz + (call "$kitchen()sinker" + (i32.const 13) + (i64.const 37) + (f32.const 1.2999999523162842) + (f64.const 3.7) ) + ) ) - (block - (call $check - (i32.const 1) + (drop + (i32.eqz + (i32.trunc_s/f32 + (call $an-imported + (i32.const 13) + (f64.const 3.7) + ) ) - (block - (drop - (i32.const -66) - ) - (br $shape$0$continue) + ) + ) + (drop + (i32.eqz + (call_indirect $iiIfF + (i32.const 13) + (i64.const 37) + (f32.const 1.2999999523162842) + (f64.const 3.7) + (i32.const 2449) ) + ) + ) + (drop + (get_local $0) + ) + (set_local $0 + (i32.const 101) + ) + (drop + (tee_local $0 + (i32.const 102) + ) + ) + (drop + (i32.load + (i32.const 1) + ) + ) + (drop + (i64.load16_s offset=2 align=1 + (i32.const 8) + ) + ) + (drop + (f32.load + (i32.const 2) + ) + ) + (drop + (f64.load offset=2 + (i32.const 9) + ) + ) + (i32.store + (i32.const 10) + (i32.const 11) + ) + (i64.store offset=2 align=4 + (i32.const 110) + (i64.const 111) ) + (drop + (select + (i32.const 3) + (i32.const 5) + (i32.const 1) + ) + ) + (return + (i32.const 1337) + ) + (nop) + (unreachable) + ) + ) + ) + (i32.const 42) + ) + ) + (func $starter (type $v) + (nop) + ) +) +(module + (type $v (func)) + (type $vi (func (param i32))) + (type $i (func (result i32))) + (import "module" "check" (func $check (param i32))) + (memory $0 0) + (func $just-one-block (type $v) + (local $0 i32) + (call $check + (i32.const 1337) + ) + ) + (func $two-blocks (type $v) + (local $0 i32) + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (br $block$2$break) + ) + ) + (block + (call $check + (i32.const 1) + ) + ) + ) + (func $two-blocks-plus-code (type $v) + (local $0 i32) + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (drop + (i32.const 77) ) + (br $block$2$break) + ) ) - (func $split (type $v) - (local $0 i32) + (block + (call $check + (i32.const 1) + ) + ) + ) + (func $loop (type $v) + (local $0 i32) + (loop $shape$0$continue + (block $block$2$break (call $check - (i32.const 0) + (i32.const 0) ) - (if - (i32.const 55) - (block - (call $check - (i32.const 1) - ) - ) - (block - (call $check - (i32.const 2) - ) - ) + (block + (br $block$2$break) ) + ) + (block + (call $check + (i32.const 1) + ) + (block + (br $shape$0$continue) + ) + ) ) - (func $split-plus-code (type $v) - (local $0 i32) + ) + (func $loop-plus-code (type $v) + (local $0 i32) + (loop $shape$0$continue + (block $block$2$break (call $check - (i32.const 0) + (i32.const 0) ) - (if - (i32.const 55) - (block - (drop - (i32.const 10) - ) - (block - (call $check - (i32.const 1) - ) - ) - ) - (block - (drop - (i32.const 20) - ) - (block - (call $check - (i32.const 2) - ) - ) - ) + (block + (drop + (i32.const 33) + ) + (br $block$2$break) ) + ) + (block + (call $check + (i32.const 1) + ) + (block + (drop + (i32.const -66) + ) + (br $shape$0$continue) + ) + ) ) - (func $if (type $v) - (local $0 i32) - (block $block$3$break - (call $check - (i32.const 0) - ) - (if - (i32.const 55) - (block - (call $check - (i32.const 1) - ) - (block - (br $block$3$break) - ) - ) - (br $block$3$break) - ) + ) + (func $split (type $v) + (local $0 i32) + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (call $check + (i32.const 1) + ) + ) + (block + (call $check + (i32.const 2) + ) + ) + ) + ) + (func $split-plus-code (type $v) + (local $0 i32) + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (drop + (i32.const 10) ) (block - (call $check - (i32.const 2) - ) + (call $check + (i32.const 1) + ) ) + ) + (block + (drop + (i32.const 20) + ) + (block + (call $check + (i32.const 2) + ) + ) + ) ) - (func $if-plus-code (type $v) - (local $0 i32) - (block $block$3$break + ) + (func $if (type $v) + (local $0 i32) + (block $block$3$break + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (call $check + (i32.const 1) + ) + (block + (br $block$3$break) + ) + ) + (br $block$3$break) + ) + ) + (block + (call $check + (i32.const 2) + ) + ) + ) + (func $if-plus-code (type $v) + (local $0 i32) + (block $block$3$break + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (drop + (i32.const -1) + ) + (block (call $check - (i32.const 0) + (i32.const 1) ) - (if - (i32.const 55) - (block - (drop - (i32.const -1) - ) - (block - (call $check - (i32.const 1) - ) - (block - (drop - (i32.const -3) - ) - (br $block$3$break) - ) - ) - ) - (block - (drop - (i32.const -2) - ) - (br $block$3$break) - ) + (block + (drop + (i32.const -3) + ) + (br $block$3$break) ) + ) ) (block - (call $check - (i32.const 2) - ) + (drop + (i32.const -2) + ) + (br $block$3$break) ) + ) ) - (func $if-else (type $v) - (local $0 i32) + (block + (call $check + (i32.const 2) + ) + ) + ) + (func $if-else (type $v) + (local $0 i32) + (block $block$4$break + (call $check + (i32.const 0) + ) + (if + (i32.const 55) + (block + (call $check + (i32.const 1) + ) + (block + (br $block$4$break) + ) + ) + (block + (call $check + (i32.const 2) + ) + (block + (br $block$4$break) + ) + ) + ) + ) + (block + (call $check + (i32.const 3) + ) + ) + ) + (func $loop-tail (type $v) + (local $0 i32) + (block $block$3$break + (loop $shape$0$continue + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (br $block$2$break) + ) + ) + (block + (call $check + (i32.const 1) + ) + (if + (i32.const 10) + (br $shape$0$continue) + (br $block$3$break) + ) + ) + ) + ) + (block + (call $check + (i32.const 2) + ) + ) + ) + (func $nontrivial-loop-plus-phi-to-head (type $v) + (local $0 i32) + (block $block$2$break + (call $check + (i32.const 0) + ) + (block + (drop + (i32.const 10) + ) + (br $block$2$break) + ) + ) + (block + (block $block$7$break (block $block$4$break - (call $check - (i32.const 0) - ) - (if - (i32.const 55) + (loop $shape$1$continue + (block $block$3$break + (call $check + (i32.const 1) + ) + (if + (i32.const -2) + (br $block$3$break) (block - (call $check - (i32.const 1) - ) - (block - (br $block$4$break) - ) + (drop + (i32.const 20) + ) + (br $block$7$break) ) + ) + ) + (block + (call $check + (i32.const 2) + ) + (if + (i32.const -6) + (br $block$4$break) (block - (call $check - (i32.const 2) - ) - (block - (br $block$4$break) - ) + (drop + (i32.const 30) + ) + (br $shape$1$continue) ) + ) ) + ) ) (block + (block $block$6$break (call $check - (i32.const 3) + (i32.const 3) ) - ) - ) - (func $loop-tail (type $v) - (local $0 i32) - (block $block$3$break - (loop $shape$0$continue - (block $block$2$break - (call $check - (i32.const 0) - ) - (block - (br $block$2$break) - ) + (if + (i32.const -10) + (block + (call $check + (i32.const 4) ) (block - (call $check - (i32.const 1) - ) - (if - (i32.const 10) - (br $shape$0$continue) - (br $block$3$break) - ) + (br $block$6$break) ) + ) + (br $block$6$break) ) - ) - (block + ) + (block (call $check - (i32.const 2) + (i32.const 5) + ) + (block + (drop + (i32.const 40) + ) + (br $block$7$break) ) + ) ) + ) + (block + (call $check + (i32.const 6) + ) + ) ) - (func $nontrivial-loop-plus-phi-to-head (type $v) - (local $0 i32) - (block $block$2$break - (call $check - (i32.const 0) + ) + (func $switch (type $v) + (local $0 i32) + (call $check + (i32.const 0) + ) + (block $switch$1$leave + (block $switch$1$default + (block $switch$1$case$3 + (block $switch$1$case$2 + (br_table $switch$1$default $switch$1$default $switch$1$case$2 $switch$1$default $switch$1$case$3 $switch$1$case$2 $switch$1$default + (i32.const -99) ) + ) + (block (block - (drop - (i32.const 10) - ) - (br $block$2$break) + (call $check + (i32.const 1) + ) ) + ) + (br $switch$1$leave) ) (block - (block $block$7$break - (block $block$4$break - (loop $shape$1$continue - (block $block$3$break - (call $check - (i32.const 1) - ) - (if - (i32.const -2) - (br $block$3$break) - (block - (drop - (i32.const 20) - ) - (br $block$7$break) - ) - ) - ) - (block - (call $check - (i32.const 2) - ) - (if - (i32.const -6) - (br $block$4$break) - (block - (drop - (i32.const 30) - ) - (br $shape$1$continue) - ) - ) - ) - ) - ) - (block - (block $block$6$break - (call $check - (i32.const 3) - ) - (if - (i32.const -10) - (block - (call $check - (i32.const 4) - ) - (block - (br $block$6$break) - ) - ) - (br $block$6$break) - ) - ) - (block - (call $check - (i32.const 5) - ) - (block - (drop - (i32.const 40) - ) - (br $block$7$break) - ) - ) - ) - ) - (block - (call $check - (i32.const 6) - ) + (drop + (i32.const 55) + ) + (block + (call $check + (i32.const 2) ) + ) + ) + (br $switch$1$leave) + ) + (block + (block + (call $check + (i32.const 3) + ) ) + ) + (br $switch$1$leave) ) - (func $switch (type $v) - (local $0 i32) - (call $check + ) + (func $duffs-device (type $v) + (local $0 i32) + (local $1 i32) + (local $2 i64) + (local $3 i32) + (local $4 f32) + (local $5 f64) + (local $6 i32) + (block + (block $block$3$break + (block $block$2$break + (call $check (i32.const 0) - ) - (block $switch$1$leave - (block $switch$1$default - (block $switch$1$case$3 - (block $switch$1$case$2 - (br_table $switch$1$default $switch$1$default $switch$1$case$2 $switch$1$default $switch$1$case$3 $switch$1$case$2 $switch$1$default - (i32.const -99) - ) - ) - (block - (block - (call $check - (i32.const 1) - ) - ) - ) - (br $switch$1$leave) - ) - (block - (drop - (i32.const 55) - ) - (block - (call $check - (i32.const 2) - ) - ) - ) - (br $switch$1$leave) + ) + (if + (i32.const 10) + (block + (set_local $3 + (i32.const 2) + ) + (br $block$2$break) ) (block - (block - (call $check - (i32.const 3) - ) - ) + (set_local $3 + (i32.const 3) + ) + (br $block$3$break) ) - (br $switch$1$leave) + ) ) + ) ) - (func $duffs-device (type $v) - (local $0 i32) - (local $1 i32) - (local $2 i64) - (local $3 i32) - (local $4 f32) - (local $5 f64) - (local $6 i32) + (loop $shape$1$continue + (if + (i32.eq + (get_local $3) + (i32.const 2) + ) (block - (block $block$3$break - (block $block$2$break - (call $check - (i32.const 0) - ) - (if - (i32.const 10) - (block - (set_local $3 - (i32.const 2) - ) - (br $block$2$break) - ) - (block - (set_local $3 - (i32.const 3) - ) - (br $block$3$break) - ) - ) - ) + (set_local $3 + (i32.const 0) + ) + (call $check + (i32.const 1) + ) + (block + (set_local $3 + (i32.const 3) ) + (br $shape$1$continue) + ) ) - (loop $shape$1$continue - (if - (i32.eq - (get_local $3) - (i32.const 2) - ) - (block - (set_local $3 - (i32.const 0) - ) - (call $check - (i32.const 1) - ) - (block - (set_local $3 - (i32.const 3) - ) - (br $shape$1$continue) - ) - ) - (if - (i32.eq - (get_local $3) - (i32.const 3) - ) - (block - (set_local $3 - (i32.const 0) - ) - (call $check - (i32.const 2) - ) - (block - (set_local $3 - (i32.const 2) - ) - (br $shape$1$continue) - ) - ) - ) + (if + (i32.eq + (get_local $3) + (i32.const 3) + ) + (block + (set_local $3 + (i32.const 0) ) - ) - ) - (func $return (type $i) (result i32) - (local $0 i32) - (block $the-list (call $check - (i32.const 42) + (i32.const 2) ) - (return - (i32.const 1337) + (block + (set_local $3 + (i32.const 2) + ) + (br $shape$1$continue) ) + ) ) + ) + ) + ) + (func $return (type $i) (result i32) + (local $0 i32) + (block $the-list + (call $check + (i32.const 42) + ) + (return + (i32.const 1337) + ) ) + ) ) (module - (type $v (func)) - (type $vi (func (param i32))) - (type $i (func (result i32))) - (memory $0 0) + (type $v (func)) + (type $vi (func (param i32))) + (type $i (func (result i32))) + (memory $0 0) ) diff --git a/test/example/c-api-unused-mem.txt b/test/example/c-api-unused-mem.txt index 52742f476..246aead8c 100644 --- a/test/example/c-api-unused-mem.txt +++ b/test/example/c-api-unused-mem.txt @@ -1,113 +1,113 @@ (module - (type $rustfn-0-3 (func)) - (type $__wasm_start (func)) - (memory $0 1024 1024) - (export "memory" (memory $0)) - (export "main" (func $main)) - (export "rust_entry" (func $__wasm_start)) - (func $main (type $rustfn-0-3) - (local $0 i32) - (local $1 i32) - (local $2 i64) - (block $block$1$break - (set_local $0 - (i32.load - (i32.const 0) - ) - ) - (block - (br $block$1$break) - ) + (type $rustfn-0-3 (func)) + (type $__wasm_start (func)) + (memory $0 1024 1024) + (export "memory" (memory $0)) + (export "main" (func $main)) + (export "rust_entry" (func $__wasm_start)) + (func $main (type $rustfn-0-3) + (local $0 i32) + (local $1 i32) + (local $2 i64) + (block $block$1$break + (set_local $0 + (i32.load + (i32.const 0) + ) + ) + (block + (br $block$1$break) + ) + ) + (block + (block $block$2$break + (block $bb0 ) (block - (block $block$2$break - (block $bb0 - ) - (block - (br $block$2$break) - ) - ) - (block - (block $bb1 - (i32.store - (i32.const 0) - (get_local $0) - ) - (return) - ) - ) + (br $block$2$break) ) - ) - (func $__wasm_start (type $__wasm_start) - (i32.store + ) + (block + (block $bb1 + (i32.store (i32.const 0) - (i32.const 65535) + (get_local $0) + ) + (return) ) - (call $main) + ) + ) + ) + (func $__wasm_start (type $__wasm_start) + (i32.store + (i32.const 0) + (i32.const 65535) ) + (call $main) + ) ) 207 (module - (type $0 (func)) - (type $1 (func)) - (memory $0 1024 1024) - (export "memory" (memory $0)) - (export "main" (func $main)) - (export "rust_entry" (func $__wasm_start)) - (func $main (type $0) - (local $var$0 i32) - (local $var$1 i32) - (local $var$2 i64) - (block $label$0 - (block $label$1 - (set_local $var$0 - (i32.load - (i32.const 0) - ) - ) - (block $label$2 - (br $label$1) - (unreachable) - ) - (unreachable) - ) - (block $label$3 - (block $label$4 - (block $label$5 - ) - (block $label$6 - (br $label$4) - (unreachable) - ) - (unreachable) - ) - (block $label$7 - (block $label$8 - (i32.store - (i32.const 0) - (get_local $var$0) - ) - (return) - (unreachable) - ) - (unreachable) - (unreachable) - ) - (unreachable) - (unreachable) - ) - (unreachable) - (unreachable) + (type $0 (func)) + (type $1 (func)) + (memory $0 1024 1024) + (export "memory" (memory $0)) + (export "main" (func $main)) + (export "rust_entry" (func $__wasm_start)) + (func $main (type $0) + (local $var$0 i32) + (local $var$1 i32) + (local $var$2 i64) + (block $label$0 + (block $label$1 + (set_local $var$0 + (i32.load + (i32.const 0) + ) + ) + (block $label$2 + (br $label$1) + (unreachable) ) (unreachable) - ) - (func $__wasm_start (type $1) - (block $label$0 + ) + (block $label$3 + (block $label$4 + (block $label$5 + ) + (block $label$6 + (br $label$4) + (unreachable) + ) + (unreachable) + ) + (block $label$7 + (block $label$8 (i32.store - (i32.const 0) - (i32.const 65535) + (i32.const 0) + (get_local $var$0) ) - (call $main) + (return) + (unreachable) + ) + (unreachable) + (unreachable) ) + (unreachable) + (unreachable) + ) + (unreachable) + (unreachable) + ) + (unreachable) + ) + (func $__wasm_start (type $1) + (block $label$0 + (i32.store + (i32.const 0) + (i32.const 65535) + ) + (call $main) ) + ) ) diff --git a/test/example/relooper-fuzz.txt b/test/example/relooper-fuzz.txt index f0ddfdc19..416f54987 100644 --- a/test/example/relooper-fuzz.txt +++ b/test/example/relooper-fuzz.txt @@ -1,535 +1,535 @@ (module - (type $i (func (result i32))) - (type $v (func)) - (type $vi (func (param i32))) - (import "spectest" "print" (func $print (param i32))) - (memory $0 1 1) - (export "mem" (memory $0)) - (start $main) - (func $check (type $i) (result i32) - (if - (i32.eq - (i32.load - (i32.const 4) - ) - (i32.const 108) - ) - (unreachable) - ) - (i32.store - (i32.const 4) - (i32.add - (i32.load - (i32.const 4) - ) - (i32.const 4) - ) - ) - (call $print - (i32.sub - (i32.const 0) - (i32.load offset=4 - (i32.load - (i32.const 4) - ) - ) - ) - ) + (type $i (func (result i32))) + (type $v (func)) + (type $vi (func (param i32))) + (import "spectest" "print" (func $print (param i32))) + (memory $0 1 1) + (export "mem" (memory $0)) + (start $main) + (func $check (type $i) (result i32) + (if + (i32.eq + (i32.load + (i32.const 4) + ) + (i32.const 108) + ) + (unreachable) + ) + (i32.store + (i32.const 4) + (i32.add + (i32.load + (i32.const 4) + ) + (i32.const 4) + ) + ) + (call $print + (i32.sub + (i32.const 0) (i32.load offset=4 - (i32.load - (i32.const 4) - ) + (i32.load + (i32.const 4) + ) ) + ) ) - (func $main (type $v) - (local $0 i32) - (local $1 i32) - (i32.store - (i32.const 8) - (i32.const 89) - ) - (i32.store - (i32.const 12) - (i32.const 12) - ) - (i32.store - (i32.const 16) - (i32.const 78) - ) - (i32.store - (i32.const 20) - (i32.const 149) - ) - (i32.store - (i32.const 24) - (i32.const 118) - ) - (i32.store - (i32.const 28) - (i32.const 179) - ) - (i32.store - (i32.const 32) - (i32.const 127) - ) - (i32.store - (i32.const 36) - (i32.const 80) - ) - (i32.store - (i32.const 40) - (i32.const 21) - ) - (i32.store - (i32.const 44) - (i32.const 34) - ) - (i32.store - (i32.const 48) - (i32.const 119) - ) - (i32.store - (i32.const 52) - (i32.const 98) - ) - (i32.store - (i32.const 56) - (i32.const 38) - ) - (i32.store - (i32.const 60) - (i32.const 29) - ) - (i32.store - (i32.const 64) - (i32.const 36) - ) - (i32.store - (i32.const 68) - (i32.const 147) - ) - (i32.store - (i32.const 72) - (i32.const 13) - ) - (i32.store - (i32.const 76) - (i32.const 55) - ) - (i32.store - (i32.const 80) - (i32.const 166) - ) - (i32.store - (i32.const 84) - (i32.const 16) - ) - (i32.store - (i32.const 88) - (i32.const 143) - ) - (i32.store - (i32.const 92) - (i32.const 52) - ) - (i32.store - (i32.const 96) - (i32.const 130) - ) - (i32.store - (i32.const 100) - (i32.const 150) - ) - (i32.store - (i32.const 104) - (i32.const 176) - ) - (i32.store - (i32.const 108) - (i32.const 91) - ) - (i32.store - (i32.const 112) - (i32.const 34) - ) - (block + (i32.load offset=4 + (i32.load + (i32.const 4) + ) + ) + ) + (func $main (type $v) + (local $0 i32) + (local $1 i32) + (i32.store + (i32.const 8) + (i32.const 89) + ) + (i32.store + (i32.const 12) + (i32.const 12) + ) + (i32.store + (i32.const 16) + (i32.const 78) + ) + (i32.store + (i32.const 20) + (i32.const 149) + ) + (i32.store + (i32.const 24) + (i32.const 118) + ) + (i32.store + (i32.const 28) + (i32.const 179) + ) + (i32.store + (i32.const 32) + (i32.const 127) + ) + (i32.store + (i32.const 36) + (i32.const 80) + ) + (i32.store + (i32.const 40) + (i32.const 21) + ) + (i32.store + (i32.const 44) + (i32.const 34) + ) + (i32.store + (i32.const 48) + (i32.const 119) + ) + (i32.store + (i32.const 52) + (i32.const 98) + ) + (i32.store + (i32.const 56) + (i32.const 38) + ) + (i32.store + (i32.const 60) + (i32.const 29) + ) + (i32.store + (i32.const 64) + (i32.const 36) + ) + (i32.store + (i32.const 68) + (i32.const 147) + ) + (i32.store + (i32.const 72) + (i32.const 13) + ) + (i32.store + (i32.const 76) + (i32.const 55) + ) + (i32.store + (i32.const 80) + (i32.const 166) + ) + (i32.store + (i32.const 84) + (i32.const 16) + ) + (i32.store + (i32.const 88) + (i32.const 143) + ) + (i32.store + (i32.const 92) + (i32.const 52) + ) + (i32.store + (i32.const 96) + (i32.const 130) + ) + (i32.store + (i32.const 100) + (i32.const 150) + ) + (i32.store + (i32.const 104) + (i32.const 176) + ) + (i32.store + (i32.const 108) + (i32.const 91) + ) + (i32.store + (i32.const 112) + (i32.const 34) + ) + (block + (block + (block $block$6$break + (block $block$5$break (block - (block $block$6$break - (block $block$5$break - (block - (call $print - (i32.const 0) - ) - (set_local $0 - (call $check) - ) - ) - (if - (i32.eq - (i32.rem_u - (get_local $0) - (i32.const 2) - ) - (i32.const 0) - ) - (block - (set_local $1 - (i32.const 6) - ) - (br $block$6$break) - ) - (block - (block - (call $print - (i32.const 8) - ) - (set_local $0 - (call $check) - ) - ) - (block - (br $block$5$break) - ) - ) - ) - ) - ) + (call $print + (i32.const 0) + ) + (set_local $0 + (call $check) + ) ) - (loop $shape$3$continue - (block $block$5$break0 - (if - (i32.eq - (get_local $1) - (i32.const 6) - ) - (block - (set_local $1 - (i32.const 0) - ) - (block - (call $print - (i32.const 5) - ) - (set_local $0 - (call $check) - ) - ) - (if - (i32.eq - (i32.rem_u - (get_local $0) - (i32.const 2) - ) - (i32.const 0) - ) - (br $shape$3$continue) - (block - (set_local $1 - (i32.const 6) - ) - (br $shape$3$continue) - ) - ) - ) - ) - ) - (block - (block $block$3$break - (block - (call $print - (i32.const 4) - ) - (set_local $0 - (call $check) - ) - ) - (if - (i32.eq - (i32.rem_u - (get_local $0) - (i32.const 3) - ) - (i32.const 0) - ) - (br $shape$3$continue) - (if - (i32.eq - (i32.rem_u - (get_local $0) - (i32.const 3) - ) - (i32.const 1) - ) - (block - (set_local $1 - (i32.const 6) - ) - (br $shape$3$continue) - ) - (br $block$3$break) - ) - ) - ) - (block - (block - (call $print - (i32.const 2) - ) - (set_local $0 - (call $check) - ) - ) - (block - (set_local $1 - (i32.const 6) - ) - (br $shape$3$continue) - ) - ) + (if + (i32.eq + (i32.rem_u + (get_local $0) + (i32.const 2) ) - ) - ) - ) -) -(module - (type $i (func (result i32))) - (type $v (func)) - (type $vi (func (param i32))) - (import "spectest" "print" (func $print (param i32))) - (memory $0 1 1) - (export "mem" (memory $0)) - (start $main) - (func $check (type $i) (result i32) - (if - (i32.eq - (i32.load - (i32.const 4) + (i32.const 0) + ) + (block + (set_local $1 + (i32.const 6) ) - (i32.const 108) - ) - (unreachable) - ) - (i32.store - (i32.const 4) - (i32.add - (i32.load - (i32.const 4) + (br $block$6$break) + ) + (block + (block + (call $print + (i32.const 8) + ) + (set_local $0 + (call $check) + ) ) - (i32.const 4) - ) - ) - (call $print - (i32.sub - (i32.const 0) - (i32.load offset=4 - (i32.load - (i32.const 4) - ) + (block + (br $block$5$break) ) + ) ) + ) ) - (i32.load offset=4 - (i32.load - (i32.const 4) - ) - ) - ) - (func $main (type $v) - (local $0 i32) - (local $1 i32) - (i32.store - (i32.const 8) - (i32.const 89) - ) - (i32.store - (i32.const 12) - (i32.const 12) - ) - (i32.store - (i32.const 16) - (i32.const 78) - ) - (i32.store - (i32.const 20) - (i32.const 149) - ) - (i32.store - (i32.const 24) - (i32.const 118) - ) - (i32.store - (i32.const 28) - (i32.const 179) - ) - (i32.store - (i32.const 32) - (i32.const 127) - ) - (i32.store - (i32.const 36) - (i32.const 80) - ) - (i32.store - (i32.const 40) - (i32.const 21) - ) - (i32.store - (i32.const 44) - (i32.const 34) - ) - (i32.store - (i32.const 48) - (i32.const 119) - ) - (i32.store - (i32.const 52) - (i32.const 98) - ) - (i32.store - (i32.const 56) - (i32.const 38) - ) - (i32.store - (i32.const 60) - (i32.const 29) - ) - (i32.store - (i32.const 64) - (i32.const 36) - ) - (i32.store - (i32.const 68) - (i32.const 147) - ) - (i32.store - (i32.const 72) - (i32.const 13) - ) - (i32.store - (i32.const 76) - (i32.const 55) - ) - (i32.store - (i32.const 80) - (i32.const 166) - ) - (i32.store - (i32.const 84) - (i32.const 16) - ) - (i32.store - (i32.const 88) - (i32.const 143) - ) - (i32.store - (i32.const 92) - (i32.const 52) - ) - (i32.store - (i32.const 96) - (i32.const 130) - ) - (i32.store - (i32.const 100) - (i32.const 150) - ) - (i32.store - (i32.const 104) - (i32.const 176) - ) - (i32.store - (i32.const 108) - (i32.const 91) - ) - (i32.store - (i32.const 112) - (i32.const 34) - ) - (call $print - (i32.const 0) - ) - (if - (i32.rem_u - (call $check) - (i32.const 2) + ) + (loop $shape$3$continue + (block $block$5$break0 + (if + (i32.eq + (get_local $1) + (i32.const 6) ) (block + (set_local $1 + (i32.const 0) + ) + (block (call $print - (i32.const 8) + (i32.const 5) ) - (drop - (call $check) + (set_local $0 + (call $check) ) - ) - (set_local $0 - (i32.const 6) - ) - ) - (loop $shape$3$continue - (if + ) + (if (i32.eq + (i32.rem_u (get_local $0) - (i32.const 6) + (i32.const 2) + ) + (i32.const 0) ) + (br $shape$3$continue) (block - (set_local $0 - (i32.const 0) - ) - (call $print - (i32.const 5) - ) - (br_if $shape$3$continue - (i32.eqz - (i32.rem_u - (call $check) - (i32.const 2) - ) - ) - ) - (set_local $0 - (i32.const 6) - ) - (br $shape$3$continue) + (set_local $1 + (i32.const 6) + ) + (br $shape$3$continue) ) + ) ) - (call $print + ) + ) + (block + (block $block$3$break + (block + (call $print (i32.const 4) - ) - (br_if $shape$3$continue - (i32.eqz - (i32.rem_u - (tee_local $1 - (call $check) - ) - (i32.const 3) - ) - ) + ) + (set_local $0 + (call $check) + ) ) (if + (i32.eq + (i32.rem_u + (get_local $0) + (i32.const 3) + ) + (i32.const 0) + ) + (br $shape$3$continue) + (if (i32.eq - (i32.rem_u - (get_local $1) - (i32.const 3) - ) - (i32.const 1) + (i32.rem_u + (get_local $0) + (i32.const 3) + ) + (i32.const 1) ) (block - (set_local $0 - (i32.const 6) - ) - (br $shape$3$continue) + (set_local $1 + (i32.const 6) + ) + (br $shape$3$continue) ) + (br $block$3$break) + ) ) - (call $print + ) + (block + (block + (call $print (i32.const 2) - ) - (drop + ) + (set_local $0 (call $check) + ) ) - (set_local $0 + (block + (set_local $1 (i32.const 6) + ) + (br $shape$3$continue) ) - (br $shape$3$continue) + ) + ) + ) + ) + ) +) +(module + (type $i (func (result i32))) + (type $v (func)) + (type $vi (func (param i32))) + (import "spectest" "print" (func $print (param i32))) + (memory $0 1 1) + (export "mem" (memory $0)) + (start $main) + (func $check (type $i) (result i32) + (if + (i32.eq + (i32.load + (i32.const 4) + ) + (i32.const 108) + ) + (unreachable) + ) + (i32.store + (i32.const 4) + (i32.add + (i32.load + (i32.const 4) + ) + (i32.const 4) + ) + ) + (call $print + (i32.sub + (i32.const 0) + (i32.load offset=4 + (i32.load + (i32.const 4) + ) ) + ) + ) + (i32.load offset=4 + (i32.load + (i32.const 4) + ) + ) + ) + (func $main (type $v) + (local $0 i32) + (local $1 i32) + (i32.store + (i32.const 8) + (i32.const 89) + ) + (i32.store + (i32.const 12) + (i32.const 12) + ) + (i32.store + (i32.const 16) + (i32.const 78) + ) + (i32.store + (i32.const 20) + (i32.const 149) + ) + (i32.store + (i32.const 24) + (i32.const 118) + ) + (i32.store + (i32.const 28) + (i32.const 179) + ) + (i32.store + (i32.const 32) + (i32.const 127) + ) + (i32.store + (i32.const 36) + (i32.const 80) + ) + (i32.store + (i32.const 40) + (i32.const 21) + ) + (i32.store + (i32.const 44) + (i32.const 34) + ) + (i32.store + (i32.const 48) + (i32.const 119) + ) + (i32.store + (i32.const 52) + (i32.const 98) + ) + (i32.store + (i32.const 56) + (i32.const 38) + ) + (i32.store + (i32.const 60) + (i32.const 29) + ) + (i32.store + (i32.const 64) + (i32.const 36) + ) + (i32.store + (i32.const 68) + (i32.const 147) + ) + (i32.store + (i32.const 72) + (i32.const 13) + ) + (i32.store + (i32.const 76) + (i32.const 55) + ) + (i32.store + (i32.const 80) + (i32.const 166) + ) + (i32.store + (i32.const 84) + (i32.const 16) + ) + (i32.store + (i32.const 88) + (i32.const 143) + ) + (i32.store + (i32.const 92) + (i32.const 52) + ) + (i32.store + (i32.const 96) + (i32.const 130) + ) + (i32.store + (i32.const 100) + (i32.const 150) + ) + (i32.store + (i32.const 104) + (i32.const 176) + ) + (i32.store + (i32.const 108) + (i32.const 91) + ) + (i32.store + (i32.const 112) + (i32.const 34) + ) + (call $print + (i32.const 0) + ) + (if + (i32.rem_u + (call $check) + (i32.const 2) + ) + (block + (call $print + (i32.const 8) + ) + (drop + (call $check) + ) + ) + (set_local $0 + (i32.const 6) + ) + ) + (loop $shape$3$continue + (if + (i32.eq + (get_local $0) + (i32.const 6) + ) + (block + (set_local $0 + (i32.const 0) + ) + (call $print + (i32.const 5) + ) + (br_if $shape$3$continue + (i32.eqz + (i32.rem_u + (call $check) + (i32.const 2) + ) + ) + ) + (set_local $0 + (i32.const 6) + ) + (br $shape$3$continue) + ) + ) + (call $print + (i32.const 4) + ) + (br_if $shape$3$continue + (i32.eqz + (i32.rem_u + (tee_local $1 + (call $check) + ) + (i32.const 3) + ) + ) + ) + (if + (i32.eq + (i32.rem_u + (get_local $1) + (i32.const 3) + ) + (i32.const 1) + ) + (block + (set_local $0 + (i32.const 6) + ) + (br $shape$3$continue) + ) + ) + (call $print + (i32.const 2) + ) + (drop + (call $check) + ) + (set_local $0 + (i32.const 6) + ) + (br $shape$3$continue) ) + ) ) diff --git a/test/example/relooper-fuzz1.txt b/test/example/relooper-fuzz1.txt index 0a29c1a03..0214d9c81 100644 --- a/test/example/relooper-fuzz1.txt +++ b/test/example/relooper-fuzz1.txt @@ -1,496 +1,496 @@ (module - (type $i (func (result i32))) - (type $v (func)) - (type $vi (func (param i32))) - (import "spectest" "print" (func $print (param i32))) - (memory $0 1 1) - (export "mem" (memory $0)) - (start $main) - (func $check (type $i) (result i32) - (if - (i32.eq - (i32.load - (i32.const 4) - ) - (i32.const 120) - ) - (unreachable) - ) - (i32.store + (type $i (func (result i32))) + (type $v (func)) + (type $vi (func (param i32))) + (import "spectest" "print" (func $print (param i32))) + (memory $0 1 1) + (export "mem" (memory $0)) + (start $main) + (func $check (type $i) (result i32) + (if + (i32.eq + (i32.load + (i32.const 4) + ) + (i32.const 120) + ) + (unreachable) + ) + (i32.store + (i32.const 4) + (i32.add + (i32.load + (i32.const 4) + ) + (i32.const 4) + ) + ) + (call $print + (i32.sub + (i32.const 0) + (i32.load offset=4 + (i32.load (i32.const 4) - (i32.add - (i32.load - (i32.const 4) - ) - (i32.const 4) - ) + ) ) - (call $print - (i32.sub + ) + ) + (i32.load offset=4 + (i32.load + (i32.const 4) + ) + ) + ) + (func $main (type $v) + (local $0 i32) + (local $1 i32) + (i32.store + (i32.const 8) + (i32.const 67) + ) + (i32.store + (i32.const 12) + (i32.const 131) + ) + (i32.store + (i32.const 16) + (i32.const 49) + ) + (i32.store + (i32.const 20) + (i32.const 36) + ) + (i32.store + (i32.const 24) + (i32.const 112) + ) + (i32.store + (i32.const 28) + (i32.const 161) + ) + (i32.store + (i32.const 32) + (i32.const 62) + ) + (i32.store + (i32.const 36) + (i32.const 166) + ) + (i32.store + (i32.const 40) + (i32.const 16) + ) + (i32.store + (i32.const 44) + (i32.const 88) + ) + (i32.store + (i32.const 48) + (i32.const 176) + ) + (i32.store + (i32.const 52) + (i32.const 152) + ) + (i32.store + (i32.const 56) + (i32.const 161) + ) + (i32.store + (i32.const 60) + (i32.const 194) + ) + (i32.store + (i32.const 64) + (i32.const 117) + ) + (i32.store + (i32.const 68) + (i32.const 180) + ) + (i32.store + (i32.const 72) + (i32.const 60) + ) + (i32.store + (i32.const 76) + (i32.const 166) + ) + (i32.store + (i32.const 80) + (i32.const 55) + ) + (i32.store + (i32.const 84) + (i32.const 183) + ) + (i32.store + (i32.const 88) + (i32.const 150) + ) + (i32.store + (i32.const 92) + (i32.const 73) + ) + (i32.store + (i32.const 96) + (i32.const 196) + ) + (i32.store + (i32.const 100) + (i32.const 143) + ) + (i32.store + (i32.const 104) + (i32.const 76) + ) + (i32.store + (i32.const 108) + (i32.const 182) + ) + (i32.store + (i32.const 112) + (i32.const 97) + ) + (i32.store + (i32.const 116) + (i32.const 140) + ) + (i32.store + (i32.const 120) + (i32.const 126) + ) + (i32.store + (i32.const 124) + (i32.const 3) + ) + (block + (block $block$10$break + (block $block$4$break + (block $block$3$break + (block + (call $print (i32.const 0) - (i32.load offset=4 - (i32.load - (i32.const 4) - ) - ) - ) - ) - (i32.load offset=4 - (i32.load - (i32.const 4) + ) + (set_local $0 + (call $check) + ) ) - ) - ) - (func $main (type $v) - (local $0 i32) - (local $1 i32) - (i32.store - (i32.const 8) - (i32.const 67) - ) - (i32.store - (i32.const 12) - (i32.const 131) - ) - (i32.store - (i32.const 16) - (i32.const 49) - ) - (i32.store - (i32.const 20) - (i32.const 36) - ) - (i32.store - (i32.const 24) - (i32.const 112) - ) - (i32.store - (i32.const 28) - (i32.const 161) - ) - (i32.store - (i32.const 32) - (i32.const 62) - ) - (i32.store - (i32.const 36) - (i32.const 166) - ) - (i32.store - (i32.const 40) - (i32.const 16) - ) - (i32.store - (i32.const 44) - (i32.const 88) - ) - (i32.store - (i32.const 48) - (i32.const 176) - ) - (i32.store - (i32.const 52) - (i32.const 152) - ) - (i32.store - (i32.const 56) - (i32.const 161) - ) - (i32.store - (i32.const 60) - (i32.const 194) - ) - (i32.store - (i32.const 64) - (i32.const 117) - ) - (i32.store - (i32.const 68) - (i32.const 180) - ) - (i32.store - (i32.const 72) - (i32.const 60) - ) - (i32.store - (i32.const 76) - (i32.const 166) - ) - (i32.store - (i32.const 80) - (i32.const 55) - ) - (i32.store - (i32.const 84) - (i32.const 183) - ) - (i32.store - (i32.const 88) - (i32.const 150) - ) - (i32.store - (i32.const 92) - (i32.const 73) - ) - (i32.store - (i32.const 96) - (i32.const 196) - ) - (i32.store - (i32.const 100) - (i32.const 143) - ) - (i32.store - (i32.const 104) - (i32.const 76) - ) - (i32.store - (i32.const 108) - (i32.const 182) - ) - (i32.store - (i32.const 112) - (i32.const 97) - ) - (i32.store - (i32.const 116) - (i32.const 140) - ) - (i32.store - (i32.const 120) - (i32.const 126) - ) - (i32.store - (i32.const 124) - (i32.const 3) - ) - (block - (block $block$10$break - (block $block$4$break - (block $block$3$break - (block - (call $print - (i32.const 0) - ) - (set_local $0 - (call $check) - ) - ) - (if - (i32.eq - (i32.rem_u - (get_local $0) - (i32.const 4) - ) - (i32.const 0) - ) - (br $block$3$break) - (if - (i32.eq - (i32.rem_u - (get_local $0) - (i32.const 4) - ) - (i32.const 2) - ) - (block - (block - (call $print - (i32.const 7) - ) - (set_local $0 - (call $check) - ) - ) - (if - (i32.eq - (i32.rem_u - (get_local $0) - (i32.const 3) - ) - (i32.const 0) - ) - (br $block$3$break) - (br $block$10$break) - ) - ) - (br $block$4$break) - ) - ) - ) - (block - (block - (call $print - (i32.const 2) - ) - (set_local $0 - (call $check) - ) - ) - (if - (i32.eq - (i32.rem_u - (get_local $0) - (i32.const 2) - ) - (i32.const 0) - ) - (br $block$4$break) - (br $block$10$break) - ) - ) + (if + (i32.eq + (i32.rem_u + (get_local $0) + (i32.const 4) ) - (loop $shape$6$continue - (block - (call $print - (i32.const 3) - ) - (set_local $0 - (call $check) - ) - ) - (block - (br $shape$6$continue) - ) + (i32.const 0) + ) + (br $block$3$break) + (if + (i32.eq + (i32.rem_u + (get_local $0) + (i32.const 4) + ) + (i32.const 2) ) - ) - (block (block + (block (call $print - (i32.const 9) + (i32.const 7) ) (set_local $0 - (call $check) + (call $check) ) + ) + (if + (i32.eq + (i32.rem_u + (get_local $0) + (i32.const 3) + ) + (i32.const 0) + ) + (br $block$3$break) + (br $block$10$break) + ) ) + (br $block$4$break) + ) ) - ) - ) -) -(module - (type $i (func (result i32))) - (type $v (func)) - (type $vi (func (param i32))) - (import "spectest" "print" (func $print (param i32))) - (memory $0 1 1) - (export "mem" (memory $0)) - (start $main) - (func $check (type $i) (result i32) - (if - (i32.eq - (i32.load - (i32.const 4) - ) - (i32.const 120) + ) + (block + (block + (call $print + (i32.const 2) + ) + (set_local $0 + (call $check) + ) ) - (unreachable) - ) - (i32.store - (i32.const 4) - (i32.add - (i32.load - (i32.const 4) + (if + (i32.eq + (i32.rem_u + (get_local $0) + (i32.const 2) ) - (i32.const 4) - ) - ) - (call $print - (i32.sub (i32.const 0) - (i32.load offset=4 - (i32.load - (i32.const 4) - ) - ) + ) + (br $block$4$break) + (br $block$10$break) ) + ) ) - (i32.load offset=4 - (i32.load - (i32.const 4) + (loop $shape$6$continue + (block + (call $print + (i32.const 3) ) + (set_local $0 + (call $check) + ) + ) + (block + (br $shape$6$continue) + ) ) - ) - (func $main (type $v) - (local $0 i32) - (i32.store - (i32.const 8) - (i32.const 67) - ) - (i32.store - (i32.const 12) - (i32.const 131) - ) - (i32.store - (i32.const 16) - (i32.const 49) - ) - (i32.store - (i32.const 20) - (i32.const 36) - ) - (i32.store - (i32.const 24) - (i32.const 112) - ) - (i32.store - (i32.const 28) - (i32.const 161) - ) - (i32.store - (i32.const 32) - (i32.const 62) - ) - (i32.store - (i32.const 36) - (i32.const 166) - ) - (i32.store - (i32.const 40) - (i32.const 16) - ) - (i32.store - (i32.const 44) - (i32.const 88) - ) - (i32.store - (i32.const 48) - (i32.const 176) - ) - (i32.store - (i32.const 52) - (i32.const 152) - ) - (i32.store - (i32.const 56) - (i32.const 161) - ) - (i32.store - (i32.const 60) - (i32.const 194) - ) - (i32.store - (i32.const 64) - (i32.const 117) - ) - (i32.store - (i32.const 68) - (i32.const 180) - ) - (i32.store - (i32.const 72) - (i32.const 60) - ) - (i32.store - (i32.const 76) - (i32.const 166) - ) - (i32.store - (i32.const 80) - (i32.const 55) - ) - (i32.store - (i32.const 84) - (i32.const 183) - ) - (i32.store - (i32.const 88) - (i32.const 150) - ) - (i32.store - (i32.const 92) - (i32.const 73) - ) - (i32.store - (i32.const 96) - (i32.const 196) - ) - (i32.store - (i32.const 100) - (i32.const 143) - ) - (i32.store - (i32.const 104) - (i32.const 76) - ) - (i32.store - (i32.const 108) - (i32.const 182) - ) - (i32.store - (i32.const 112) - (i32.const 97) - ) - (i32.store - (i32.const 116) - (i32.const 140) + ) + (block + (block + (call $print + (i32.const 9) + ) + (set_local $0 + (call $check) + ) ) - (i32.store - (i32.const 120) - (i32.const 126) + ) + ) + ) +) +(module + (type $i (func (result i32))) + (type $v (func)) + (type $vi (func (param i32))) + (import "spectest" "print" (func $print (param i32))) + (memory $0 1 1) + (export "mem" (memory $0)) + (start $main) + (func $check (type $i) (result i32) + (if + (i32.eq + (i32.load + (i32.const 4) + ) + (i32.const 120) + ) + (unreachable) + ) + (i32.store + (i32.const 4) + (i32.add + (i32.load + (i32.const 4) + ) + (i32.const 4) + ) + ) + (call $print + (i32.sub + (i32.const 0) + (i32.load offset=4 + (i32.load + (i32.const 4) + ) ) - (i32.store - (i32.const 124) - (i32.const 3) + ) + ) + (i32.load offset=4 + (i32.load + (i32.const 4) + ) + ) + ) + (func $main (type $v) + (local $0 i32) + (i32.store + (i32.const 8) + (i32.const 67) + ) + (i32.store + (i32.const 12) + (i32.const 131) + ) + (i32.store + (i32.const 16) + (i32.const 49) + ) + (i32.store + (i32.const 20) + (i32.const 36) + ) + (i32.store + (i32.const 24) + (i32.const 112) + ) + (i32.store + (i32.const 28) + (i32.const 161) + ) + (i32.store + (i32.const 32) + (i32.const 62) + ) + (i32.store + (i32.const 36) + (i32.const 166) + ) + (i32.store + (i32.const 40) + (i32.const 16) + ) + (i32.store + (i32.const 44) + (i32.const 88) + ) + (i32.store + (i32.const 48) + (i32.const 176) + ) + (i32.store + (i32.const 52) + (i32.const 152) + ) + (i32.store + (i32.const 56) + (i32.const 161) + ) + (i32.store + (i32.const 60) + (i32.const 194) + ) + (i32.store + (i32.const 64) + (i32.const 117) + ) + (i32.store + (i32.const 68) + (i32.const 180) + ) + (i32.store + (i32.const 72) + (i32.const 60) + ) + (i32.store + (i32.const 76) + (i32.const 166) + ) + (i32.store + (i32.const 80) + (i32.const 55) + ) + (i32.store + (i32.const 84) + (i32.const 183) + ) + (i32.store + (i32.const 88) + (i32.const 150) + ) + (i32.store + (i32.const 92) + (i32.const 73) + ) + (i32.store + (i32.const 96) + (i32.const 196) + ) + (i32.store + (i32.const 100) + (i32.const 143) + ) + (i32.store + (i32.const 104) + (i32.const 76) + ) + (i32.store + (i32.const 108) + (i32.const 182) + ) + (i32.store + (i32.const 112) + (i32.const 97) + ) + (i32.store + (i32.const 116) + (i32.const 140) + ) + (i32.store + (i32.const 120) + (i32.const 126) + ) + (i32.store + (i32.const 124) + (i32.const 3) + ) + (block $block$10$break + (block $block$4$break + (call $print + (i32.const 0) ) - (block $block$10$break - (block $block$4$break - (call $print - (i32.const 0) - ) - (if - (i32.rem_u - (tee_local $0 - (call $check) - ) - (i32.const 4) - ) - (if - (i32.eq - (i32.rem_u - (get_local $0) - (i32.const 4) - ) - (i32.const 2) - ) - (block - (call $print - (i32.const 7) - ) - (br_if $block$10$break - (i32.rem_u - (call $check) - (i32.const 3) - ) - ) - ) - (br $block$4$break) - ) - ) - (call $print - (i32.const 2) - ) - (br_if $block$10$break - (i32.rem_u - (call $check) - (i32.const 2) - ) - ) + (if + (i32.rem_u + (tee_local $0 + (call $check) ) - (loop $shape$6$continue - (call $print - (i32.const 3) - ) - (drop - (call $check) + (i32.const 4) + ) + (if + (i32.eq + (i32.rem_u + (get_local $0) + (i32.const 4) + ) + (i32.const 2) + ) + (block + (call $print + (i32.const 7) + ) + (br_if $block$10$break + (i32.rem_u + (call $check) + (i32.const 3) ) - (br $shape$6$continue) + ) ) + (br $block$4$break) + ) ) (call $print - (i32.const 9) + (i32.const 2) ) - (drop + (br_if $block$10$break + (i32.rem_u (call $check) + (i32.const 2) + ) ) + ) + (loop $shape$6$continue + (call $print + (i32.const 3) + ) + (drop + (call $check) + ) + (br $shape$6$continue) + ) + ) + (call $print + (i32.const 9) + ) + (drop + (call $check) ) + ) ) |