summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-05-05 15:47:42 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-05-05 15:47:42 -0700
commit1d267ad1ecf7e9fd5ea6b22679beeb82585723f0 (patch)
tree2beb58d695e6b0bd381d7b2874818eb93805f3e8 /test
parentfae63cb6a26ab5a9cc2fdaa56d778215d1a1fc35 (diff)
parentf81355b2750717584e309699dfcae3c814167578 (diff)
downloadbinaryen-1d267ad1ecf7e9fd5ea6b22679beeb82585723f0.tar.gz
binaryen-1d267ad1ecf7e9fd5ea6b22679beeb82585723f0.tar.bz2
binaryen-1d267ad1ecf7e9fd5ea6b22679beeb82585723f0.zip
Merge pull request #436 from WebAssembly/fix-switch
Fix switches in simplify-locals
Diffstat (limited to 'test')
-rw-r--r--test/passes/simplify-locals.txt19
-rw-r--r--test/passes/simplify-locals.wast19
2 files changed, 38 insertions, 0 deletions
diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt
index cc84c35d5..d97e8fc33 100644
--- a/test/passes/simplify-locals.txt
+++ b/test/passes/simplify-locals.txt
@@ -517,4 +517,23 @@
(get_local $m)
(get_local $t)
)
+ (func $switch-def (param $i3 i32) (result i32)
+ (local $i1 i32)
+ (set_local $i1
+ (i32.const 10)
+ )
+ (block $switch$def
+ (block $switch-case$1
+ (br_table $switch-case$1 $switch$def
+ (get_local $i3)
+ )
+ )
+ (set_local $i1
+ (i32.const 1)
+ )
+ )
+ (return
+ (get_local $i1)
+ )
+ )
)
diff --git a/test/passes/simplify-locals.wast b/test/passes/simplify-locals.wast
index 5f1db4bdb..521e8bac4 100644
--- a/test/passes/simplify-locals.wast
+++ b/test/passes/simplify-locals.wast
@@ -451,5 +451,24 @@
(get_local $s)
(get_local $t)
)
+ (func $switch-def (param $i3 i32) (result i32)
+ (local $i1 i32)
+ (set_local $i1
+ (i32.const 10)
+ )
+ (block $switch$def
+ (block $switch-case$1
+ (br_table $switch-case$1 $switch$def
+ (get_local $i3)
+ )
+ )
+ (set_local $i1
+ (i32.const 1)
+ )
+ )
+ (return
+ (get_local $i1)
+ )
+ )
)