Index: test/mjsunit/math-round.js |
diff --git a/test/mjsunit/math-round.js b/test/mjsunit/math-round.js |
index bf590692073ebc62f6f4a34d9bc098316d7e9026..12a92657a1becac6f7049fe04dc01fef6b0580d6 100644 |
--- a/test/mjsunit/math-round.js |
+++ b/test/mjsunit/math-round.js |
@@ -38,6 +38,16 @@ function testRound(expect, input) { |
assertEquals(expect, doRound(input)); |
%OptimizeFunctionOnNextCall(doRound); |
assertEquals(expect, doRound(input)); |
+ |
+ // Force the Math.round() representation to double to exercise the associated |
+ // optimized code. |
+ var doRoundToDouble = new Function('input', |
+ '"' + (test_id++) + '";return Math.round(input) + -0.0'); |
+ assertEquals(expect, doRoundToDouble(input)); |
+ assertEquals(expect, doRoundToDouble(input)); |
+ assertEquals(expect, doRoundToDouble(input)); |
+ %OptimizeFunctionOnNextCall(doRoundToDouble); |
+ assertEquals(expect, doRoundToDouble(input)); |
} |
testRound(0, 0); |