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

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

Issue 758953002: cps-ir: Optimize identical used with constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add an assert. Created 6 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
Index: tests/compiler/dart2js/js_backend_cps_ir_control_flow.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_control_flow.dart b/tests/compiler/dart2js/js_backend_cps_ir_control_flow.dart
index 5d43b33690f8dddf9fee5250af3f4853cf8b9f54..746735b13637299a4fd6fd0004a8f60cf80762d4 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_control_flow.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_control_flow.dart
@@ -15,9 +15,8 @@ main() {
}
""", """
function() {
- while (P.identical(true, true))
+ while (true)
;
- return null;
}"""),
const TestEntry("""
foo(a) => a;
@@ -35,24 +34,16 @@ main() {
}
""", """
function() {
- L2:
- while (P.identical(true, true))
- L1:
- while (true) {
- L0:
- if (P.identical(true, true)) {
- while (P.identical(V.foo(true), true))
- if (!P.identical(V.foo(false), true))
- ;
- else
- break L0;
- P.print(1);
- continue L1;
- }
- P.print(2);
- continue L2;
- }
- return null;
+ L0:
+ while (true)
+ while (true) {
+ while (P.identical(V.foo(true), true))
+ if (P.identical(V.foo(false), true)) {
+ P.print(2);
+ continue L0;
+ }
+ P.print(1);
+ }
}"""),
const TestEntry("""
foo(a) => a;
@@ -67,13 +58,13 @@ main() {
function() {
var i;
i = 0;
- L3:
+ L1:
while (true) {
if (P.identical(V.foo(true), true)) {
P.print(1);
if (!P.identical(V.foo(false), true)) {
i = V.foo(i);
- continue L3;
+ continue L1;
}
}
P.print(2);
@@ -120,4 +111,16 @@ function() {
P.print(3);
return null;
}"""),
+const TestEntry("""
+main() {
+ if (1) {
+ print('bad');
+ } else {
+ print('ok');
+ }
+}""","""
+function() {
+ P.print("bad");
+ return null;
+}"""),
];

Powered by Google App Engine
This is Rietveld 408576698