Files
sdk/tests/language_2/number/web_int_literals_runtime_test.dart
T
Robert Nystrom fc1b1ecc71 Move files under language_2 into subdirectories.
Change-Id: Idbcc965a27e9ffeedf5e0a1068b019de4193070f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127745
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-12-11 19:18:00 +00:00

70 lines
1.2 KiB
Dart

// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import "package:expect/expect.dart";
main() {
check(0x8000000000000000);
check(0x7FFF00001111F000);
check(0x7FFF00001111FC00);
check(0xFFFF00001111F000);
check(0xFFFF00001111F800);
// Test all runs of 53 and 54 bits.
check(0x000FFFFFFFFFFFFF);
check(0x001FFFFFFFFFFFFF);
check(0x003FFFFFFFFFFFFE);
check(0x007FFFFFFFFFFFFC);
check(0x00FFFFFFFFFFFFF8);
check(0x01FFFFFFFFFFFFF0);
check(0x03FFFFFFFFFFFFE0);
check(0x07FFFFFFFFFFFFC0);
check(0x0FFFFFFFFFFFFF80);
check(0x1FFFFFFFFFFFFF00);
check(0x3FFFFFFFFFFFFE00);
check(0x7FFFFFFFFFFFFC00);
check(0xFFFFFFFFFFFFF800);
// Too big, even on VM.
// 9223372036854775808 - 512 is rounded.
// 9223372036854775808 - 1024 is exact.
check(9223372036854774784);
check(-9223372036854775808);
check(-9223372036854774784);
}
check(int n) {}