diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-10-30 17:32:28 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-10-30 17:32:28 -0700 |
commit | 4a99322972bd744cd97825f6373f1eee3b3d35b1 (patch) | |
tree | 15f625e59e75f360cbc5831d66dc3cf6fd5a3543 /test/unit.asm.js | |
parent | b8b69e896b18efbe553bf1c01e4eb3acbfb909f1 (diff) | |
download | binaryen-4a99322972bd744cd97825f6373f1eee3b3d35b1.tar.gz binaryen-4a99322972bd744cd97825f6373f1eee3b3d35b1.tar.bz2 binaryen-4a99322972bd744cd97825f6373f1eee3b3d35b1.zip |
handle aliasing local and global
Diffstat (limited to 'test/unit.asm.js')
-rw-r--r-- | test/unit.asm.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/unit.asm.js b/test/unit.asm.js index db14f721b..987374fe2 100644 --- a/test/unit.asm.js +++ b/test/unit.asm.js @@ -2,6 +2,8 @@ function () { "use asm"; var t = global.NaN, u = global.Infinity; + var Int = 0; + var Double = 0.0; function big_negative() { var temp = 0.0; @@ -14,11 +16,18 @@ function () { function importedDoubles() { var temp = 0.0; temp = t + u + (-u) + (-t); + if (Int > 0) return -3.4; + if (Double > 0.0) return 5.6; + return 1.2; } function doubleCompares(x, y) { x = +x; y = +y; - if (x > 0.0) return 0.0; + var t = +0; + var Int = 0.0, Double = 0; // confusing with globals + if (x > 0.0) return 1.2; + if (Int > 0.0) return -3.4; + if (Double > 0) return 5.6; if (x < y) return +x; return +y; } |