summaryrefslogtreecommitdiff
path: root/test/unit.fromasm
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit.fromasm')
-rw-r--r--test/unit.fromasm263
1 files changed, 140 insertions, 123 deletions
diff --git a/test/unit.fromasm b/test/unit.fromasm
index 34990e297..249a02a1c 100644
--- a/test/unit.fromasm
+++ b/test/unit.fromasm
@@ -28,51 +28,53 @@
)
(func $importedDoubles (result f64)
(local $temp f64)
- (block $topmost
- (set_local $temp
+ (set_local $temp
+ (f64.add
(f64.add
(f64.add
- (f64.add
- (f64.load align=8
- (i32.const 8)
- )
- (f64.load align=8
- (i32.const 16)
- )
+ (f64.load align=8
+ (i32.const 8)
)
- (f64.neg
- (f64.load align=8
- (i32.const 16)
- )
+ (f64.load align=8
+ (i32.const 16)
)
)
(f64.neg
(f64.load align=8
- (i32.const 8)
+ (i32.const 16)
)
)
)
- )
- (br_if
- (i32.gt_s
- (i32.load align=4
- (i32.const 24)
+ (f64.neg
+ (f64.load align=8
+ (i32.const 8)
)
- (i32.const 0)
)
- $topmost
+ )
+ )
+ (if
+ (i32.gt_s
+ (i32.load align=4
+ (i32.const 24)
+ )
+ (i32.const 0)
+ )
+ (return
(f64.const -3.4)
)
- (br_if
- (f64.gt
- (f64.load align=8
- (i32.const 32)
- )
- (f64.const 0)
+ )
+ (if
+ (f64.gt
+ (f64.load align=8
+ (i32.const 32)
)
- $topmost
+ (f64.const 0)
+ )
+ (return
(f64.const 5.6)
)
+ )
+ (return
(f64.const 1.2)
)
)
@@ -80,47 +82,53 @@
(local $t f64)
(local $Int f64)
(local $Double i32)
- (block $topmost
- (br_if
- (f64.gt
- (get_local $x)
- (f64.const 0)
- )
- $topmost
+ (if
+ (f64.gt
+ (get_local $x)
+ (f64.const 0)
+ )
+ (return
(f64.const 1.2)
)
- (br_if
- (f64.gt
- (get_local $Int)
- (f64.const 0)
- )
- $topmost
+ )
+ (if
+ (f64.gt
+ (get_local $Int)
+ (f64.const 0)
+ )
+ (return
(f64.const -3.4)
)
- (br_if
- (i32.gt_s
- (get_local $Double)
- (i32.const 0)
- )
- $topmost
+ )
+ (if
+ (i32.gt_s
+ (get_local $Double)
+ (i32.const 0)
+ )
+ (return
(f64.const 5.6)
)
- (br_if
- (f64.lt
- (get_local $x)
- (get_local $y)
- )
- $topmost
+ )
+ (if
+ (f64.lt
+ (get_local $x)
+ (get_local $y)
+ )
+ (return
(get_local $x)
)
+ )
+ (return
(get_local $y)
)
)
(func $intOps (result i32)
(local $x i32)
- (i32.eq
- (get_local $x)
- (i32.const 0)
+ (return
+ (i32.eq
+ (get_local $x)
+ (i32.const 0)
+ )
)
)
(func $conversions
@@ -158,90 +166,92 @@
)
)
(func $switcher (param $x i32) (result i32)
- (block $topmost
- (tableswitch $switch$0
- (i32.sub
- (get_local $x)
- (i32.const 1)
- )
- (table (case $switch-case$1) (case $switch-case$2)) (case $switch-default$3)
- (case $switch-case$1
- (br $topmost
- (i32.const 1)
- )
- )
- (case $switch-case$2
- (br $topmost
- (i32.const 2)
- )
- )
- (case $switch-default$3
- (nop)
- )
+ (tableswitch $switch$0
+ (i32.sub
+ (get_local $x)
+ (i32.const 1)
)
- (tableswitch $switch$4
- (i32.sub
- (get_local $x)
- (i32.const 5)
- )
- (table (case $switch-case$6) (case $switch-default$7) (case $switch-default$7) (case $switch-default$7) (case $switch-default$7) (case $switch-default$7) (case $switch-default$7) (case $switch-case$5)) (case $switch-default$7)
- (case $switch-case$5
- (br $topmost
- (i32.const 121)
- )
- )
- (case $switch-case$6
- (br $topmost
- (i32.const 51)
- )
- )
- (case $switch-default$7
- (nop)
+ (table (case $switch-case$1) (case $switch-case$2)) (case $switch-default$3)
+ (case $switch-case$1
+ (return
+ (i32.const 1)
)
)
- (tableswitch $label$break$Lout
- (i32.sub
- (get_local $x)
+ (case $switch-case$2
+ (return
(i32.const 2)
)
- (table (case $switch-case$15) (case $switch-default$16) (case $switch-default$16) (case $switch-case$12) (case $switch-default$16) (case $switch-default$16) (case $switch-default$16) (case $switch-default$16) (case $switch-case$9) (case $switch-default$16) (case $switch-case$8)) (case $switch-default$16)
- (case $switch-case$8
- (br $label$break$Lout)
+ )
+ (case $switch-default$3
+ (nop)
+ )
+ )
+ (tableswitch $switch$4
+ (i32.sub
+ (get_local $x)
+ (i32.const 5)
+ )
+ (table (case $switch-case$6) (case $switch-default$7) (case $switch-default$7) (case $switch-default$7) (case $switch-default$7) (case $switch-default$7) (case $switch-default$7) (case $switch-case$5)) (case $switch-default$7)
+ (case $switch-case$5
+ (return
+ (i32.const 121)
)
- (case $switch-case$9
- (br $label$break$Lout)
+ )
+ (case $switch-case$6
+ (return
+ (i32.const 51)
)
- (case $switch-case$12
- (block
- (loop $while-out$10 $while-in$11
- (br $while-out$10)
- (br $while-in$11)
- )
- (br $label$break$Lout)
+ )
+ (case $switch-default$7
+ (nop)
+ )
+ )
+ (tableswitch $label$break$Lout
+ (i32.sub
+ (get_local $x)
+ (i32.const 2)
+ )
+ (table (case $switch-case$15) (case $switch-default$16) (case $switch-default$16) (case $switch-case$12) (case $switch-default$16) (case $switch-default$16) (case $switch-default$16) (case $switch-default$16) (case $switch-case$9) (case $switch-default$16) (case $switch-case$8)) (case $switch-default$16)
+ (case $switch-case$8
+ (br $label$break$Lout)
+ )
+ (case $switch-case$9
+ (br $label$break$Lout)
+ )
+ (case $switch-case$12
+ (block
+ (loop $while-out$10 $while-in$11
+ (br $while-out$10)
+ (br $while-in$11)
)
+ (br $label$break$Lout)
)
- (case $switch-case$15
- (block
- (loop $while-out$13 $while-in$14
- (br $label$break$Lout)
- (br $while-in$14)
- )
+ )
+ (case $switch-case$15
+ (block
+ (loop $while-out$13 $while-in$14
(br $label$break$Lout)
+ (br $while-in$14)
)
+ (br $label$break$Lout)
)
- (case $switch-default$16
- (nop)
- )
)
+ (case $switch-default$16
+ (nop)
+ )
+ )
+ (return
(i32.const 0)
)
)
(func $blocker
)
(func $frem (result f64)
- (call_import $f64-rem
- (f64.const 5.5)
- (f64.const 1.2)
+ (return
+ (call_import $f64-rem
+ (f64.const 5.5)
+ (f64.const 1.2)
+ )
)
)
(func $big_uint_div_u (result i32)
@@ -255,6 +265,9 @@
(i32.const -1)
)
)
+ (return
+ (get_local $x)
+ )
)
(func $fr (param $x f32)
(local $y f32)
@@ -269,7 +282,9 @@
(f32.const 0)
)
(func $negZero (result f64)
- (f64.const -0)
+ (return
+ (f64.const -0)
+ )
)
(func $abs
(local $x i32)
@@ -369,7 +384,9 @@
)
)
)
- (get_local $i)
+ (return
+ (get_local $i)
+ )
)
(func $cneg_nosemicolon
(call_indirect $FUNCSIG$vi