| 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 | 10 |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 static_cast<int64_t>(0xffffffff), | 524 static_cast<int64_t>(0xffffffff), |
| 525 static_cast<int64_t>(0xffffffff), | 525 static_cast<int64_t>(0xffffffff), |
| 526 RangeBoundary(0), | 526 RangeBoundary(0), |
| 527 RangeBoundary(static_cast<int64_t>(0xffffffff))); | 527 RangeBoundary(static_cast<int64_t>(0xffffffff))); |
| 528 | 528 |
| 529 // Test that [-20, 20] & [-20, 20] = [Unknown, Unknown]. | 529 // Test that [-20, 20] & [-20, 20] = [Unknown, Unknown]. |
| 530 TEST_RANGE_AND(static_cast<int64_t>(-20), | 530 TEST_RANGE_AND(static_cast<int64_t>(-20), |
| 531 static_cast<int64_t>(20), | 531 static_cast<int64_t>(20), |
| 532 static_cast<int64_t>(-20), | 532 static_cast<int64_t>(-20), |
| 533 static_cast<int64_t>(20), | 533 static_cast<int64_t>(20), |
| 534 RangeBoundary(), | 534 RangeBoundary::MinConstant(RangeBoundary::kRangeBoundaryInt64), |
| 535 RangeBoundary()); | 535 RangeBoundary::MaxConstant( |
| 536 RangeBoundary::kRangeBoundaryInt64)); |
| 536 | 537 |
| 537 #undef TEST_RANGE_AND | 538 #undef TEST_RANGE_AND |
| 538 } | 539 } |
| 539 | 540 |
| 540 | 541 |
| 541 TEST_CASE(RangeIntersectionMinMax) { | 542 TEST_CASE(RangeIntersectionMinMax) { |
| 542 // Test IntersectionMin and IntersectionMax methods which for constants are | 543 // Test IntersectionMin and IntersectionMax methods which for constants are |
| 543 // simply defined as Max/Min respectively. | 544 // simply defined as Max/Min respectively. |
| 544 | 545 |
| 545 // Constants. | 546 // Constants. |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 p_infinity, | 697 p_infinity, |
| 697 size).IsMaximumOrAbove(size)); | 698 size).IsMaximumOrAbove(size)); |
| 698 | 699 |
| 699 EXPECT(RangeBoundary::JoinMax( | 700 EXPECT(RangeBoundary::JoinMax( |
| 700 p_infinity, | 701 p_infinity, |
| 701 RangeBoundary::FromConstant(1), | 702 RangeBoundary::FromConstant(1), |
| 702 size).IsMaximumOrAbove(size)); | 703 size).IsMaximumOrAbove(size)); |
| 703 } | 704 } |
| 704 | 705 |
| 705 } // namespace dart | 706 } // namespace dart |
| OLD | NEW |