Index: test/mjsunit/math-abs.js |
diff --git a/test/mjsunit/math-abs.js b/test/mjsunit/math-abs.js |
index 2b079546ea449cd0e0cec490b2f8d6338e41e176..d6ee3f2da7853f071559cbb32911dcde3a81f506 100644 |
--- a/test/mjsunit/math-abs.js |
+++ b/test/mjsunit/math-abs.js |
@@ -109,3 +109,14 @@ for(var i = 0; i < 1000; i++) { |
assertEquals(42, foo(-42)); |
%OptimizeFunctionOnNextCall(foo) |
assertEquals(42, foo(-42)); |
+ |
+// Regression test for SMI input of Math.abs on X64, see: |
+// https://codereview.chromium.org/21180004/ |
+var a = [-1, -2]; |
+function foo2() { |
+ return Math.abs(a[0]); |
+} |
+assertEquals(1, foo2()); |
+assertEquals(1, foo2()); |
+%OptimizeFunctionOnNextCall(foo2); |
+assertEquals(1, foo2()); |