summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/regress/regress-351624.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/regress/regress-351624.js')
-rw-r--r--deps/v8/test/mjsunit/regress/regress-351624.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/regress/regress-351624.js b/deps/v8/test/mjsunit/regress/regress-351624.js
new file mode 100644
index 0000000000..fc3715b65a
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-351624.js
@@ -0,0 +1,23 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+var big = 1e10;
+var backup = new Float64Array(1);
+
+function mult0(val){
+ var prod = val * big;
+ backup[0] = prod;
+ var rounded = Math.round(prod);
+ assertEquals(prod, backup[0]);
+ return rounded;
+}
+
+var count = 5;
+for (var i = 0; i < count; i++) {
+ if (i == count - 1) %OptimizeFunctionOnNextCall(mult0);
+ var result = mult0(-1);
+ assertEquals(result, -big);
+}