Index: test/mjsunit/regress/regress-2618.js |
diff --git a/test/mjsunit/regress/regress-2451.js b/test/mjsunit/regress/regress-2618.js |
similarity index 68% |
copy from test/mjsunit/regress/regress-2451.js |
copy to test/mjsunit/regress/regress-2618.js |
index 465e4e68c26f3e3e119cbaf82d50c8f83c6efa9a..638b71e6228b9f5c5fcfffeafcb0d72e606faf9b 100644 |
--- a/test/mjsunit/regress/regress-2451.js |
+++ b/test/mjsunit/regress/regress-2618.js |
@@ -25,17 +25,50 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
+// Flags: --use-osr --allow-natives-syntax |
function f() { |
- assertEquals(-1.0, Math.round(-1.5)); |
- assertEquals(-2.0, Math.round(-2.5)); |
- assertEquals(-1.0, Math.round(-0.5000000000000001)); |
+ do { |
+ do { |
+ for (i = 0; i < 10000000; i++) { |
+ // This should run long enough to trigger OSR. |
+ } |
+ } while (false); |
+ } while (false); |
} |
f(); |
-f(); |
-%OptimizeFunctionOnNextCall(f); |
-f(); |
assertTrue(%GetOptimizationStatus(f) != 2); |
+ |
+function g() { |
+ for (var i = 0; i < 1; i++) { } |
+ |
+ do { |
+ do { |
+ for (i = 0; i < 1; i++) { } |
+ } while (false); |
+ } while (false); |
+ |
+ do { |
+ do { |
+ do { |
+ do { |
+ do { |
+ do { |
+ do { |
+ do { |
+ for (i = 0; i < 10000000; i++) { } |
+ } while (false); |
+ } while (false); |
+ } while (false); |
+ } while (false); |
+ } while (false); |
+ } while (false); |
+ } while (false); |
+ } while (false); |
+} |
+ |
+g(); |
+assertTrue(%GetOptimizationStatus(g) != 2); |
+ |