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

Side by Side Diff: tests/compiler/dart2js/kernel/compile_from_dill_test_helper.dart

Issue 2965763002: Support break in switch and break/continue in do statements (Closed)
Patch Set: Created 3 years, 5 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 // Helper to test compilation equivalence between source and .dill based 5 // Helper to test compilation equivalence between source and .dill based
6 // compilation. 6 // compilation.
7 library dart2js.kernel.compile_from_dill_test_helper; 7 library dart2js.kernel.compile_from_dill_test_helper;
8 8
9 import 'dart:async'; 9 import 'dart:async';
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 var w = x == null ? null : x.toString(); 71 var w = x == null ? null : x.toString();
72 for (int i = 0; i < 10; i++) { 72 for (int i = 0; i < 10; i++) {
73 if (i == 5) continue; 73 if (i == 5) continue;
74 x = i; 74 x = i;
75 if (i == 5) break; 75 if (i == 5) break;
76 } 76 }
77 int i = 0; 77 int i = 0;
78 while (i < 10) { 78 while (i < 10) {
79 if (i == 5) continue; 79 if (i == 5) continue;
80 x = i; 80 x = i;
81 if (i == 5) break; 81 if (i == 7) break;
82 i++;
82 } 83 }
83 for (var v in [3, 5]) { 84 for (var v in [3, 5]) {
84 if (v == 5) continue; 85 if (v == 5) continue;
85 x = v; 86 x = v;
86 if (v == 5) break; 87 if (v == 7) break;
88 }
89 do {
90 // TODO(johnniwinther): Support js ast equivalence to handle label name
91 // mismatches. Enable the continue test:
92 //if (i == 5) continue;
93 x = i;
94 if (i == 7) break;
95 i++;
96 } while (i < 10);
97 switch (x) {
98 case 0:
99 x = 7;
100 break;
101 case 1:
102 x = 9;
103 break;
104 default:
105 x = 11;
106 break;
87 } 107 }
88 x = toplevel; 108 x = toplevel;
89 print(x); 109 print(x);
90 return x; 110 return x;
91 } 111 }
92 ''' 112 '''
93 }; 113 };
94 114
95 enum ResultKind { crashes, errors, warnings, success, failure } 115 enum ResultKind { crashes, errors, warnings, success, failure }
96 116
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 229 }
210 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType]; 230 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType];
211 checkSets(map1.keys, map2.keys, 'output', equality); 231 checkSets(map1.keys, map2.keys, 'output', equality);
212 map1.forEach((String name, BufferedOutputSink output1) { 232 map1.forEach((String name, BufferedOutputSink output1) {
213 BufferedOutputSink output2 = map2[name]; 233 BufferedOutputSink output2 = map2[name];
214 Expect.stringEquals(output1.text, output2.text); 234 Expect.stringEquals(output1.text, output2.text);
215 }); 235 });
216 }); 236 });
217 return ResultKind.success; 237 return ResultKind.success;
218 } 238 }
OLDNEW
« pkg/compiler/lib/src/js_model/locals.dart ('K') | « pkg/compiler/lib/src/js_model/locals.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698