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

Unified Diff: tests/compiler/dart2js/octagon_test.dart

Issue 1474133002: dart2js cps: Fix bug in bounds check elimination. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address kevins comments Created 5 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 | « pkg/compiler/lib/src/cps_ir/octagon.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/octagon_test.dart
diff --git a/tests/compiler/dart2js/octagon_test.dart b/tests/compiler/dart2js/octagon_test.dart
index 2644c0ed4d494d489cb1f480fbd39fc6a7e56024..59ea0c0c1794c076bbe21f239865371a8d3303c1 100644
--- a/tests/compiler/dart2js/octagon_test.dart
+++ b/tests/compiler/dart2js/octagon_test.dart
@@ -233,17 +233,35 @@ contradict2() {
}
lower_bounds_check() {
+ setup();
SignedVariable w = octagon.makeVariable(0, 1000);
pushConstraint(w, w, -1);
Expect.isTrue(octagon.isUnsolvable, 'Value in range 0..1000 is not <= -1');
}
upper_bounds_check() {
+ setup();
SignedVariable w = octagon.makeVariable(0, 1000);
pushConstraint(w.negated, w.negated, -5000);
Expect.isTrue(octagon.isUnsolvable, 'Value in range 0..1000 is not >= 5000');
}
+diamond_graph() {
+ setup();
+ pushConstraint(v1, v2.negated, 10);
+ pushConstraint(v1, v3.negated, 1);
+ pushConstraint(v2, v3.negated, 1);
+ pushConstraint(v2, v4.negated, 2);
+ pushConstraint(v3, v2.negated, 0);
+ pushConstraint(v3, v4.negated, 100);
+ Expect.isTrue(octagon.isSolvable, 'v1 <= v4 + 3');
+ var c = pushConstraint(v4, v1.negated, -4);
+ Expect.isTrue(octagon.isUnsolvable, 'v4 <= v1 - 4 should be a contradiction');
+ popConstraint(c);
+ pushConstraint(v1.negated, v4, -4); // Check converse constraint.
+ Expect.isTrue(octagon.isUnsolvable, 'v4 <= v1 - 4 should be a contradiction');
+}
+
void main() {
negative_loop1();
negative_loop2();
@@ -261,4 +279,5 @@ void main() {
contradict2();
lower_bounds_check();
upper_bounds_check();
+ diamond_graph();
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/octagon.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698