Index: test/mjsunit/compiler/shift-shr.js |
diff --git a/test/mjsunit/compiler/shift-shr.js b/test/mjsunit/compiler/shift-shr.js |
index 52cd370e427161d1bce33431647245c12300ad25..c52ad43ac5115e58dfdc2e637da369584cd67f58 100644 |
--- a/test/mjsunit/compiler/shift-shr.js |
+++ b/test/mjsunit/compiler/shift-shr.js |
@@ -24,3 +24,32 @@ assertEquals(0, test_shr(1)); |
for (var i = 5; i >= -5; i--) { |
assertEquals(0, test_shr(i)); |
} |
+ |
+ |
+(function () { |
+ function foo(x, b, array) { |
+ var y; |
+ x = x >>> 0; |
+ b ? (y = x | 0) : (y = x); |
+ return array[y]; |
+ } |
+ |
+ foo(111, true, new Array(42)); |
+ foo(111, true, new Array(42)); |
+ %OptimizeFunctionOnNextCall(foo); |
+ foo(-111, true, new Array(42)); |
+})(); |
+ |
+(function () { |
+ function foo(x, b, array) { |
+ var y; |
+ x = x >>> 0; |
+ b ? (y = x | 0) : (y = x); |
+ return array[y]; |
+ } |
+ |
+ foo(111, true, new Array(42)); |
+ foo(111, true, new Array(42)); |
+ %OptimizeFunctionOnNextCall(foo); |
+ foo(111, true, new Array(42)); |
+})(); |