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

Unified Diff: tests/language/positive_bit_operations_test.dart

Issue 10332291: Negative numbers should not be >>> shifted. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test. Created 8 years, 7 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
Index: tests/language/positive_bit_operations_test.dart
diff --git a/tests/language/positive_bit_operations_test.dart b/tests/language/positive_bit_operations_test.dart
index 86af1a1586a4d76f9fe94a43619bd0e57f6e956d..36936f7730ae7e03603aa6e7699c2d38d1e7e72a 100644
--- a/tests/language/positive_bit_operations_test.dart
+++ b/tests/language/positive_bit_operations_test.dart
@@ -18,6 +18,7 @@ constants() {
Expect.equals(0x80000000, 1 << 31);
Expect.equals(0xFFFFFFF0, 0xFFFFFFF << 4);
Expect.equals(0x7FFFFFFF, 0xFFFFFFFF >> 1);
+ Expect.equals(0xFFFF0000, (-1 >> 16) & 0xFFFF0000);
Expect.equals(0xFFFFFFFC,
((((((0xFFFFFFF << 4) // 0xFFFFFFF0
>> 1) // 0x7FFFFFF8
@@ -60,6 +61,7 @@ interceptors() {
Expect.equals(0x80000000, id(1) << id(31));
Expect.equals(0xFFFFFFF0, id(0xFFFFFFF) << id(4));
Expect.equals(0x7FFFFFFF, id(0xFFFFFFFF) >> id(1));
+ Expect.equals(0xFFFF0000, (id(-1) >> 16) & 0xFFFF0000);
Expect.equals(0xFFFFFFFC,
((((((id(0xFFFFFFF) << 4) // 0xFFFFFFF0
>> 1) // 0x7FFFFFF8
@@ -82,6 +84,7 @@ speculative() {
var k = id(31);
var l = id(4);
var m = id(0xFFFFFFF);
+ var n = id(-1);
for (int i = 0; i < 1; i++) {
Expect.equals(0x80000000, a | b);
Expect.equals(0x80000001, a | c);
@@ -98,6 +101,7 @@ speculative() {
Expect.equals(0x80000000, c << k);
Expect.equals(0xFFFFFFF0, m << l);
Expect.equals(0x7FFFFFFF, f >> c);
+ Expect.equals(0xFFFF0000, (n >> 16) & 0xFFFF0000);
Expect.equals(0xFFFFFFFC,
((((((m << 4) // 0xFFFFFFF0
>> 1) // 0x7FFFFFF8

Powered by Google App Engine
This is Rietveld 408576698