Index: test/mjsunit/regress/regress-2489.js |
diff --git a/test/mjsunit/regress/regress-sqrt.js b/test/mjsunit/regress/regress-2489.js |
similarity index 83% |
copy from test/mjsunit/regress/regress-sqrt.js |
copy to test/mjsunit/regress/regress-2489.js |
index f2a7e55242cbcdfb281f8e05c465000c98b5a8bc..882c4f794a88e24d1d64e86a466b27c39f51e625 100644 |
--- a/test/mjsunit/regress/regress-sqrt.js |
+++ b/test/mjsunit/regress/regress-2489.js |
@@ -1,4 +1,4 @@ |
-// Copyright 2012 the V8 project authors. All rights reserved. |
+// Copyright 2013 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -27,21 +27,24 @@ |
// Flags: --allow-natives-syntax |
-// Check that Math.sqrt returns the same value regardless of being |
-// optimized or not. |
+"use strict"; |
-function f(x) { |
- return Math.sqrt(x); |
+function f(a, b) { |
+ return g("c", "d"); |
} |
-var x = 7.0506280066499245e-233; |
+function g(a, b) { |
+ g.constructor.apply(this, arguments); |
+} |
-var a = f(x); |
+g.constructor = function(a, b) { |
+ assertEquals("c", a); |
+ assertEquals("d", b); |
+} |
-f(0.1); |
-f(0.2); |
+f("a", "b"); |
+f("a", "b"); |
%OptimizeFunctionOnNextCall(f); |
- |
-var b = f(x); |
- |
-assertEquals(a, b); |
+f("a", "b"); |
+g.x = "deopt"; |
+f("a", "b"); |