diff --git a/tests/language/language_dart2wasm.status b/tests/language/language_dart2wasm.status index 3dea3134ce5..404aaa56661 100644 --- a/tests/language/language_dart2wasm.status +++ b/tests/language/language_dart2wasm.status @@ -4,6 +4,7 @@ # Sections in this file should contain "$compiler == dart2wasm". [ $compiler == dart2wasm ] +number/web_int_literals_test: SkipByDesign # WASM has real integers. vm/*: SkipByDesign # Tests for the VM. [ $compiler == dart2wasm && $runtime == d8 ] diff --git a/tests/language/language_kernel.status b/tests/language/language_kernel.status index 5f7d53c9e8a..d3517f5709d 100644 --- a/tests/language/language_kernel.status +++ b/tests/language/language_kernel.status @@ -4,17 +4,12 @@ [ $compiler == app_jitk ] main/no_main_test/01: Crash -number/web_int_literals_test/*: SkipByDesign # Test applies only to JavaScript targets unsorted/disassemble_test: SkipByDesign # Tested in JIT mode. vm/regress_27671_test: SkipByDesign # Relies on string comparison of exception message which may return '' [ $compiler == dartkp ] -number/web_int_literals_test/*: SkipByDesign # Test applies only to JavaScript targets unsorted/disassemble_test: SkipByDesign # JIT only test -[ $compiler == fasta ] -number/web_int_literals_test/*: SkipByDesign # Test applies only to JavaScript targets - [ $arch == ia32 && $mode == debug ] *: Pass, Slow # The CFE is not run from AppJit snapshot, JIT warmup in debug mode very slow @@ -56,7 +51,6 @@ mixin/illegal_superclass_test: Skip # Issues 24478 and 23773 unsorted/disassemble_test: Slow, Crash # dartbug.com/34971 vm/closure_memory_retention_test: Skip # KernelVM bug: Hits OOM vm/regress_29145_test: Skip # Issue 29145 -web_int_literals_test/*: SkipByDesign # Test applies only to JavaScript targets [ $compiler == dartk && $hot_reload_rollback ] symbol/conflict_test: Slow, Pass diff --git a/tests/language/number/web_int_literals_runtime_test.dart b/tests/language/number/web_int_literals_runtime_test.dart deleted file mode 100644 index dfbcf567862..00000000000 --- a/tests/language/number/web_int_literals_runtime_test.dart +++ /dev/null @@ -1,69 +0,0 @@ -// TODO(multitest): This was automatically migrated from a multitest and may -// contain strange or dead code. - -// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import "package:expect/expect.dart"; - -main() { - check(0x8000000000000000); - - check(0x7FFF00001111F000); - check(0x7FFF00001111FC00); - - - - - check(0xFFFF00001111F000); - check(0xFFFF00001111F800); - - - - - - // Test all runs of 53 and 54 bits. - check(0x000FFFFFFFFFFFFF); - check(0x001FFFFFFFFFFFFF); - - check(0x003FFFFFFFFFFFFE); - - check(0x007FFFFFFFFFFFFC); - - check(0x00FFFFFFFFFFFFF8); - - check(0x01FFFFFFFFFFFFF0); - - check(0x03FFFFFFFFFFFFE0); - - check(0x07FFFFFFFFFFFFC0); - - check(0x0FFFFFFFFFFFFF80); - - check(0x1FFFFFFFFFFFFF00); - - check(0x3FFFFFFFFFFFFE00); - - check(0x7FFFFFFFFFFFFC00); - - check(0xFFFFFFFFFFFFF800); - - // Too big, even on VM. - - - - // 9223372036854775808 - 512 is rounded. - - // 9223372036854775808 - 1024 is exact. - check(9223372036854774784); - - check(-9223372036854775808); - - - check(-9223372036854774784); - - -} - -check(int n) {} diff --git a/tests/language/number/web_int_literals_test.dart b/tests/language/number/web_int_literals_test.dart index 094b739f9b6..ce23f5e9b79 100644 --- a/tests/language/number/web_int_literals_test.dart +++ b/tests/language/number/web_int_literals_test.dart @@ -2,7 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import "package:expect/expect.dart"; +// Integer literals that lose precision when represented as a JavaScript double +// are compile errors in the web compilers. main() { check(0x8000000000000000); @@ -10,40 +11,76 @@ main() { check(0x7FFF00001111F000); check(0x7FFF00001111FC00); check(0x7FFF00001111FE00); + // ^ + // [web] The integer literal 0x7FFF00001111FE00 can't be represented exactly in JavaScript. check(0x7FFF00001111FF00); + // ^ + // [web] The integer literal 0x7FFF00001111FF00 can't be represented exactly in JavaScript. check(0x7FFF00001111FFFF); + // ^ + // [web] The integer literal 0x7FFF00001111FFFF can't be represented exactly in JavaScript. check(0xFFFF00001111F000); check(0xFFFF00001111F800); check(0xFFFF00001111FC00); + // ^ + // [web] The integer literal 0xFFFF00001111FC00 can't be represented exactly in JavaScript. check(0xFFFF00001111FE00); + // ^ + // [web] The integer literal 0xFFFF00001111FE00 can't be represented exactly in JavaScript. check(0xFFFF00001111FF00); + // ^ + // [web] The integer literal 0xFFFF00001111FF00 can't be represented exactly in JavaScript. check(0xFFFF00001111FFFF); + // ^ + // [web] The integer literal 0xFFFF00001111FFFF can't be represented exactly in JavaScript. // Test all runs of 53 and 54 bits. check(0x000FFFFFFFFFFFFF); check(0x001FFFFFFFFFFFFF); check(0x003FFFFFFFFFFFFF); + // ^ + // [web] The integer literal 0x003FFFFFFFFFFFFF can't be represented exactly in JavaScript. check(0x003FFFFFFFFFFFFE); check(0x007FFFFFFFFFFFFE); + // ^ + // [web] The integer literal 0x007FFFFFFFFFFFFE can't be represented exactly in JavaScript. check(0x007FFFFFFFFFFFFC); check(0x00FFFFFFFFFFFFFC); + // ^ + // [web] The integer literal 0x00FFFFFFFFFFFFFC can't be represented exactly in JavaScript. check(0x00FFFFFFFFFFFFF8); check(0x01FFFFFFFFFFFFF8); + // ^ + // [web] The integer literal 0x01FFFFFFFFFFFFF8 can't be represented exactly in JavaScript. check(0x01FFFFFFFFFFFFF0); check(0x03FFFFFFFFFFFFF0); + // ^ + // [web] The integer literal 0x03FFFFFFFFFFFFF0 can't be represented exactly in JavaScript. check(0x03FFFFFFFFFFFFE0); check(0x07FFFFFFFFFFFFE0); + // ^ + // [web] The integer literal 0x07FFFFFFFFFFFFE0 can't be represented exactly in JavaScript. check(0x07FFFFFFFFFFFFC0); check(0x0FFFFFFFFFFFFFC0); + // ^ + // [web] The integer literal 0x0FFFFFFFFFFFFFC0 can't be represented exactly in JavaScript. check(0x0FFFFFFFFFFFFF80); check(0x1FFFFFFFFFFFFF80); + // ^ + // [web] The integer literal 0x1FFFFFFFFFFFFF80 can't be represented exactly in JavaScript. check(0x1FFFFFFFFFFFFF00); check(0x3FFFFFFFFFFFFF00); + // ^ + // [web] The integer literal 0x3FFFFFFFFFFFFF00 can't be represented exactly in JavaScript. check(0x3FFFFFFFFFFFFE00); check(0x7FFFFFFFFFFFFE00); + // ^ + // [web] The integer literal 0x7FFFFFFFFFFFFE00 can't be represented exactly in JavaScript. check(0x7FFFFFFFFFFFFC00); check(0xFFFFFFFFFFFFFC00); + // ^ + // [web] The integer literal 0xFFFFFFFFFFFFFC00 can't be represented exactly in JavaScript. check(0xFFFFFFFFFFFFF800); // Too big, even on VM. @@ -51,19 +88,34 @@ main() { // ^^^^^^^^^^^^^^^^^^^ // [analyzer] COMPILE_TIME_ERROR.INTEGER_LITERAL_OUT_OF_RANGE // [cfe] The integer literal 9223372036854775808 can't be represented in 64 bits. + // [web] The integer literal 9223372036854775808 can't be represented in 64 bits. check(9223372036854775807); + // ^ + // [web] The integer literal 9223372036854775807 can't be represented exactly in JavaScript. check(9223372036854775806); + // ^ + // [web] The integer literal 9223372036854775806 can't be represented exactly in JavaScript. + // 9223372036854775808 - 512 is rounded. check(9223372036854775296); + // ^ + // [web] The integer literal 9223372036854775296 can't be represented exactly in JavaScript. + // 9223372036854775808 - 1024 is exact. check(9223372036854774784); check(-9223372036854775808); check(-9223372036854775807); + // ^ + // [web] The integer literal 9223372036854775807 can't be represented exactly in JavaScript. check(-9223372036854775296); + // ^ + // [web] The integer literal 9223372036854775296 can't be represented exactly in JavaScript. check(-9223372036854774784); check(1000000000000000001); + // ^ + // [web] The integer literal 1000000000000000001 can't be represented exactly in JavaScript. } check(int n) {}