diff options
Diffstat (limited to 'test/passes/merge-locals_all-features.txt')
-rw-r--r-- | test/passes/merge-locals_all-features.txt | 471 |
1 files changed, 471 insertions, 0 deletions
diff --git a/test/passes/merge-locals_all-features.txt b/test/passes/merge-locals_all-features.txt new file mode 100644 index 000000000..1210fab59 --- /dev/null +++ b/test/passes/merge-locals_all-features.txt @@ -0,0 +1,471 @@ +(module + (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $none_=>_none (func)) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $i32_f32_f32_=>_i64 (func (param i32 f32 f32) (result i64))) + (global $global$0 (mut i32) (i32.const 10)) + (func $test (; 0 ;) (param $x i32) (param $y i32) (result i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (local.get $x) + ) + ) + (local.get $x) + ) + (func $test2 (; 1 ;) (param $x i32) (param $y i32) (result i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (local.get $x) + ) + ) + (local.get $x) + ) + (func $test-multiple (; 2 ;) (param $x i32) (param $y i32) (result i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (local.get $x) + ) + ) + (drop + (local.get $x) + ) + (local.get $x) + ) + (func $test-just-some (; 3 ;) (param $x i32) (param $y i32) (result i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (local.get $x) + ) + ) + (drop + (local.get $x) + ) + (local.set $y + (i32.const 200) + ) + (local.get $y) + ) + (func $test-just-some2 (; 4 ;) (param $x i32) (param $y i32) (result i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (local.get $x) + ) + ) + (if + (i32.const 300) + (local.set $y + (i32.const 400) + ) + (drop + (local.get $x) + ) + ) + (i32.const 500) + ) + (func $test-just-some3 (; 5 ;) (param $x i32) (param $y i32) (result i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (i32.const 200) + ) + ) + (if + (i32.const 300) + (local.set $y + (i32.const 400) + ) + (drop + (local.get $y) + ) + ) + (local.get $y) + ) + (func $silly-self (; 6 ;) (param $x i32) (param $y i32) (result i32) + (drop + (if (result i32) + (local.tee $x + (local.get $x) + ) + (i32.const 100) + (local.get $x) + ) + ) + (local.get $y) + ) + (func $silly-multi (; 7 ;) (param $x i32) (param $y i32) (result i32) + (drop + (if (result i32) + (local.tee $x + (local.tee $y + (local.get $x) + ) + ) + (i32.const 100) + (local.get $x) + ) + ) + (local.get $y) + ) + (func $undo-1 (; 8 ;) (param $var$1 i32) (param $var$2 i32) + (local $var$5 i32) + (local.set $var$2 + (local.get $var$1) + ) + (local.set $var$2 + (i32.const 1) + ) + (drop + (local.get $var$1) + ) + ) + (func $undo-2 (; 9 ;) (param $var$1 i32) (param $var$2 i32) + (local $var$5 i32) + (local.set $var$2 + (local.get $var$1) + ) + (if + (local.get $var$1) + (local.set $var$2 + (i32.const 1) + ) + ) + (drop + (local.get $var$1) + ) + ) + (func $reverse (; 10 ;) (param $x i32) (param $y i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (local.get $y) + ) + ) + (drop + (local.get $y) + ) + (if + (i32.const 1) + (local.set $y + (i32.const 200) + ) + ) + (drop + (local.get $y) + ) + ) + (func $reverse-end (; 11 ;) (param $x i32) (param $y i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (local.get $x) + ) + ) + ) + (func $reverse-lone-end-2 (; 12 ;) (param $x i32) (param $y i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (local.get $x) + ) + ) + (local.set $y + (i32.const 200) + ) + (drop + (local.get $y) + ) + ) + (func $reverse-undo (; 13 ;) (param $x i32) (param $y i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (local.get $y) + ) + ) + (local.set $x + (i32.const 300) + ) + (drop + (local.get $x) + ) + (if + (i32.const 1) + (local.set $y + (i32.const 200) + ) + ) + (drop + (local.get $y) + ) + ) + (func $reverse-undo2 (; 14 ;) (param $x i32) (param $y i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (i32.const 150) + ) + ) + (local.set $x + (i32.const 300) + ) + (drop + (local.get $x) + ) + (if + (i32.const 1) + (local.set $y + (i32.const 200) + ) + ) + (drop + (local.get $y) + ) + ) + (func $reverse-undo3-conditional (; 15 ;) (param $x i32) (param $y i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (i32.const 150) + ) + ) + (if + (i32.const 1) + (local.set $x + (i32.const 300) + ) + ) + (drop + (local.get $x) + ) + (if + (i32.const 1) + (local.set $y + (i32.const 200) + ) + ) + (drop + (local.get $y) + ) + ) + (func $reverse-undo3-conditional-b (; 16 ;) (param $x i32) (param $y i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (local.get $x) + ) + ) + (if + (i32.const 1) + (local.set $x + (i32.const 300) + ) + ) + (drop + (local.get $x) + ) + (if + (i32.const 1) + (local.set $y + (i32.const 200) + ) + ) + (drop + (local.get $y) + ) + ) + (func $reverse-undo3-conditional-c (; 17 ;) (param $x i32) (param $y i32) + (drop + (if (result i32) + (local.tee $x + (local.get $y) + ) + (i32.const 100) + (i32.const 150) + ) + ) + (if + (i32.const 1) + (drop + (local.get $x) + ) + (block $block + (if + (i32.const 1) + (local.set $x + (i32.const 300) + ) + ) + (drop + (local.get $x) + ) + ) + ) + (if + (i32.const 1) + (local.set $y + (i32.const 200) + ) + ) + (drop + (local.get $y) + ) + ) + (func $fuzz (; 18 ;) (param $var$0 i32) (param $var$1 f32) (param $var$2 f32) (result i64) + (local $var$3 i32) + (global.set $global$0 + (i32.sub + (global.get $global$0) + (i32.const 1) + ) + ) + (loop $label$1 (result i64) + (global.set $global$0 + (i32.sub + (global.get $global$0) + (i32.const 1) + ) + ) + (br_if $label$1 + (block $label$2 (result i32) + (drop + (if (result i32) + (block $label$3 (result i32) + (global.set $global$0 + (i32.sub + (global.get $global$0) + (i32.const 3) + ) + ) + (local.set $var$3 + (i32.const 1) + ) + (local.tee $var$3 + (local.get $var$0) + ) + ) + (i32.const 0) + (block $block (result i32) + (local.set $var$3 + (if (result i32) + (i32.const 0) + (block $block13 (result i32) + (block $label$7 + (block $label$8 + (local.set $var$0 + (i32.const 34738786) + ) + ) + ) + (local.get $var$3) + ) + (block $block14 (result i32) + (if + (i32.eqz + (global.get $global$0) + ) + (return + (i64.const 137438953472) + ) + ) + (global.set $global$0 + (i32.sub + (global.get $global$0) + (i32.const 1) + ) + ) + (br_if $label$1 + (i32.eqz + (local.get $var$3) + ) + ) + (return + (i64.const 44125) + ) + ) + ) + ) + (i32.const -129) + ) + ) + ) + (i32.const 0) + ) + ) + (i64.const -36028797018963968) + ) + ) + (func $trivial-confusion (; 19 ;) (param $unused i32) (param $param i32) (param $result i32) + (loop $label$1 + (if + (i32.const 1) + (drop + (local.get $result) + ) + ) + (local.set $result + (local.get $param) + ) + (br_if $label$1 + (local.tee $unused + (local.get $param) + ) + ) + ) + ) + (func $subtype-test (; 20 ;) + (local $0 anyref) + (local $1 nullref) + (local $2 nullref) + (local.set $0 + (local.get $1) + ) + (local.set $2 + (local.get $1) + ) + ) +) |