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

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

Issue 3009463002: Handle labelled continue statements (Closed)
Patch Set: Updated cf. comments Created 3 years, 4 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 | « tests/compiler/dart2js/jumps/data/nested_loops.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/compile_from_dill_test_helper.dart
diff --git a/tests/compiler/dart2js/kernel/compile_from_dill_test_helper.dart b/tests/compiler/dart2js/kernel/compile_from_dill_test_helper.dart
index c557c463d623d65177af2026915bd2a0da0a5113..b80afeb305c69494bf9abcb55cceaf424bc44113 100644
--- a/tests/compiler/dart2js/kernel/compile_from_dill_test_helper.dart
+++ b/tests/compiler/dart2js/kernel/compile_from_dill_test_helper.dart
@@ -164,9 +164,20 @@ main() {
if (i == 7) break;
i++;
} while (i < 10);
- outer: for (var a in [3, 5]) {
+ outer1: for (var a in [3, 5]) {
for (var b in [2, 4]) {
- if (a == b) break outer;
+ if (a == b) break outer1;
+ }
+ }
+ outer2: for (var a in [3, 5]) {
+ for (var b in [2, 4]) {
+ if (a != b) continue outer2;
+ }
+ }
+ outer3: for (var a in [3, 5]) {
+ for (var b in [2, 4]) {
+ if (a == b) break outer3;
+ if (a != b) continue outer3;
}
}
print(x);
@@ -301,6 +312,43 @@ Future<ResultKind> runTest(
printSteps: true,
compilerOutput: collector2);
+ // Print the middle section of the outputs if they are not line-wise
+ // identical.
+ collector1.outputMap
+ .forEach((OutputType outputType, Map<String, BufferedOutputSink> map1) {
+ if (outputType == OutputType.sourceMap) {
+ return;
+ }
+ Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType];
+ checkSets(map1.keys, map2.keys, 'output', equality);
+ map1.forEach((String name, BufferedOutputSink output1) {
+ BufferedOutputSink output2 = map2[name];
+ if (output1.text == output2.text) return;
+ List<String> lines1 = output1.text.split('\n');
+ List<String> lines2 = output2.text.split('\n');
+ int prefix = 0;
+ while (prefix < lines1.length && prefix < lines2.length) {
+ if (lines1[prefix] != lines2[prefix]) {
+ break;
+ }
+ prefix++;
+ }
+ int suffix1 = lines1.length - 1;
+ int suffix2 = lines2.length - 1;
+ while (suffix1 >= 0 && suffix2 >= 0) {
+ if (lines1[suffix1] != lines2[suffix2]) {
+ break;
+ }
+ suffix1--;
+ suffix2--;
+ }
+ print('--- from source, lines [${prefix}-${suffix1}] ------------------');
+ lines1.sublist(prefix, suffix1 + 1).forEach(print);
+ print('--- from dill, lines [${prefix}-${suffix2}] --------------------');
+ lines2.sublist(prefix, suffix2 + 1).forEach(print);
+ });
+ });
+
KernelFrontEndStrategy frontendStrategy = compiler2.frontendStrategy;
KernelToElementMap elementMap = frontendStrategy.elementMap;
« no previous file with comments | « tests/compiler/dart2js/jumps/data/nested_loops.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698