summaryrefslogtreecommitdiff
path: root/test/unit.fromasm.imprecise.no-opts
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-10-03 21:38:40 -0700
committerGitHub <noreply@github.com>2016-10-03 21:38:40 -0700
commit5046a524d506add48cb3779b39b4983e78292410 (patch)
treed0991dcb3b3ad70ef82fa68bcc155d4fe5b3da45 /test/unit.fromasm.imprecise.no-opts
parentd19721bc110f0c4545eeaed825de99f963834a0a (diff)
downloadbinaryen-5046a524d506add48cb3779b39b4983e78292410.tar.gz
binaryen-5046a524d506add48cb3779b39b4983e78292410.tar.bz2
binaryen-5046a524d506add48cb3779b39b4983e78292410.zip
don't create an unnecessary duplicate block in asm2wasm switches, when there isn't a default (#734)
Diffstat (limited to 'test/unit.fromasm.imprecise.no-opts')
-rw-r--r--test/unit.fromasm.imprecise.no-opts134
1 files changed, 63 insertions, 71 deletions
diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts
index bd9f28762..905d13437 100644
--- a/test/unit.fromasm.imprecise.no-opts
+++ b/test/unit.fromasm.imprecise.no-opts
@@ -199,119 +199,111 @@
(func $switcher (param $x i32) (result i32)
(local $waka i32)
(block $switch$0
- (block $switch-default$3
- (block $switch-case$2
- (block $switch-case$1
- (br_table $switch-case$1 $switch-case$2 $switch-default$3
- (i32.sub
- (get_local $x)
- (i32.const 1)
- )
+ (block $switch-case$2
+ (block $switch-case$1
+ (br_table $switch-case$1 $switch-case$2 $switch$0
+ (i32.sub
+ (get_local $x)
+ (i32.const 1)
)
)
- (return
- (i32.const 1)
- )
)
(return
- (i32.const 2)
+ (i32.const 1)
)
)
+ (return
+ (i32.const 2)
+ )
)
- (block $switch$4
- (block $switch-default$7
- (block $switch-case$6
- (block $switch-case$5
- (br_table $switch-case$6 $switch-default$7 $switch-default$7 $switch-default$7 $switch-default$7 $switch-default$7 $switch-default$7 $switch-case$5 $switch-default$7
- (i32.sub
- (get_local $x)
- (i32.const 5)
- )
+ (block $switch$3
+ (block $switch-case$5
+ (block $switch-case$4
+ (br_table $switch-case$5 $switch$3 $switch$3 $switch$3 $switch$3 $switch$3 $switch$3 $switch-case$4 $switch$3
+ (i32.sub
+ (get_local $x)
+ (i32.const 5)
)
)
- (return
- (i32.const 121)
- )
)
(return
- (i32.const 51)
+ (i32.const 121)
)
)
+ (return
+ (i32.const 51)
+ )
)
(block $label$break$Lout
- (block $switch-default$16
- (block $switch-case$15
- (block $switch-case$12
- (block $switch-case$9
- (block $switch-case$8
- (br_table $switch-case$15 $switch-default$16 $switch-default$16 $switch-case$12 $switch-default$16 $switch-default$16 $switch-default$16 $switch-default$16 $switch-case$9 $switch-default$16 $switch-case$8 $switch-default$16
- (i32.sub
- (get_local $x)
- (i32.const 2)
- )
+ (block $switch-case$13
+ (block $switch-case$10
+ (block $switch-case$7
+ (block $switch-case$6
+ (br_table $switch-case$13 $label$break$Lout $label$break$Lout $switch-case$10 $label$break$Lout $label$break$Lout $label$break$Lout $label$break$Lout $switch-case$7 $label$break$Lout $switch-case$6 $label$break$Lout
+ (i32.sub
+ (get_local $x)
+ (i32.const 2)
)
)
- (br $label$break$Lout)
- )
- (br $label$break$Lout)
- )
- (block
- (loop $while-in$11
- (block $while-out$10
- (br $while-out$10)
- (br $while-in$11)
- )
)
(br $label$break$Lout)
)
+ (br $label$break$Lout)
)
(block
- (loop $while-in$14
- (block $while-out$13
- (br $label$break$Lout)
- (br $while-in$14)
+ (loop $while-in$9
+ (block $while-out$8
+ (br $while-out$8)
+ (br $while-in$9)
)
)
(br $label$break$Lout)
)
)
+ (block
+ (loop $while-in$12
+ (block $while-out$11
+ (br $label$break$Lout)
+ (br $while-in$12)
+ )
+ )
+ (br $label$break$Lout)
+ )
)
(loop $label$continue$L1
(block $label$break$L1
(loop $label$continue$L3
(block $label$break$L3
- (block $switch$17
- (block $switch-default$21
- (block $switch-default$21
- (block $switch-case$20
- (block $switch-case$19
- (block $switch-case$18
- (br_table $switch-case$18 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-case$20 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-default$21 $switch-case$19 $switch-default$21
- (i32.sub
- (get_local $x)
- (i32.const -1)
- )
+ (block $switch$14
+ (block $switch-default$18
+ (block $switch-case$17
+ (block $switch-case$16
+ (block $switch-case$15
+ (br_table $switch-case$15 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-case$17 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-default$18 $switch-case$16 $switch-default$18
+ (i32.sub
+ (get_local $x)
+ (i32.const -1)
)
)
- (block
- (br $label$break$L1)
- (br $switch$17)
- )
)
(block
- (set_local $waka
- (i32.const 1)
- )
- (br $switch$17)
+ (br $label$break$L1)
+ (br $switch$14)
)
)
(block
- (br $label$break$L3)
- (br $switch$17)
+ (set_local $waka
+ (i32.const 1)
+ )
+ (br $switch$14)
)
)
- (br $label$break$L1)
+ (block
+ (br $label$break$L3)
+ (br $switch$14)
+ )
)
+ (br $label$break$L1)
)
(br $label$continue$L3)
)