diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-01-09 10:06:24 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-01-09 10:06:24 -0800 |
commit | c6cefdac99c511bdd05b68f8e2b53a0edb7ff815 (patch) | |
tree | 87c0627cfe31e188da4284163bf66d8716c77a6f /test | |
parent | cbd9d53ac1e034c315993d88c1572c900389e670 (diff) | |
download | binaryen-c6cefdac99c511bdd05b68f8e2b53a0edb7ff815.tar.gz binaryen-c6cefdac99c511bdd05b68f8e2b53a0edb7ff815.tar.bz2 binaryen-c6cefdac99c511bdd05b68f8e2b53a0edb7ff815.zip |
start work on SimplifyLocals
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/simplify-locals.txt | 35 | ||||
-rw-r--r-- | test/passes/simplify-locals.wast | 31 |
2 files changed, 66 insertions, 0 deletions
diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt new file mode 100644 index 000000000..773215ad7 --- /dev/null +++ b/test/passes/simplify-locals.txt @@ -0,0 +1,35 @@ +(module + (memory 16777216 16777216) + (func $b0-yes (param $i1 i32) + (local $x i32) + (local $y i32) + (set_local $x + (i32.const 5) + ) + (block $block0 + (set_local $x + (i32.const 7) + ) + ) + (set_local $x + (i32.const 11) + ) + (set_local $x + (i32.const 5) + ) + (get_local $y) + (block $block1 + (set_local $x + (i32.const 7) + ) + (get_local $y) + ) + (set_local $x + (i32.const 11) + ) + (get_local $y) + (set_local $x + (i32.const 17) + ) + ) +) diff --git a/test/passes/simplify-locals.wast b/test/passes/simplify-locals.wast new file mode 100644 index 000000000..fca2f24c7 --- /dev/null +++ b/test/passes/simplify-locals.wast @@ -0,0 +1,31 @@ +(module + (memory 16777216 16777216) + (func $b0-yes (param $i1 i32) + (local $x i32) + (local $y i32) + (set_local $x (i32.const 5)) + (get_local $x) + (block + (set_local $x (i32.const 7)) + (get_local $x) + ) + (set_local $x (i32.const 11)) + (get_local $x) + (set_local $x (i32.const 5)) + (get_local $y) + (block + (set_local $x (i32.const 7)) + (get_local $y) + ) + (set_local $x (i32.const 11)) + (get_local $y) + (set_local $x (i32.const 17)) + (get_local $x) + (get_local $x) + (get_local $x) + (get_local $x) + (get_local $x) + (get_local $x) + ) +) + |