| Index: tests/compiler/dart2js_extra/constant_javascript_semantics3_test.dart
|
| diff --git a/tests/compiler/dart2js_extra/constant_javascript_semantics2_test.dart b/tests/compiler/dart2js_extra/constant_javascript_semantics3_test.dart
|
| similarity index 56%
|
| copy from tests/compiler/dart2js_extra/constant_javascript_semantics2_test.dart
|
| copy to tests/compiler/dart2js_extra/constant_javascript_semantics3_test.dart
|
| index af4872fd2b066b46cfd00062dfb04b78f0bc6771..b21674d2bac51a93a7232318dc4d8ac0177c2202 100644
|
| --- a/tests/compiler/dart2js_extra/constant_javascript_semantics2_test.dart
|
| +++ b/tests/compiler/dart2js_extra/constant_javascript_semantics3_test.dart
|
| @@ -6,16 +6,28 @@
|
| // In this case we test that the value-range analysis uses JavaScript semantics
|
| // too.
|
|
|
| -int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
|
| +int inscrutable(int x) {
|
| + if (x == 0) return 0;
|
| + return x | inscrutable(x & (x - 1));
|
| +}
|
|
|
| foo() {
|
| - var a = const [1, 2];
|
| - var i = 0x100000000;
|
| + var a = const [1, 2, 3, 4];
|
| + var i = 8007199254740992;
|
| if (inscrutable(i) == 0) {
|
| - i = 0x100000001;
|
| + i++;
|
| }
|
| - i = 0xFFFFFFFFF & i; // In JS semantics [:i:] will be truncated to 32 bits.
|
| - i = 0x100000001 - i;
|
| + i += 1000000000000000;
|
| + // [i] is now at its maximum 53 bit value. The following increments will not
|
| + // have any effect.
|
| + i++;
|
| + i++;
|
| + i++;
|
| + i -= 1000000000000000;
|
| + i--;
|
| + i--;
|
| + i--;
|
| + i -= 8007199254740992; // In JS semantics [i] would be -3, now.
|
| return a[i];
|
| }
|
|
|
|
|