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

Unified Diff: runtime/vm/flow_graph_range_analysis_test.cc

Issue 504143003: Support Int32 representation for selected binary operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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
Index: runtime/vm/flow_graph_range_analysis_test.cc
diff --git a/runtime/vm/flow_graph_range_analysis_test.cc b/runtime/vm/flow_graph_range_analysis_test.cc
index 57040d673187555247092cfe82b6fe9c86c43208..781aae24f6cdc916051161255563d6aece93e666 100644
--- a/runtime/vm/flow_graph_range_analysis_test.cc
+++ b/runtime/vm/flow_graph_range_analysis_test.cc
@@ -621,32 +621,41 @@ TEST_CASE(RangeIntersectionMinMax) {
TEST_CASE(RangeJoinMinMax) {
// Test IntersectionMin and IntersectionMax methods which for constants are
// simply defined as Min/Max respectively.
+ const RangeBoundary::RangeSize size = RangeBoundary::kRangeBoundarySmi;
// Constants.
EXPECT(RangeBoundary::JoinMax(
RangeBoundary::FromConstant(0),
- RangeBoundary::FromConstant(1)).ConstantValue() == 1);
+ RangeBoundary::FromConstant(1),
+ size).ConstantValue() == 1);
EXPECT(RangeBoundary::JoinMax(
RangeBoundary::FromConstant(0),
- RangeBoundary::FromConstant(-1)).ConstantValue() == 0);
+ RangeBoundary::FromConstant(-1),
+ size).ConstantValue() == 0);
EXPECT(RangeBoundary::JoinMax(
RangeBoundary::FromConstant(1),
- RangeBoundary::FromConstant(0)).ConstantValue() == 1);
+ RangeBoundary::FromConstant(0),
+ size).ConstantValue() == 1);
EXPECT(RangeBoundary::JoinMax(
RangeBoundary::FromConstant(-1),
- RangeBoundary::FromConstant(0)).ConstantValue() == 0);
+ RangeBoundary::FromConstant(0),
+ size).ConstantValue() == 0);
EXPECT(RangeBoundary::JoinMin(
RangeBoundary::FromConstant(0),
- RangeBoundary::FromConstant(1)).ConstantValue() == 0);
+ RangeBoundary::FromConstant(1),
+ size).ConstantValue() == 0);
EXPECT(RangeBoundary::JoinMin(
RangeBoundary::FromConstant(0),
- RangeBoundary::FromConstant(-1)).ConstantValue() == -1);
+ RangeBoundary::FromConstant(-1),
+ size).ConstantValue() == -1);
EXPECT(RangeBoundary::JoinMin(
RangeBoundary::FromConstant(1),
- RangeBoundary::FromConstant(0)).ConstantValue() == 0);
+ RangeBoundary::FromConstant(0),
+ size).ConstantValue() == 0);
EXPECT(RangeBoundary::JoinMin(
RangeBoundary::FromConstant(-1),
- RangeBoundary::FromConstant(0)).ConstantValue() == -1);
+ RangeBoundary::FromConstant(0),
+ size).ConstantValue() == -1);
RangeBoundary n_infinity = RangeBoundary::NegativeInfinity();
RangeBoundary p_infinity = RangeBoundary::PositiveInfinity();
@@ -654,35 +663,43 @@ TEST_CASE(RangeJoinMinMax) {
// Constants vs. infinity.
EXPECT(RangeBoundary::JoinMin(
n_infinity,
- RangeBoundary::FromConstant(-1)).IsSmiMinimumOrBelow());
+ RangeBoundary::FromConstant(-1),
+ size).IsMinimumOrBelow(size));
EXPECT(RangeBoundary::JoinMin(
RangeBoundary::FromConstant(-1),
- n_infinity).IsSmiMinimumOrBelow());
+ n_infinity,
+ size).IsMinimumOrBelow(size));
EXPECT(RangeBoundary::JoinMin(
RangeBoundary::FromConstant(1),
- n_infinity).IsSmiMinimumOrBelow());
+ n_infinity,
+ size).IsMinimumOrBelow(size));
EXPECT(RangeBoundary::JoinMin(
n_infinity,
- RangeBoundary::FromConstant(1)).IsSmiMinimumOrBelow());
+ RangeBoundary::FromConstant(1),
+ size).IsMinimumOrBelow(size));
EXPECT(RangeBoundary::JoinMax(
p_infinity,
- RangeBoundary::FromConstant(-1)).IsSmiMaximumOrAbove());
+ RangeBoundary::FromConstant(-1),
+ size).IsMaximumOrAbove(size));
EXPECT(RangeBoundary::JoinMax(
RangeBoundary::FromConstant(-1),
- p_infinity).IsSmiMaximumOrAbove());
+ p_infinity,
+ size).IsMaximumOrAbove(size));
EXPECT(RangeBoundary::JoinMax(
RangeBoundary::FromConstant(1),
- p_infinity).IsSmiMaximumOrAbove());
+ p_infinity,
+ size).IsMaximumOrAbove(size));
EXPECT(RangeBoundary::JoinMax(
p_infinity,
- RangeBoundary::FromConstant(1)).IsSmiMaximumOrAbove());
+ RangeBoundary::FromConstant(1),
+ size).IsMaximumOrAbove(size));
}
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698