From 4a99322972bd744cd97825f6373f1eee3b3d35b1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 30 Oct 2015 17:32:28 -0700 Subject: handle aliasing local and global --- test/unit.asm.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test/unit.asm.js') 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; } -- cgit v1.2.3