Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(747)

Unified Diff: tests/language/bit_shift_test.dart

Issue 2988803002: Adjust some tests for limited 64-bit integers (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/corelib_strong/hash_set_test.dart ('k') | tests/language/list_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/bit_shift_test.dart
diff --git a/tests/language/bit_shift_test.dart b/tests/language/bit_shift_test.dart
index e797ea3131b8ea8e37b5b2125014567183d9946a..1ec143bd0b711ffc5bf3c06b662f64107a610442 100644
--- a/tests/language/bit_shift_test.dart
+++ b/tests/language/bit_shift_test.dart
@@ -5,11 +5,16 @@
import "package:expect/expect.dart";
+// Note: in --limit-ints-to-64-bits mode all integers are 64-bit already.
+// Still, it is harmless to apply _uint64Mask because (1 << 64) is 0 (all bits
+// are shifted out), so _uint64Mask is -1 (its bit pattern is 0xffffffffffffffff).
+const _uint64Mask = (1 << 64) - 1;
+
constants() {
Expect.equals(0, 499 >> 33);
Expect.equals(0, (499 << 33) & 0xFFFFFFFF);
Expect.equals(0, (499 << 32) >> 65);
- Expect.equals(0, ((499 << 32) << 65) & 0xFFFFFFFFFFFFFFFF);
+ Expect.equals(0, ((499 << 32) << 65) & _uint64Mask);
}
foo(i) {
@@ -33,7 +38,7 @@ interceptors() {
Expect.equals(0, id(499) >> 33);
Expect.equals(0, (id(499) << 33) & 0xFFFFFFFF);
Expect.equals(0, id(499 << 32) >> 65);
- Expect.equals(0, (id(499 << 32) << 65) & 0xFFFFFFFFFFFFFFFF);
+ Expect.equals(0, (id(499 << 32) << 65) & _uint64Mask);
}
speculative() {
@@ -43,7 +48,7 @@ speculative() {
Expect.equals(0, a >> 33);
Expect.equals(0, (a << 33) & 0xFFFFFFFF);
Expect.equals(0, b >> 65);
- Expect.equals(0, (b << 65) & 0xFFFFFFFFFFFFFFFF);
+ Expect.equals(0, (b << 65) & _uint64Mask);
}
}
« no previous file with comments | « tests/corelib_strong/hash_set_test.dart ('k') | tests/language/list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698