summaryrefslogtreecommitdiff
path: root/test/two_sides.fromasm.imprecise
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-03-20 17:08:52 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-03-20 17:39:21 -0700
commitda80a33ba574ae76e5f560e53b8c0c8ac6edefb2 (patch)
tree76f6fad3135cd8c65de15fd4006308ae53306032 /test/two_sides.fromasm.imprecise
parent2fc279ed7e106a01aa0529ead93dc3f04af8e77c (diff)
downloadbinaryen-da80a33ba574ae76e5f560e53b8c0c8ac6edefb2.tar.gz
binaryen-da80a33ba574ae76e5f560e53b8c0c8ac6edefb2.tar.bz2
binaryen-da80a33ba574ae76e5f560e53b8c0c8ac6edefb2.zip
add option for imprecise asm2wasm opts
Diffstat (limited to 'test/two_sides.fromasm.imprecise')
-rw-r--r--test/two_sides.fromasm.imprecise85
1 files changed, 85 insertions, 0 deletions
diff --git a/test/two_sides.fromasm.imprecise b/test/two_sides.fromasm.imprecise
new file mode 100644
index 000000000..c8fc031a8
--- /dev/null
+++ b/test/two_sides.fromasm.imprecise
@@ -0,0 +1,85 @@
+(module
+ (memory 256 256)
+ (export "memory" memory)
+ (export "_test" $_test)
+ (func $_test (param $i1 i32) (param $i2 i32) (param $i3 i32) (param $i4 i32) (param $i5 i32) (result i32)
+ (local $d6 f64)
+ (if
+ (i32.eq
+ (get_local $i5)
+ (i32.const 0)
+ )
+ (block
+ (set_local $d6
+ (f64.convert_s/i32
+ (i32.mul
+ (get_local $i4)
+ (get_local $i3)
+ )
+ )
+ )
+ (set_local $d6
+ (f64.mul
+ (f64.add
+ (f64.convert_s/i32
+ (get_local $i3)
+ )
+ (get_local $d6)
+ )
+ (f64.add
+ (f64.convert_s/i32
+ (get_local $i4)
+ )
+ (get_local $d6)
+ )
+ )
+ )
+ (set_local $i5
+ (i32.trunc_s/f64
+ (get_local $d6)
+ )
+ )
+ (return
+ (get_local $i5)
+ )
+ )
+ (block
+ (set_local $d6
+ (f64.convert_s/i32
+ (i32.mul
+ (get_local $i2)
+ (get_local $i1)
+ )
+ )
+ )
+ (set_local $d6
+ (f64.mul
+ (f64.add
+ (f64.convert_s/i32
+ (get_local $i3)
+ )
+ (get_local $d6)
+ )
+ (f64.add
+ (get_local $d6)
+ (f64.convert_s/i32
+ (get_local $i4)
+ )
+ )
+ )
+ )
+ (set_local $i5
+ (i32.trunc_s/f64
+ (get_local $d6)
+ )
+ )
+ (return
+ (get_local $i5)
+ )
+ )
+ )
+ (return
+ (i32.const 0)
+ )
+ )
+)