| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Testing Bigints with and without intrinsics. | 5 // Testing Bigints with and without intrinsics. |
| 6 // VMOptions= | 6 // VMOptions= |
| 7 // VMOptions=--no_intrinsify | 7 // VMOptions=--no_intrinsify |
| 8 // VMOptions=--no-background-compilation | 8 // VMOptions=--no-background-compilation |
| 9 // VMOptions=--optimization_counter_threshold=10 --no-background_compilation | 9 // VMOptions=--optimization_counter_threshold=10 --no-background_compilation |
| 10 | 10 |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } on OutOfMemoryError catch (e) { | 415 } on OutOfMemoryError catch (e) { |
| 416 exceptionCaught = true; | 416 exceptionCaught = true; |
| 417 } | 417 } |
| 418 Expect.equals(true, exceptionCaught); | 418 Expect.equals(true, exceptionCaught); |
| 419 } | 419 } |
| 420 | 420 |
| 421 main() { | 421 main() { |
| 422 for (int i = 0; i < 10; i++) { | 422 for (int i = 0; i < 10; i++) { |
| 423 Expect.equals(1234567890123456789, foo()); | 423 Expect.equals(1234567890123456789, foo()); |
| 424 Expect.equals(12345678901234567890, bar()); | 424 Expect.equals(12345678901234567890, bar()); |
| 425 testSmiOverflow(); /// overflow: ok | 425 testSmiOverflow(); //# overflow: ok |
| 426 testBigintAdd(); /// add: ok | 426 testBigintAdd(); //# add: ok |
| 427 testBigintSub(); /// sub: ok | 427 testBigintSub(); //# sub: ok |
| 428 testBigintMul(); /// mul: ok | 428 testBigintMul(); //# mul: ok |
| 429 testBigintTruncDiv(); /// trunDiv: ok | 429 testBigintTruncDiv(); //# trunDiv: ok |
| 430 testBigintDiv(); /// div: ok | 430 testBigintDiv(); //# div: ok |
| 431 testBigintModulo(); /// mod: ok | 431 testBigintModulo(); //# mod: ok |
| 432 testBigintModPow(); /// modPow: ok | 432 testBigintModPow(); //# modPow: ok |
| 433 testBigintModInverse(); /// modInv: ok | 433 testBigintModInverse(); //# modInv: ok |
| 434 testBigintGcd(); /// gcd: ok | 434 testBigintGcd(); //# gcd: ok |
| 435 testBigintNegate(); /// negate: ok | 435 testBigintNegate(); //# negate: ok |
| 436 testShiftAmount(); /// shift: ok | 436 testShiftAmount(); //# shift: ok |
| 437 Expect.equals(12345678901234567890, (12345678901234567890).abs()); | 437 Expect.equals(12345678901234567890, (12345678901234567890).abs()); |
| 438 Expect.equals(12345678901234567890, (-12345678901234567890).abs()); | 438 Expect.equals(12345678901234567890, (-12345678901234567890).abs()); |
| 439 var a = 10000000000000000000; | 439 var a = 10000000000000000000; |
| 440 var b = 10000000000000000001; | 440 var b = 10000000000000000001; |
| 441 Expect.equals(false, a.hashCode == b.hashCode); | 441 Expect.equals(false, a.hashCode == b.hashCode); |
| 442 Expect.equals(true, a.hashCode == (b - 1).hashCode); | 442 Expect.equals(true, a.hashCode == (b - 1).hashCode); |
| 443 } | 443 } |
| 444 } | 444 } |
| OLD | NEW |