OLD | NEW |
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 // A test to compare the results of the fixnum library with the Dart VM | 5 // A test to compare the results of the fixnum library with the Dart VM |
6 | 6 |
7 #library('int64vmtest'); | 7 library int64vmtest; |
8 #import('dart:math', prefix: 'Math'); | 8 import 'dart:math', prefix: 'Math'; |
9 #source('../intx.dart'); | 9 part '../intx.dart'; |
10 #source('../int32.dart'); | 10 part '../int32.dart'; |
11 #source('../int64.dart'); | 11 part '../int64.dart'; |
12 | 12 |
13 void main() { | 13 void main() { |
14 int64VMTest test = new int64VMTest(); | 14 int64VMTest test = new int64VMTest(); |
15 test.doTestBinary(new BinaryOp("&", (a, b) => a & b)); | 15 test.doTestBinary(new BinaryOp("&", (a, b) => a & b)); |
16 test.doTestBinary(new BinaryOp("|", (a, b) => a | b)); | 16 test.doTestBinary(new BinaryOp("|", (a, b) => a | b)); |
17 test.doTestBinary(new BinaryOp("^", (a, b) => a ^ b)); | 17 test.doTestBinary(new BinaryOp("^", (a, b) => a ^ b)); |
18 test.doTestBinary(new BinaryOp("+", (a, b) => a + b)); | 18 test.doTestBinary(new BinaryOp("+", (a, b) => a + b)); |
19 test.doTestBinary(new BinaryOp("-", (a, b) => a - b)); | 19 test.doTestBinary(new BinaryOp("-", (a, b) => a - b)); |
20 test.doTestBinary(new BinaryOp("*", (a, b) => a * b)); | 20 test.doTestBinary(new BinaryOp("*", (a, b) => a * b)); |
21 test.doTestUnary(new UnaryOp("-", (a) => -a)); | 21 test.doTestUnary(new UnaryOp("-", (a) => -a)); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 } | 317 } |
318 } | 318 } |
319 for (int i = 0; i < RANDOM_TESTS; i++) { | 319 for (int i = 0; i < RANDOM_TESTS; i++) { |
320 int64 randomLong = _randomInt64(); | 320 int64 randomLong = _randomInt64(); |
321 for (int shift = -64; shift <= 64; shift++) { | 321 for (int shift = -64; shift <= 64; shift++) { |
322 _doTestShift(op, randomLong, shift); | 322 _doTestShift(op, randomLong, shift); |
323 } | 323 } |
324 } | 324 } |
325 } | 325 } |
326 } | 326 } |
OLD | NEW |