OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --allow-natives-syntax |
| 6 |
| 7 (function() { |
| 8 function foo(x, y) { return x % y; } |
| 9 |
| 10 assertEquals(0, foo(2, 2)); |
| 11 assertEquals(0, foo(4, 4)); |
| 12 %OptimizeFunctionOnNextCall(foo); |
| 13 assertEquals(-0, foo(-8, 8)); |
| 14 })(); |
| 15 |
| 16 (function() { |
| 17 function foo(x, y) { return x % y; } |
| 18 |
| 19 assertEquals(0, foo(1, 1)); |
| 20 assertEquals(0, foo(2, 2)); |
| 21 %OptimizeFunctionOnNextCall(foo); |
| 22 assertEquals(-0, foo(-3, 3)); |
| 23 })(); |
| 24 |
| 25 (function() { |
| 26 function foo(x, y) { return x % y; } |
| 27 |
| 28 assertEquals(0, foo(1, 1)); |
| 29 assertEquals(0, foo(2, 2)); |
| 30 %OptimizeFunctionOnNextCall(foo); |
| 31 assertEquals(-0, foo(-2147483648, -1)); |
| 32 })(); |
| 33 |
| 34 (function() { |
| 35 function foo(x, y) { return x % y; } |
| 36 |
| 37 assertEquals(0, foo(1, 1)); |
| 38 assertEquals(0, foo(2, 2)); |
| 39 %OptimizeFunctionOnNextCall(foo); |
| 40 assertEquals(-0, foo(-2147483648, -2147483648)); |
| 41 })(); |
OLD | NEW |