summaryrefslogtreecommitdiff
path: root/test/unit.fromasm.imprecise
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-11-06 16:49:23 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-11-06 17:16:59 -0800
commit4a3892d31288bded757e3805cb53d4e20ccc6be0 (patch)
tree01b3e429c5afb8794c972c27276385345f53e8b8 /test/unit.fromasm.imprecise
parent962c9a63f854f888e4f0fc48f217beefccce4266 (diff)
downloadbinaryen-4a3892d31288bded757e3805cb53d4e20ccc6be0.tar.gz
binaryen-4a3892d31288bded757e3805cb53d4e20ccc6be0.tar.bz2
binaryen-4a3892d31288bded757e3805cb53d4e20ccc6be0.zip
handle a label setting inside the if-body of a label value in RelooperJumpThreading
Diffstat (limited to 'test/unit.fromasm.imprecise')
-rw-r--r--test/unit.fromasm.imprecise53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index 98a797f65..e7077524e 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -69,6 +69,7 @@
(export "jumpThreadDrop" (func $jumpThreadDrop))
(export "dropIgnoredImportInIf" (func $dropIgnoredImportInIf))
(export "dropIgnoredImportsInIf" (func $dropIgnoredImportsInIf))
+ (export "relooperJumpThreading_irreducible" (func $relooperJumpThreading_irreducible))
(func $big_negative
(nop)
)
@@ -1003,6 +1004,58 @@
(br $while-in)
)
)
+ (func $relooperJumpThreading_irreducible (param $0 i32)
+ (local $1 i32)
+ (if
+ (i32.eq
+ (get_local $0)
+ (i32.const 100)
+ )
+ (loop $while-in
+ (call $relooperJumpThreading_irreducible
+ (i32.const 1337)
+ )
+ (br $while-in)
+ )
+ )
+ (set_local $1
+ (select
+ (i32.const 2)
+ (i32.const 10)
+ (i32.eq
+ (get_local $0)
+ (i32.const 200)
+ )
+ )
+ )
+ (if
+ (i32.eq
+ (get_local $0)
+ (i32.const 300)
+ )
+ (set_local $1
+ (i32.const 2)
+ )
+ )
+ (if
+ (i32.eq
+ (get_local $1)
+ (i32.const 2)
+ )
+ (call $relooperJumpThreading_irreducible
+ (i32.const 1448)
+ )
+ )
+ (if
+ (i32.eq
+ (get_local $1)
+ (i32.const 10)
+ )
+ (call $relooperJumpThreading_irreducible
+ (i32.const 2000)
+ )
+ )
+ )
(func $__Z12multi_varargiz (param $0 i32)
(local $1 i32)
(local $2 i32)