summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-10-30 16:47:22 -0700
committerAlon Zakai <alonzakai@gmail.com>2015-10-30 16:47:22 -0700
commitdce3791b402cc1e49da000cfe918bb21e81b4a6a (patch)
tree97a1171eadff048c5831eac9a40dfaf013ee115c /test
parent9b799d7164478bf0c1463ed8ac804f65704000df (diff)
downloadbinaryen-dce3791b402cc1e49da000cfe918bb21e81b4a6a.tar.gz
binaryen-dce3791b402cc1e49da000cfe918bb21e81b4a6a.tar.bz2
binaryen-dce3791b402cc1e49da000cfe918bb21e81b4a6a.zip
fix double compares
Diffstat (limited to 'test')
-rw-r--r--test/unit.asm.js6
-rw-r--r--test/unit.wast16
2 files changed, 22 insertions, 0 deletions
diff --git a/test/unit.asm.js b/test/unit.asm.js
index 80bab6242..2b599d99a 100644
--- a/test/unit.asm.js
+++ b/test/unit.asm.js
@@ -15,6 +15,12 @@ function () {
var temp = 0.0;
temp = t + u + (-u) + (-t);
}
+ function doubleCompares(x, y) {
+ x = +x;
+ y = +y;
+ if (x < y) return +x;
+ return +y;
+ }
function z() {
}
diff --git a/test/unit.wast b/test/unit.wast
index 2c16af17d..9e4b19eb4 100644
--- a/test/unit.wast
+++ b/test/unit.wast
@@ -51,6 +51,22 @@
)
)
)
+ (func $doubleCompares (param $x f64) (param $y f64) (result f64)
+ (block $topmost
+ (if
+ (f64.lt
+ (get_local $x)
+ (get_local $y)
+ )
+ (break $topmost
+ (get_local $x)
+ )
+ )
+ (break $topmost
+ (get_local $y)
+ )
+ )
+ )
(func $z
(nop)
)