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

Side by Side Diff: tests/language/positive_bit_operations_test.dart

Issue 10378047: Fix bad precedence for >>> operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 constants() { 5 constants() {
6 Expect.equals(0x80000000, 0x80000000 | 0); 6 Expect.equals(0x80000000, 0x80000000 | 0);
7 Expect.equals(0x80000001, 0x80000000 | 1); 7 Expect.equals(0x80000001, 0x80000000 | 1);
8 Expect.equals(0x80000000, 0x80000000 | 0x80000000); 8 Expect.equals(0x80000000, 0x80000000 | 0x80000000);
9 Expect.equals(0xFFFFFFFF, 0xFFFF0000 | 0xFFFF); 9 Expect.equals(0xFFFFFFFF, 0xFFFF0000 | 0xFFFF);
10 Expect.equals(0x80000000, 0x80000000 & 0xFFFFFFFF); 10 Expect.equals(0x80000000, 0x80000000 & 0xFFFFFFFF);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 Expect.equals(0xFFFFFFFC, 101 Expect.equals(0xFFFFFFFC,
102 ((((((m << 4) // 0xFFFFFFF0 102 ((((((m << 4) // 0xFFFFFFF0
103 >> 1) // 0x7FFFFFF8 103 >> 1) // 0x7FFFFFF8
104 | 0x80000000) // 0xFFFFFFF8 104 | 0x80000000) // 0xFFFFFFF8
105 >> 2) // 0x3FFFFFFE 105 >> 2) // 0x3FFFFFFE
106 ^ 0x40000000) // 0x7FFFFFFE 106 ^ 0x40000000) // 0x7FFFFFFE
107 << 1)); 107 << 1));
108 } 108 }
109 } 109 }
110 110
111 // Due to bad precedence rules this example was broken in Dart2Js.
112 precedence() {
113 Expect.equals(0x80000000, -1 & 0x80000000);
114 Expect.equals(0x80000000, id(-1) & 0x80000000);
115 Expect.equals(0x80000000, ~(~(0x80000000)));
116 Expect.equals(0x80000000, ~(~(id(0x80000000))));
117 }
118
111 main() { 119 main() {
112 constants(); 120 constants();
113 interceptors(); 121 interceptors();
114 speculative(); 122 speculative();
123 precedence();
115 } 124 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698