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

Unified Diff: tests/compiler/dart2js/kernel/loops_test.dart

Issue 2644293004: Fix labeled break statements. (Closed)
Patch Set: . Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.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/kernel/loops_test.dart
diff --git a/tests/compiler/dart2js/kernel/loops_test.dart b/tests/compiler/dart2js/kernel/loops_test.dart
index 78385c797ceb65ee4fe273dd418c2d515d41e0f6..b257e4b009e922c2b621e38207ad25acf53948af 100644
--- a/tests/compiler/dart2js/kernel/loops_test.dart
+++ b/tests/compiler/dart2js/kernel/loops_test.dart
@@ -84,4 +84,21 @@ main() {
}''';
return check(code, disableTypeInference: false);
});
+
+ test('for loop with break to label', () {
+ String code = '''
+var a = 0;
+main() {
+ var sum = 0;
+ outer: for (a in [1, 2, 3]) {
+ for (int i = 0; i < 10; i++) {
+ sum += a;
+ if (a + i < 5)
+ break outer;
+ }
+ }
+ return sum;
+}''';
+ return check(code, disableTypeInference: false);
+ });
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698