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=--optimization_counter_threshold=10 --no-background_compilation | 8 // VMOptions=--optimization_counter_threshold=10 --no-background_compilation |
9 | 9 |
10 library big_integer_test; | 10 library big_integer_test; |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 } on OutOfMemoryError catch (e) { | 414 } on OutOfMemoryError catch (e) { |
415 exceptionCaught = true; | 415 exceptionCaught = true; |
416 } | 416 } |
417 Expect.equals(true, exceptionCaught); | 417 Expect.equals(true, exceptionCaught); |
418 } | 418 } |
419 | 419 |
420 main() { | 420 main() { |
421 for (int i = 0; i < 10; i++) { | 421 for (int i = 0; i < 10; i++) { |
422 Expect.equals(1234567890123456789, foo()); | 422 Expect.equals(1234567890123456789, foo()); |
423 Expect.equals(12345678901234567890, bar()); | 423 Expect.equals(12345678901234567890, bar()); |
424 testSmiOverflow(); /// overflow: ok | 424 testSmiOverflow(); //# overflow: ok |
425 testBigintAdd(); /// add: ok | 425 testBigintAdd(); //# add: ok |
426 testBigintSub(); /// sub: ok | 426 testBigintSub(); //# sub: ok |
427 testBigintMul(); /// mul: ok | 427 testBigintMul(); //# mul: ok |
428 testBigintTruncDiv(); /// trunDiv: ok | 428 testBigintTruncDiv(); //# trunDiv: ok |
429 testBigintDiv(); /// div: ok | 429 testBigintDiv(); //# div: ok |
430 testBigintModulo(); /// mod: ok | 430 testBigintModulo(); //# mod: ok |
431 testBigintModPow(); /// modPow: ok | 431 testBigintModPow(); //# modPow: ok |
432 testBigintModInverse(); /// modInv: ok | 432 testBigintModInverse(); //# modInv: ok |
433 testBigintGcd(); /// gcd: ok | 433 testBigintGcd(); //# gcd: ok |
434 testBigintNegate(); /// negate: ok | 434 testBigintNegate(); //# negate: ok |
435 testShiftAmount(); /// shift: ok | 435 testShiftAmount(); //# shift: ok |
436 Expect.equals(12345678901234567890, (12345678901234567890).abs()); | 436 Expect.equals(12345678901234567890, (12345678901234567890).abs()); |
437 Expect.equals(12345678901234567890, (-12345678901234567890).abs()); | 437 Expect.equals(12345678901234567890, (-12345678901234567890).abs()); |
438 var a = 10000000000000000000; | 438 var a = 10000000000000000000; |
439 var b = 10000000000000000001; | 439 var b = 10000000000000000001; |
440 Expect.equals(false, a.hashCode == b.hashCode); | 440 Expect.equals(false, a.hashCode == b.hashCode); |
441 Expect.equals(true, a.hashCode == (b - 1).hashCode); | 441 Expect.equals(true, a.hashCode == (b - 1).hashCode); |
442 } | 442 } |
443 } | 443 } |
OLD | NEW |