summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-11-18 13:48:38 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-11-18 13:48:38 -0800
commit98c318e18c6fc43e851429a2a5e43bac16ae1ee1 (patch)
treefc52a0dee5f7e454f5b1d0640ba64552b2907b35 /test
parent913114cd027722b8576c83f2bb334701c0b9a518 (diff)
downloadbinaryen-98c318e18c6fc43e851429a2a5e43bac16ae1ee1.tar.gz
binaryen-98c318e18c6fc43e851429a2a5e43bac16ae1ee1.tar.bz2
binaryen-98c318e18c6fc43e851429a2a5e43bac16ae1ee1.zip
handle negative zero properly in asm2wasm
Diffstat (limited to 'test')
-rw-r--r--test/unit.asm.js3
-rw-r--r--test/unit.wast7
2 files changed, 7 insertions, 3 deletions
diff --git a/test/unit.asm.js b/test/unit.asm.js
index 5695c3059..7575dfead 100644
--- a/test/unit.asm.js
+++ b/test/unit.asm.js
@@ -75,6 +75,9 @@ function () {
Math_fround(5.0);
Math_fround(0.0);
}
+ function negZero() {
+ return +-0;
+ }
function z() {
}
diff --git a/test/unit.wast b/test/unit.wast
index 24692ba1c..1f1027556 100644
--- a/test/unit.wast
+++ b/test/unit.wast
@@ -8,9 +8,7 @@
(local $temp f64)
(block
(set_local $temp
- (f64.convert_s/i32
- (i32.const -2147483648)
- )
+ (f64.const -2147483648)
)
(set_local $temp
(f64.const -2147483648)
@@ -247,6 +245,9 @@
(f32.const 0)
)
)
+ (func $negZero (result f64)
+ (f64.const -0)
+ )
(func $z
(nop)
)