v8/test/mjsunit/compiler/shift-shr.js
jkummerow@chromium.org b6f82c734c Remove FLAG_opt_safe_uint32_operations.
It has been turned on by default for a long time, and hydrogenized BinaryOpStubs actually depend on it being turned on.

BUG=v8:3487
LOG=n
R=ishell@chromium.org

Review URL: https://codereview.chromium.org/630023002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24415 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-06 13:15:23 +00:00

27 lines
612 B
JavaScript

// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
// Check the results of `left >>> right`. The result is always unsigned (and
// therefore positive).
function test_shr(left) {
var errors = 0;
for (var i = 1; i < 1024; i++) {
var temp = left >>> i;
if (temp < 0) {
errors++;
}
}
return errors;
}
assertEquals(0, test_shr(1));
%OptimizeFunctionOnNextCall(test_shr);
for (var i = 5; i >= -5; i--) {
assertEquals(0, test_shr(i));
}