v8/test/mjsunit/compiler/regress-5278.js
epertoso 9e14155da9 [turbofan] Fix CheckedInt32Mod lowering.
We now deopt when the lhs of a mod is negative and the rhs is 1 too (previously, we erroneusly returned 0 instead of -0).

BUG=v8:5278
R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2233713002
Cr-Commit-Position: refs/heads/master@{#38525}
2016-08-10 09:24:59 +00:00

14 lines
327 B
JavaScript

// Copyright 2016 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
function foo(a, b) {
return a % b;
}
foo(2, 1);
foo(2, 1);
%OptimizeFunctionOnNextCall(foo);
assertEquals(-0, foo(-2, 1));