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

Side by Side Diff: runtime/vm/flow_graph_range_analysis_test.cc

Issue 1678203002: Remove more feature in product mode (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
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
11 TEST_CASE(RangeTests) { 10 TEST_CASE(RangeTests) {
12 Range* zero = new Range( 11 Range* zero = new Range(
13 RangeBoundary::FromConstant(0), 12 RangeBoundary::FromConstant(0),
14 RangeBoundary::FromConstant(0)); 13 RangeBoundary::FromConstant(0));
15 Range* positive = new Range( 14 Range* positive = new Range(
16 RangeBoundary::FromConstant(0), 15 RangeBoundary::FromConstant(0),
17 RangeBoundary::FromConstant(100)); 16 RangeBoundary::FromConstant(100));
18 Range* negative = new Range( 17 Range* negative = new Range(
19 RangeBoundary::FromConstant(-1), 18 RangeBoundary::FromConstant(-1),
20 RangeBoundary::FromConstant(-100)); 19 RangeBoundary::FromConstant(-100));
(...skipping 15 matching lines...) Expand all
36 Range* left_range = new Range( \ 35 Range* left_range = new Range( \
37 RangeBoundary::FromConstant(l_min), \ 36 RangeBoundary::FromConstant(l_min), \
38 RangeBoundary::FromConstant(l_max)); \ 37 RangeBoundary::FromConstant(l_max)); \
39 Range* shift_range = new Range( \ 38 Range* shift_range = new Range( \
40 RangeBoundary::FromConstant(r_min), \ 39 RangeBoundary::FromConstant(r_min), \
41 RangeBoundary::FromConstant(r_max)); \ 40 RangeBoundary::FromConstant(r_max)); \
42 Op(left_range, shift_range, &min, &max); \ 41 Op(left_range, shift_range, &min, &max); \
43 min = Clamp(min); \ 42 min = Clamp(min); \
44 max = Clamp(max); \ 43 max = Clamp(max); \
45 EXPECT(min.Equals(res_min)); \ 44 EXPECT(min.Equals(res_min)); \
46 if (!min.Equals(res_min)) OS::Print("%s\n", min.ToCString()); \ 45 if (FLAG_support_il_printer && !min.Equals(res_min)) { \
46 OS::Print("%s\n", min.ToCString()); \
47 } \
47 EXPECT(max.Equals(res_max)); \ 48 EXPECT(max.Equals(res_max)); \
48 if (!max.Equals(res_max)) OS::Print("%s\n", max.ToCString()); \ 49 if (FLAG_support_il_printer && !max.Equals(res_max)) { \
50 OS::Print("%s\n", max.ToCString()); \
51 } \
49 } 52 }
50 53
51 #define NO_CLAMP(b) (b) 54 #define NO_CLAMP(b) (b)
52 #define TEST_RANGE_OP(Op, l_min, l_max, r_min, r_max, result_min, result_max) \ 55 #define TEST_RANGE_OP(Op, l_min, l_max, r_min, r_max, result_min, result_max) \
53 TEST_RANGE_OP_(Op, l_min, l_max, r_min, r_max, \ 56 TEST_RANGE_OP_(Op, l_min, l_max, r_min, r_max, \
54 NO_CLAMP, result_min, result_max) 57 NO_CLAMP, result_min, result_max)
55 58
56 #define CLAMP_TO_SMI(b) (b.Clamp(RangeBoundary::kRangeBoundarySmi)) 59 #define CLAMP_TO_SMI(b) (b.Clamp(RangeBoundary::kRangeBoundarySmi))
57 #define TEST_RANGE_OP_SMI(Op, l_min, l_max, r_min, r_max, res_min, res_max) \ 60 #define TEST_RANGE_OP_SMI(Op, l_min, l_max, r_min, r_max, res_min, res_max) \
58 TEST_RANGE_OP_(Op, l_min, l_max, r_min, r_max, \ 61 TEST_RANGE_OP_(Op, l_min, l_max, r_min, r_max, \
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 p_infinity, 699 p_infinity,
697 size).IsMaximumOrAbove(size)); 700 size).IsMaximumOrAbove(size));
698 701
699 EXPECT(RangeBoundary::JoinMax( 702 EXPECT(RangeBoundary::JoinMax(
700 p_infinity, 703 p_infinity,
701 RangeBoundary::FromConstant(1), 704 RangeBoundary::FromConstant(1),
702 size).IsMaximumOrAbove(size)); 705 size).IsMaximumOrAbove(size));
703 } 706 }
704 707
705 } // namespace dart 708 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698