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

Unified Diff: tests/standalone/javascript_int_overflow_test.dart

Issue 21876005: Fixes obo error in javascript int checking. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/javascript_int_overflow_literal_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/javascript_int_overflow_test.dart
===================================================================
--- tests/standalone/javascript_int_overflow_test.dart (revision 25732)
+++ tests/standalone/javascript_int_overflow_test.dart (working copy)
@@ -29,12 +29,12 @@
int max_add_throws() {
- return 0x1FFFFFFFFFFFFF + 1;
+ return 0x20000000000000 + 1;
}
int min_sub_throws() {
- return -0x1FFFFFFFFFFFFF - 1;
+ return -0x20000000000000 - 1;
}
@@ -45,12 +45,12 @@
int max_literal() {
- return 0x1FFFFFFFFFFFFF;
+ return 0x20000000000000;
}
int min_literal() {
- var min_literal = -0x1FFFFFFFFFFFFF;
+ var min_literal = -0x20000000000000;
return min_literal;
}
@@ -60,21 +60,21 @@
e is Error && "$e".startsWith("Javascript Integer Overflow:");
main() {
- Expect.equals(0x1FFFFFFFFFFFFF, max_literal());
- Expect.equals(-0x1FFFFFFFFFFFFF, min_literal());
+ Expect.equals(0x20000000000000, max_literal());
+ Expect.equals(-0x20000000000000, min_literal());
// Run the tests once before optimizations.
- dti_arg = 1.9e16;
+ dti_arg = 1.9e17;
Expect.throws(double_to_int, isJavascriptIntError);
- ia_arg1 = (1 << 52);
- ia_arg2 = (1 << 52);
+ ia_arg1 = (1 << 53);
+ ia_arg2 = (1 << 53);
Expect.throws(integer_add, isJavascriptIntError);
- n_arg = -0x1FFFFFFFFFFFFF;
- Expect.equals(0x1FFFFFFFFFFFFF, negate());
+ n_arg = -0x20000000000000;
+ Expect.equals(0x20000000000000, negate());
- is_arg = (1 << 52);
+ is_arg = (1 << 53);
Expect.throws(integer_shift, isJavascriptIntError);
Expect.throws(max_add_throws, isJavascriptIntError);
@@ -101,17 +101,17 @@
}
// The optimized functions should now deoptimize and throw the error.
- dti_arg = 1.9e16;
+ dti_arg = 1.9e17;
Expect.throws(double_to_int, isJavascriptIntError);
- ia_arg1 = (1 << 52);
- ia_arg2 = (1 << 52);
+ ia_arg1 = (1 << 53);
+ ia_arg2 = (1 << 53);
Expect.throws(integer_add, isJavascriptIntError);
- n_arg = -0x1FFFFFFFFFFFFF;
- Expect.equals(0x1FFFFFFFFFFFFF, negate());
+ n_arg = -0x20000000000000;
+ Expect.equals(0x20000000000000, negate());
- is_arg = (1 << 52);
+ is_arg = (1 << 53);
Expect.throws(integer_shift, isJavascriptIntError);
Expect.throws(max_add_throws, isJavascriptIntError);
« no previous file with comments | « tests/standalone/javascript_int_overflow_literal_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698