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

Unified Diff: runtime/vm/intermediate_language_test.cc

Issue 81623003: Use range information to omit checks in TRUNCDIV/MOD operations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_test.cc
===================================================================
--- runtime/vm/intermediate_language_test.cc (revision 30671)
+++ runtime/vm/intermediate_language_test.cc (working copy)
@@ -39,4 +39,24 @@
EXPECT(!c3->Equals(c1));
}
+
+TEST_CASE(RangeTests) {
+ Range* zero = new Range(
+ RangeBoundary::FromConstant(0),
+ RangeBoundary::FromConstant(0));
+ Range* positive = new Range(
+ RangeBoundary::FromConstant(0),
+ RangeBoundary::FromConstant(100));
+ Range* negative = new Range(
+ RangeBoundary::FromConstant(-1),
+ RangeBoundary::FromConstant(-100));
+ Range* range_x = new Range(
+ RangeBoundary::FromConstant(-15),
+ RangeBoundary::FromConstant(100));
+ EXPECT(zero->Overlaps(0, 0));
+ EXPECT(positive->Overlaps(0, 0));
+ EXPECT(!negative->Overlaps(0, 0));
+ EXPECT(range_x->Overlaps(0, 0));
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698