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

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

Issue 3007783004: Handle switch continue (Closed)
Patch Set: Updated cf. comment 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 void simpleSwitch(e) { 5 void simpleSwitch(e) {
6 /*0@break*/ switch (e) { 6 /*0@break*/ switch (e) {
7 case 0: 7 case 0:
8 /*target=0*/ break; 8 /*target=0*/ break;
9 } 9 }
10 } 10 }
11 11
12 void simpleLabelledSwitch(e) { 12 void labelledSwitch(e) {
13 target: 13 target:
14 /*0@break*/ 14 /*0@break*/
15 switch (e) { 15 switch (e) {
16 case 0: 16 case 0:
17 /*target=0*/ break target; 17 /*target=0*/ break target;
18 } 18 }
19 } 19 }
20 20
21 void simpleNestedSwitch(l) { 21 void switchNestedInLoop(l) {
22 for (var e in l) { 22 for (var e in l) {
23 target: 23 target:
24 /*0@break*/ 24 /*0@break*/
25 switch (e) { 25 switch (e) {
26 case 0: 26 case 0:
27 /*target=0*/ break target; 27 /*target=0*/ break target;
28 } 28 }
29 } 29 }
30 } 30 }
31 31
32 void simpleNestedLabelledSwitch(l) { 32 void labelledSwitchNestedInLoop(l) {
33 target: 33 target:
34 /*0@break*/ 34 /*0@break*/
35 for (var e in l) { 35 for (var e in l) {
36 /*1@break*/ switch (e) { 36 /*1@break*/ switch (e) {
37 case 0: 37 case 0:
38 /*target=0*/ break target; 38 /*target=0*/ break target;
39 case 1: 39 case 1:
40 /*target=1*/ break; 40 /*target=1*/ break;
41 } 41 }
42 } 42 }
43 } 43 }
44 44
45 void switchWithContinue(e) {
46 /*0@break*/ switch (e) {
47 target:
48 case /*1@continue*/ 0:
49 /*target=0*/ break;
50 case 1:
51 /*target=1*/ continue target;
52 }
53 }
54
45 void main() { 55 void main() {
46 simpleSwitch(0); 56 simpleSwitch(0);
47 simpleLabelledSwitch(0); 57 labelledSwitch(0);
48 simpleNestedSwitch([]); 58 switchNestedInLoop([]);
49 simpleNestedLabelledSwitch([]); 59 labelledSwitchNestedInLoop([]);
60 switchWithContinue(0);
50 } 61 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/inference/inference_test.dart ('k') | tests/compiler/dart2js/jumps/jump_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698