summaryrefslogtreecommitdiff
path: root/test/unit.fromasm.imprecise.no-opts
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit.fromasm.imprecise.no-opts')
-rw-r--r--test/unit.fromasm.imprecise.no-opts584
1 files changed, 414 insertions, 170 deletions
diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts
index 7037a6c1c..c41075df0 100644
--- a/test/unit.fromasm.imprecise.no-opts
+++ b/test/unit.fromasm.imprecise.no-opts
@@ -1,16 +1,27 @@
(module
(memory 256 256)
- (export "memory" memory)
(type $FUNCSIG$ddd (func (param f64 f64) (result f64)))
(type $FUNCSIG$vf (func (param f32)))
(type $FUNCSIG$vi (func (param i32)))
- (type $FUNCSIG$vd (func (param f64)))
- (import $abort "env" "abort" (param f64))
- (import $print "env" "print" (param i32))
- (import $h "env" "h" (param i32))
- (import $f64-rem "asm2wasm" "f64-rem" (param f64 f64) (result f64))
- (export "big_negative" $big_negative)
- (export "pick" $exportMe)
+ (type $FUNCSIG$ii (func (param i32) (result i32)))
+ (type $FUNCSIG$dd (func (param f64) (result f64)))
+ (import "global" "NaN" (global $t f64))
+ (import "global" "Infinity" (global $u f64))
+ (import "env" "tempDoublePtr" (global $tempDoublePtr i32))
+ (import "env" "gb" (global $n i32))
+ (import "env" "setTempRet0" (func $setTempRet0 (param i32) (result i32)))
+ (import "env" "abort" (func $abort (param f64) (result f64)))
+ (import "env" "print" (func $print (param i32)))
+ (import "env" "h" (func $h (param i32)))
+ (import "asm2wasm" "f64-rem" (func $f64-rem (param f64 f64) (result f64)))
+ (import "env" "memory" (memory $memory))
+ (import "env" "table" (table $table))
+ (import "env" "memoryBase" (global $memoryBase i32))
+ (import "env" "tableBase" (global $tableBase i32))
+ (export "big_negative" (func $big_negative))
+ (export "pick" (func $exportMe))
+ (global $Int i32 (i32.const 0))
+ (global $Double f64 (f64.const 0))
(table 10 10 anyfunc)
(elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg)
(func $big_negative
@@ -37,31 +48,21 @@
(f64.add
(f64.add
(f64.add
- (f64.load
- (i32.const 8)
- )
- (f64.load
- (i32.const 16)
- )
+ (get_global $t)
+ (get_global $u)
)
(f64.neg
- (f64.load
- (i32.const 16)
- )
+ (get_global $u)
)
)
(f64.neg
- (f64.load
- (i32.const 8)
- )
+ (get_global $t)
)
)
)
(if
(i32.gt_s
- (i32.load
- (i32.const 24)
- )
+ (get_global $Int)
(i32.const 0)
)
(return
@@ -70,9 +71,7 @@
)
(if
(f64.gt
- (f64.load
- (i32.const 32)
- )
+ (get_global $Double)
(f64.const 0)
)
(return
@@ -177,11 +176,15 @@
(set_local $J
(f64.sub
(block
- (f64.const 0.1)
+ (drop
+ (f64.const 0.1)
+ )
(f64.const 5.1)
)
(block
- (f64.const 3.2)
+ (drop
+ (f64.const 3.2)
+ )
(f64.const 4.2)
)
)
@@ -247,63 +250,71 @@
(br $label$break$Lout)
)
(block
- (loop $while-out$10 $while-in$11
- (br $while-out$10)
- (br $while-in$11)
+ (loop $while-in$11
+ (block $while-out$10
+ (br $while-out$10)
+ (br $while-in$11)
+ )
)
(br $label$break$Lout)
)
)
(block
- (loop $while-out$13 $while-in$14
- (br $label$break$Lout)
- (br $while-in$14)
+ (loop $while-in$14
+ (block $while-out$13
+ (br $label$break$Lout)
+ (br $while-in$14)
+ )
)
(br $label$break$Lout)
)
)
)
- (loop $label$break$L1 $label$continue$L1
- (loop $label$break$L3 $label$continue$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)
+ (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
+ (br $label$break$L1)
+ (br $switch$17)
+ )
+ )
+ (block
+ (set_local $waka
+ (i32.const 1)
)
+ (br $switch$17)
)
)
(block
- (br $label$break$L1)
+ (br $label$break$L3)
(br $switch$17)
)
)
- (block
- (set_local $waka
- (i32.const 1)
- )
- (br $switch$17)
- )
- )
- (block
- (br $label$break$L3)
- (br $switch$17)
+ (br $label$break$L1)
)
)
- (br $label$break$L1)
+ (br $label$continue$L3)
)
)
- (br $label$continue$L3)
- )
- (call_import $h
- (i32.const 120)
+ (call_import $h
+ (i32.const 120)
+ )
+ (br $label$continue$L1)
)
- (br $label$continue$L1)
)
(return
(i32.const 0)
@@ -340,14 +351,26 @@
(func $fr (param $x f32)
(local $y f32)
(local $z f64)
- (f32.demote/f64
- (get_local $z)
+ (drop
+ (f32.demote/f64
+ (get_local $z)
+ )
+ )
+ (drop
+ (get_local $y)
+ )
+ (drop
+ (f32.const 5)
+ )
+ (drop
+ (f32.const 0)
+ )
+ (drop
+ (f32.const 5)
+ )
+ (drop
+ (f32.const 0)
)
- (get_local $y)
- (f32.const 5)
- (f32.const 0)
- (f32.const 5)
- (f32.const 0)
)
(func $negZero (result f64)
(return
@@ -396,6 +419,7 @@
)
)
(call_indirect $FUNCSIG$vf
+ (get_local $x)
(i32.add
(i32.and
(i32.const 1)
@@ -403,11 +427,11 @@
)
(i32.const 8)
)
- (get_local $x)
)
)
(func $cneg (param $x f32)
(call_indirect $FUNCSIG$vf
+ (get_local $x)
(i32.add
(i32.and
(i32.const 1)
@@ -415,14 +439,15 @@
)
(i32.const 8)
)
- (get_local $x)
)
)
(func $___syscall_ret
(local $$0 i32)
- (i32.gt_u
- (get_local $$0)
- (i32.const -4096)
+ (drop
+ (i32.gt_u
+ (get_local $$0)
+ (i32.const -4096)
+ )
)
)
(func $smallCompare (result i32)
@@ -458,6 +483,7 @@
)
(func $cneg_nosemicolon
(call_indirect $FUNCSIG$vi
+ (i32.const 1)
(i32.add
(i32.and
(i32.const 1)
@@ -465,7 +491,6 @@
)
(i32.const 8)
)
- (i32.const 1)
)
)
(func $forLoop
@@ -473,26 +498,28 @@
(set_local $i
(i32.const 1)
)
- (loop $for-out$0 $for-in$1
- (if
- (i32.eqz
- (i32.lt_s
- (get_local $i)
- (i32.const 200)
+ (loop $for-in$1
+ (block $for-out$0
+ (if
+ (i32.eqz
+ (i32.lt_s
+ (get_local $i)
+ (i32.const 200)
+ )
)
+ (br $for-out$0)
)
- (br $for-out$0)
- )
- (call_import $h
- (get_local $i)
- )
- (set_local $i
- (i32.add
+ (call_import $h
(get_local $i)
- (i32.const 1)
)
+ (set_local $i
+ (i32.add
+ (get_local $i)
+ (i32.const 1)
+ )
+ )
+ (br $for-in$1)
)
- (br $for-in$1)
)
)
(func $ceiling_32_64 (param $u f32) (param $B f64)
@@ -516,99 +543,141 @@
)
)
(func $aborts
- (call_import $abort
- (f64.const 0)
+ (drop
+ (call_import $abort
+ (f64.const 0)
+ )
)
- (call_import $abort
- (f64.convert_s/i32
- (i32.const 55)
+ (drop
+ (call_import $abort
+ (f64.convert_s/i32
+ (i32.const 55)
+ )
)
)
- (call_import $abort
- (f64.const 0)
+ (drop
+ (call_import $abort
+ (f64.const 0)
+ )
)
- (call_import $abort
- (f64.const 12.34)
+ (drop
+ (call_import $abort
+ (f64.const 12.34)
+ )
)
- (call_import $abort
- (f64.promote/f32
- (f32.const 56.779998779296875)
+ (drop
+ (call_import $abort
+ (f64.promote/f32
+ (f32.const 56.779998779296875)
+ )
)
)
)
(func $continues
- (loop $while-out$0 $while-in$1
- (call_import $print
- (i32.const 1)
- )
- (loop $do-once$2 $unlikely-continue$3
+ (loop $while-in$1
+ (block $while-out$0
(call_import $print
- (i32.const 5)
+ (i32.const 1)
)
- (if
- (i32.const 0)
- (br $unlikely-continue$3)
+ (block $do-once$2
+ (loop $unlikely-continue$3
+ (call_import $print
+ (i32.const 5)
+ )
+ (if
+ (i32.const 0)
+ (br $unlikely-continue$3)
+ )
+ )
)
+ (call_import $print
+ (i32.const 2)
+ )
+ (br $while-in$1)
)
- (call_import $print
- (i32.const 2)
- )
- (br $while-in$1)
)
)
(func $bitcasts (param $i i32) (param $f f32)
(local $d f64)
- (f32.reinterpret/i32
- (get_local $i)
- )
- (f64.promote/f32
+ (drop
(f32.reinterpret/i32
(get_local $i)
)
)
- (i32.reinterpret/f32
- (get_local $f)
+ (drop
+ (f64.promote/f32
+ (f32.reinterpret/i32
+ (get_local $i)
+ )
+ )
)
- (i32.reinterpret/f32
- (f32.demote/f64
- (get_local $d)
+ (drop
+ (i32.reinterpret/f32
+ (get_local $f)
+ )
+ )
+ (drop
+ (i32.reinterpret/f32
+ (f32.demote/f64
+ (get_local $d)
+ )
)
)
)
(func $recursiveBlockMerging (param $x i32) (result i32)
- (call $lb
- (i32.add
+ (drop
+ (call $lb
(i32.add
(i32.add
- (block
- (i32.const 1)
- (get_local $x)
- )
- (block
- (i32.const 2)
- (i32.const 3)
+ (i32.add
+ (block
+ (drop
+ (i32.const 1)
+ )
+ (get_local $x)
+ )
+ (block
+ (drop
+ (i32.const 2)
+ )
+ (i32.const 3)
+ )
)
- )
- (block
(block
(block
- (i32.const 4)
- (i32.const 5)
+ (block
+ (drop
+ (i32.const 4)
+ )
+ (drop
+ (i32.const 5)
+ )
+ )
+ (drop
+ (i32.const 6)
+ )
)
- (i32.const 6)
+ (i32.const 7)
)
- (i32.const 7)
)
- )
- (block
- (i32.const 8)
(block
- (i32.const 9)
+ (drop
+ (i32.const 8)
+ )
(block
- (i32.const 10)
+ (drop
+ (i32.const 9)
+ )
(block
- (i32.const 11)
- (i32.const 12)
+ (drop
+ (i32.const 10)
+ )
+ (block
+ (drop
+ (i32.const 11)
+ )
+ (i32.const 12)
+ )
)
)
)
@@ -620,14 +689,18 @@
(i32.add
(i32.add
(block
- (call $lb
- (i32.const 1)
+ (drop
+ (call $lb
+ (i32.const 1)
+ )
)
(get_local $x)
)
(block
- (call $lb
- (i32.const 2)
+ (drop
+ (call $lb
+ (i32.const 2)
+ )
)
(call $lb
(i32.const 3)
@@ -637,15 +710,21 @@
(block
(block
(block
- (call $lb
- (i32.const 4)
+ (drop
+ (call $lb
+ (i32.const 4)
+ )
)
- (call $lb
- (i32.const 5)
+ (drop
+ (call $lb
+ (i32.const 5)
+ )
)
)
- (call $lb
- (i32.const 6)
+ (drop
+ (call $lb
+ (i32.const 6)
+ )
)
)
(call $lb
@@ -654,20 +733,28 @@
)
)
(block
- (call $lb
- (i32.const 8)
+ (drop
+ (call $lb
+ (i32.const 8)
+ )
)
(block
- (call $lb
- (i32.const 9)
+ (drop
+ (call $lb
+ (i32.const 9)
+ )
)
(block
- (call $lb
- (i32.const 10)
+ (drop
+ (call $lb
+ (i32.const 10)
+ )
)
(block
- (call $lb
- (i32.const 11)
+ (drop
+ (call $lb
+ (i32.const 11)
+ )
)
(call $lb
(i32.const 12)
@@ -687,9 +774,7 @@
(get_local $a)
(i32.add
(i32.add
- (i32.load
- (i32.const 48)
- )
+ (get_global $n)
(i32.const 136)
)
(i32.const 8)
@@ -700,10 +785,14 @@
)
)
(func $forgetMe
- (f64.const 123.456)
+ (drop
+ (f64.const 123.456)
+ )
)
(func $exportMe
- (f64.const -3.14159)
+ (drop
+ (f64.const -3.14159)
+ )
)
(func $zeroInit (param $x i32)
(local $y i32)
@@ -757,6 +846,161 @@
(get_local $x)
)
)
+ (func $smallIf
+ (block $do-once$0
+ (drop
+ (if
+ (i32.const 2)
+ (call $lb
+ (i32.const 3)
+ )
+ (br $do-once$0)
+ )
+ )
+ (nop)
+ )
+ )
+ (func $dropCall (result i32)
+ (if
+ (i32.const 0)
+ (block
+ (drop
+ (call $phi)
+ )
+ (drop
+ (call_import $setTempRet0
+ (i32.const 10)
+ )
+ )
+ (call $zeroInit
+ (call_import $setTempRet0
+ (i32.const 10)
+ )
+ )
+ )
+ )
+ (return
+ (call $phi)
+ )
+ )
+ (func $useSetGlobal (result i32)
+ (local $x i32)
+ (set_local $x
+ (block
+ (set_global $Int
+ (i32.const 10)
+ )
+ (get_global $Int)
+ )
+ )
+ (set_global $Int
+ (i32.const 20)
+ )
+ (return
+ (block
+ (set_global $Int
+ (i32.const 30)
+ )
+ (get_global $Int)
+ )
+ )
+ )
+ (func $usesSetGlobal2 (result i32)
+ (return
+ (block
+ (block
+ (set_global $Int
+ (i32.const 40)
+ )
+ (drop
+ (get_global $Int)
+ )
+ )
+ (i32.const 50)
+ )
+ )
+ )
+ (func $breakThroughMany (param $$s i32)
+ (block $label$break$L1
+ (drop
+ (if
+ (get_local $$s)
+ (loop $while-in$2
+ (block $while-out$1
+ (if
+ (i32.eqz
+ (get_local $$s)
+ )
+ (br $label$break$L1)
+ )
+ (call $zeroInit
+ (i32.const 0)
+ )
+ (br $while-in$2)
+ )
+ )
+ (i32.const 1337)
+ )
+ )
+ (nop)
+ )
+ )
+ (func $ifChainEmpty (param $label i32) (result i32)
+ (if
+ (i32.eq
+ (get_local $label)
+ (i32.const 4)
+ )
+ (return
+ (i32.const 0)
+ )
+ (if
+ (i32.eq
+ (get_local $label)
+ (i32.const 7)
+ )
+ (nop)
+ )
+ )
+ (return
+ (i32.const 0)
+ )
+ )
+ (func $heap8NoShift (param $x i32) (result i32)
+ (return
+ (i32.load8_s
+ (get_local $x)
+ )
+ )
+ )
+ (func $conditionalTypeFun
+ (local $x i32)
+ (local $y f64)
+ (set_local $x
+ (if
+ (i32.const 1)
+ (i32.trunc_s/f64
+ (call_import $abort
+ (f64.convert_s/i32
+ (i32.const 5)
+ )
+ )
+ )
+ (i32.const 2)
+ )
+ )
+ (set_local $y
+ (if
+ (i32.const 3)
+ (call_import $abort
+ (f64.convert_s/i32
+ (i32.const 7)
+ )
+ )
+ (f64.const 4.5)
+ )
+ )
+ )
(func $z
(nop)
)