Index: test/mjsunit/compiler/osr-nested.js |
diff --git a/test/mjsunit/regress/regress-2499.js b/test/mjsunit/compiler/osr-nested.js |
similarity index 84% |
copy from test/mjsunit/regress/regress-2499.js |
copy to test/mjsunit/compiler/osr-nested.js |
index 52aad874db6fcdc89f5ee1ae4db45304e64b0e77..4bdb0828ca2272332701c579bcbf9952cf43e6a4 100644 |
--- a/test/mjsunit/regress/regress-2499.js |
+++ b/test/mjsunit/compiler/osr-nested.js |
@@ -25,16 +25,22 @@ |
// (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 |
-function foo(word, nBits) { |
- return (word[1] >>> nBits) | (word[0] << (32 - nBits)); |
+function f() { |
+ var sum = 0; |
+ for (var i = 0; i < 10; i++) { |
+ for (var j = 0; j < 100000; j++) { |
+ var x = i + 2; |
+ var y = x + 5; |
+ var z = y + 3; |
+ sum += z; |
+ } |
+ } |
+ return sum; |
} |
-word = [0x1001, 0]; |
-var expected = foo(word, 1); |
-foo(word, 1); |
-%OptimizeFunctionOnNextCall(foo); |
-var optimized = foo(word, 1); |
-assertEquals(expected, optimized) |
+assertEquals(14500000, f()); |
+assertEquals(14500000, f()); |
+assertEquals(14500000, f()); |