| OLD | NEW |
| 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 | 4 |
| 5 import "package:expect/expect.dart"; | |
| 6 | |
| 7 // On frogsh constant folded hex literals of large magnitude were truncated on | 5 // On frogsh constant folded hex literals of large magnitude were truncated on |
| 8 // constant folding - Issue 636 is 'fixed', remaining concerns at Issue 638. | 6 // constant folding - Issue 636 is 'fixed', remaining concerns at Issue 638. |
| 9 | 7 |
| 10 | 8 |
| 11 highDigitTruncationTest() { | 9 highDigitTruncationTest() { |
| 12 Expect.equals(0x12345678A, 0x123456789 + 1); | 10 Expect.equals(0x12345678A, 0x123456789 + 1); |
| 13 | 11 |
| 14 // in 32 bits this is 0xF0000000 which is negative. | 12 // in 32 bits this is 0xF0000000 which is negative. |
| 15 Expect.isTrue(0x1f0000000 > 0); | 13 Expect.isTrue(0x1f0000000 > 0); |
| 16 | 14 |
| 17 Expect.equals(0xf0, 0xf * 16); | 15 Expect.equals(0xf0, 0xf * 16); |
| 18 Expect.equals(0xff0, 0xff * 16); | 16 Expect.equals(0xff0, 0xff * 16); |
| 19 Expect.equals(0xfff0, 0xfff * 16); | 17 Expect.equals(0xfff0, 0xfff * 16); |
| 20 Expect.equals(0xffff0, 0xffff * 16); | 18 Expect.equals(0xffff0, 0xffff * 16); |
| 21 Expect.equals(0xfffff0, 0xfffff * 16); | 19 Expect.equals(0xfffff0, 0xfffff * 16); |
| 22 Expect.equals(0xffffff0, 0xffffff * 16); | 20 Expect.equals(0xffffff0, 0xffffff * 16); |
| 23 Expect.equals(0xfffffff0, 0xfffffff * 16); | 21 Expect.equals(0xfffffff0, 0xfffffff * 16); |
| 24 Expect.equals(0xffffffff0, 0xffffffff * 16); | 22 Expect.equals(0xffffffff0, 0xffffffff * 16); |
| 25 Expect.equals(0xfffffffff0, 0xfffffffff * 16); | 23 Expect.equals(0xfffffffff0, 0xfffffffff * 16); |
| 26 Expect.equals(0xffffffffff0, 0xffffffffff * 16); | 24 Expect.equals(0xffffffffff0, 0xffffffffff * 16); |
| 27 } | 25 } |
| 28 | 26 |
| 29 | 27 |
| 30 main() { | 28 main() { |
| 31 highDigitTruncationTest(); | 29 highDigitTruncationTest(); |
| 32 } | 30 } |
| OLD | NEW |