diff options
author | Alon Zakai (kripken) <alonzakai@gmail.com> | 2017-07-10 20:31:58 -0700 |
---|---|---|
committer | Alon Zakai (kripken) <alonzakai@gmail.com> | 2017-07-11 11:07:46 -0700 |
commit | b2445bf12b1ba96209b6ebece3806503411f1c94 (patch) | |
tree | 3573d04f7ea3645f5608a142ffd0219385dcd963 /test | |
parent | 4be7ec00157250ca83b61a2e1885645c67c6369c (diff) | |
download | binaryen-b2445bf12b1ba96209b6ebece3806503411f1c94.tar.gz binaryen-b2445bf12b1ba96209b6ebece3806503411f1c94.tar.bz2 binaryen-b2445bf12b1ba96209b6ebece3806503411f1c94.zip |
changing a set to a tee or vice versa needs to take into account the value may be unreachable
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/simplify-locals-nostructure.txt | 4 | ||||
-rw-r--r-- | test/passes/simplify-locals.txt | 9 | ||||
-rw-r--r-- | test/passes/simplify-locals.wast | 11 |
3 files changed, 21 insertions, 3 deletions
diff --git a/test/passes/simplify-locals-nostructure.txt b/test/passes/simplify-locals-nostructure.txt index 6857a4c7a..2cb942f43 100644 --- a/test/passes/simplify-locals-nostructure.txt +++ b/test/passes/simplify-locals-nostructure.txt @@ -64,8 +64,6 @@ ) (func $no-unreachable (type $0) (local $x i32) - (drop - (unreachable) - ) + (unreachable) ) ) diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt index 8c12c274a..2be81e8c6 100644 --- a/test/passes/simplify-locals.txt +++ b/test/passes/simplify-locals.txt @@ -866,4 +866,13 @@ ) ) ) + (func $drop-tee-unreachable (type $FUNCSIG$v) + (local $x i32) + (tee_local $x + (unreachable) + ) + (drop + (get_local $x) + ) + ) ) diff --git a/test/passes/simplify-locals.wast b/test/passes/simplify-locals.wast index 359620a18..534bd8883 100644 --- a/test/passes/simplify-locals.wast +++ b/test/passes/simplify-locals.wast @@ -860,4 +860,15 @@ ) (get_local $label) ) + (func $drop-tee-unreachable + (local $x i32) + (drop + (tee_local $x + (unreachable) + ) + ) + (drop + (get_local $x) + ) + ) ) |