Index: test/mjsunit/lithium/StoreKeyed.js |
diff --git a/test/mjsunit/lithium/DivI.js b/test/mjsunit/lithium/StoreKeyed.js |
similarity index 75% |
copy from test/mjsunit/lithium/DivI.js |
copy to test/mjsunit/lithium/StoreKeyed.js |
index 5420d8c8d0ab0adc715683fd95f41a34e9373fc0..d34f390d25e3d04f7f3e8202e4076da945f660d9 100644 |
--- a/test/mjsunit/lithium/DivI.js |
+++ b/test/mjsunit/lithium/StoreKeyed.js |
@@ -27,31 +27,35 @@ |
// Flags: --allow-natives-syntax --no-use-osr |
-function foo(a, b) { |
- var result = a / 35; |
- result += 50 / b; |
- result += a / b; |
- result += a / -1; |
- result += a / 1; |
- result += a / 4; |
- result += a / -4; |
- return result / b; |
+function foo(a, i, v) { |
+ a[0] = v; |
+ a[i] = v; |
} |
-foo(700, 5); |
-var r1 = foo(700, 5); |
-%OptimizeFunctionOnNextCall(foo); |
-var r2 = foo(700, 5); |
+function foo_int(a, i, v) { |
+ a[0] = v; |
+ a[i] = v; |
+} |
-assertEquals(r1, r2); |
+var A1 = [1.2, 2.3]; |
+var A2 = [1.2, 2.3]; |
+var A3 = [1.2, 2.3]; |
-function boo(value) { |
- return value / -1; |
-} |
+var A1_int = [12, 23]; |
+var A2_int = [12, 23]; |
+var A3_int = [12, 23]; |
+ |
+foo(A1, 1, 3.4); |
+foo(A2, 1, 3.4); |
+%OptimizeFunctionOnNextCall(foo); |
+foo(A3, 1, 3.4); |
+ |
+foo_int(A1_int, 1, 34); |
+foo_int(A2_int, 1, 34); |
+%OptimizeFunctionOnNextCall(foo_int); |
+foo_int(A3_int, 1, 34); |
-// Test deoptimization of MinInt / -1. |
-assertEquals(2147483600, boo(-2147483600)); |
-assertEquals(2147483600, boo(-2147483600)); |
-%OptimizeFunctionOnNextCall(boo); |
-assertEquals(2147483600, boo(-2147483600)); |
-assertEquals(2147483648, boo(-2147483648)); |
+assertEquals(A1[0], A3[0]); |
+assertEquals(A1[1], A3[1]); |
+assertEquals(A1_int[0], A3_int[0]); |
+assertEquals(A1_int[1], A3_int[1]); |