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

Side by Side Diff: tests/compiler/dart2js/jumps/data/nested_loops.dart

Issue 3009463002: Handle labelled continue statements (Closed)
Patch Set: Updated cf. comments Created 3 years, 3 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 nestedForLoopWithBreakAndContinue(count) { 5 nestedForLoopWithBreakAndContinue(count) {
6 /*0@continue*/ for (int i = 0; i < count; i = i + 1) { 6 /*0@continue*/ for (int i = 0; i < count; i = i + 1) {
7 /*1@break*/ for (int j = 0; j < count; j = j + 1) { 7 /*1@break*/ for (int j = 0; j < count; j = j + 1) {
8 if (i % 2 == 0) /*target=1*/ break; 8 if (i % 2 == 0) /*target=1*/ break;
9 } 9 }
10 if (i % 2 == 0) /*target=0*/ continue; 10 if (i % 2 == 0) /*target=0*/ continue;
11 } 11 }
12 } 12 }
13 13
14 nestedForLoopWithLabelledBreak(count) { 14 nestedForLoopWithLabelledBreak(count) {
15 outer: 15 outer:
16 /*0@break*/ 16 /*0@break*/
17 for (int i = 0; i < count; i = i + 1) { 17 for (int i = 0; i < count; i = i + 1) {
18 for (int j = 0; j < count; j = j + 1) { 18 for (int j = 0; j < count; j = j + 1) {
19 if (i % 2 == 0) /*target=0*/ break outer; 19 if (i % 2 == 0) /*target=0*/ break outer;
20 } 20 }
21 } 21 }
22 } 22 }
23 23
24 nestedForLoopWithLabelledContinue(count) {
25 outer:
26 /*0@continue*/
27 for (int i = 0; i < count; i = i + 1) {
28 for (int j = 0; j < count; j = j + 1) {
29 if (i % 2 == 0) /*target=0*/ continue outer;
30 }
31 }
32 }
33
34 nestedForLoopWithLabelledBreakAndContinue(count) {
35 outer:
36 /*0@break,continue*/
37 for (int i = 0; i < count; i = i + 1) {
38 for (int j = 0; j < count; j = j + 1) {
39 if (i % 2 == 0) /*target=0*/ break outer;
40 if (i % 3 == 0) /*target=0*/ continue outer;
41 }
42 }
43 }
44
24 main() { 45 main() {
25 nestedForLoopWithBreakAndContinue(10); 46 nestedForLoopWithBreakAndContinue(10);
26 nestedForLoopWithLabelledBreak(10); 47 nestedForLoopWithLabelledBreak(10);
48 nestedForLoopWithLabelledContinue(10);
49 nestedForLoopWithLabelledBreakAndContinue(10);
27 } 50 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | tests/compiler/dart2js/kernel/compile_from_dill_test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698