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

Side by Side Diff: tests/language/src/BitOperationsTest.dart

Issue 8972002: Use deopt on some instructions that have not collected type feedback when optimizing compierl kic... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
OLDNEW
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 // Dart test for testing bitwise operations. 4 // Dart test for testing bitwise operations.
5 5
6 class BitOperationsTest { 6 class BitOperationsTest {
7 static testMain() { 7 static testMain() {
8 for (int i = 0; i < 4; i++) {
9 testOne();
10 }
11 }
12 static testOne() {
8 Expect.equals(3, (3 & 7)); 13 Expect.equals(3, (3 & 7));
9 Expect.equals(7, (3 | 7)); 14 Expect.equals(7, (3 | 7));
10 Expect.equals(4, (3 ^ 7)); 15 Expect.equals(4, (3 ^ 7));
11 Expect.equals(25, (100 >> 2)); 16 Expect.equals(25, (100 >> 2));
12 Expect.equals(400, (100 << 2)); 17 Expect.equals(400, (100 << 2));
13 Expect.equals(-25, (-100 >> 2)); 18 Expect.equals(-25, (-100 >> 2));
14 Expect.equals(-101, ~100); 19 Expect.equals(-101, ~100);
15 Expect.equals(0x10000000000000000, 1 << 64); 20 Expect.equals(0x10000000000000000, 1 << 64);
regis 2011/12/15 22:18:43 How about Expect.equals(0x40000000, 0x04000000 <<
srdjan 2011/12/15 22:27:16 Added (though my CL does not affect left shift ope
16 Expect.equals(-0x10000000000000000, -1 << 64); 21 Expect.equals(-0x10000000000000000, -1 << 64);
17 Expect.equals(0, ~-1); 22 Expect.equals(0, ~-1);
18 Expect.equals(-1, ~0); 23 Expect.equals(-1, ~0);
19 24
20 Expect.equals(0, 1 >> 160); 25 Expect.equals(0, 1 >> 160);
21 Expect.equals(-1, -1 >> 160); 26 Expect.equals(-1, -1 >> 160);
22 27
23 Expect.equals(0x100000000000000001, 28 Expect.equals(0x100000000000000001,
24 0x100000000000000001 & 0x100000100F00000001); 29 0x100000000000000001 & 0x100000100F00000001);
25 Expect.equals(0x1, 0x1 & 0x100000100F00000001); 30 Expect.equals(0x1, 0x1 & 0x100000100F00000001);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 88 }
84 } 89 }
85 90
86 static int ShiftLeft(int a, int b) { return a << b; } 91 static int ShiftLeft(int a, int b) { return a << b; }
87 static int ShiftRight(int a, int b) { return a >> b; } 92 static int ShiftRight(int a, int b) { return a >> b; }
88 } 93 }
89 94
90 main() { 95 main() {
91 BitOperationsTest.testMain(); 96 BitOperationsTest.testMain();
92 } 97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698