Index: test/mjsunit/compiler/osr-warm.js |
diff --git a/test/mjsunit/compiler/osr-with-args.js b/test/mjsunit/compiler/osr-warm.js |
similarity index 86% |
copy from test/mjsunit/compiler/osr-with-args.js |
copy to test/mjsunit/compiler/osr-warm.js |
index 44fa1cb2cf9d0a1fcf3689b03fc01cc4e9f4eafc..65ada1e114856109ab2261d0bc670bf59daa983c 100644 |
--- a/test/mjsunit/compiler/osr-with-args.js |
+++ b/test/mjsunit/compiler/osr-warm.js |
@@ -27,18 +27,24 @@ |
// Flags: --use-osr |
-function f() { |
- var sum = 0; |
- for (var i = 0; i < 1000000; i++) { |
- var t = arguments[0] + 2; |
- var x = arguments[1] + 2; |
- var y = t + x + 5; |
- var z = y + 3; |
- sum += z; |
+function f1(x) { |
+ while (x > 0) { |
+ x--; |
} |
- return sum; |
+ return x; |
} |
-for (var i = 0; i < 4; i++) { |
- assertEquals(17000000, f(2, 3)); |
+assertEquals(0, f1(1)); |
+assertEquals(0, f1(10000000)); |
+ |
+function f2(x) { |
+ var sum = 1; |
+ while (x > 0) { |
+ x--; |
+ sum++; |
+ } |
+ return sum; |
} |
+ |
+assertEquals(2, f2(1)); |
+assertEquals(10000001, f2(10000000)); |