OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/flow_graph_range_analysis.h" | 5 #include "vm/flow_graph_range_analysis.h" |
6 #include "vm/unit_test.h" | 6 #include "vm/unit_test.h" |
7 | 7 |
8 namespace dart { | 8 namespace dart { |
9 | 9 |
10 TEST_CASE(RangeTests) { | 10 TEST_CASE(RangeTests) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 RangeBoundary::NegativeInfinity(), | 73 RangeBoundary::NegativeInfinity(), |
74 RangeBoundary::PositiveInfinity()); | 74 RangeBoundary::PositiveInfinity()); |
75 TEST_RANGE_OP(Range::Shl, -1, 1, 63, 63, | 75 TEST_RANGE_OP(Range::Shl, -1, 1, 63, 63, |
76 RangeBoundary(kMinInt64), | 76 RangeBoundary(kMinInt64), |
77 RangeBoundary::PositiveInfinity()); | 77 RangeBoundary::PositiveInfinity()); |
78 if (kBitsPerWord == 64) { | 78 if (kBitsPerWord == 64) { |
79 TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 62, 62, | 79 TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 62, 62, |
80 RangeBoundary(kSmiMin), | 80 RangeBoundary(kSmiMin), |
81 RangeBoundary(kSmiMax)); | 81 RangeBoundary(kSmiMax)); |
82 TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 30, 30, | 82 TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 30, 30, |
83 RangeBoundary(-1 << 30), | 83 RangeBoundary(-(1 << 30)), |
84 RangeBoundary(1 << 30)); | 84 RangeBoundary(1 << 30)); |
85 } else { | 85 } else { |
86 TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 30, 30, | 86 TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 30, 30, |
87 RangeBoundary(kSmiMin), | 87 RangeBoundary(kSmiMin), |
88 RangeBoundary(kSmiMax)); | 88 RangeBoundary(kSmiMax)); |
89 TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 62, 62, | 89 TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 62, 62, |
90 RangeBoundary(kSmiMin), | 90 RangeBoundary(kSmiMin), |
91 RangeBoundary(kSmiMax)); | 91 RangeBoundary(kSmiMax)); |
92 } | 92 } |
93 TEST_RANGE_OP(Range::Shl, 0, 100, 0, 64, | 93 TEST_RANGE_OP(Range::Shl, 0, 100, 0, 64, |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 p_infinity, | 699 p_infinity, |
700 size).IsMaximumOrAbove(size)); | 700 size).IsMaximumOrAbove(size)); |
701 | 701 |
702 EXPECT(RangeBoundary::JoinMax( | 702 EXPECT(RangeBoundary::JoinMax( |
703 p_infinity, | 703 p_infinity, |
704 RangeBoundary::FromConstant(1), | 704 RangeBoundary::FromConstant(1), |
705 size).IsMaximumOrAbove(size)); | 705 size).IsMaximumOrAbove(size)); |
706 } | 706 } |
707 | 707 |
708 } // namespace dart | 708 } // namespace dart |
OLD | NEW |