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

Unified Diff: tests/compiler/dart2js_extra/switch_test.dart

Issue 2810093002: Don't duplicate switch case code if we fall through to the default case. (Closed)
Patch Set: Created 3 years, 8 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/codegen.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_extra/switch_test.dart
diff --git a/tests/compiler/dart2js_extra/switch_test.dart b/tests/compiler/dart2js_extra/switch_test.dart
index 7acade2f3fe8551c601dc191610cd3a9c108b811..5eb51c0db4172f3dae7f4e887d4e30a1514c672d 100644
--- a/tests/compiler/dart2js_extra/switch_test.dart
+++ b/tests/compiler/dart2js_extra/switch_test.dart
@@ -58,6 +58,21 @@ switcher2(val) {
return x;
}
+var x = 0;
+
+@NoInline()
+switcher3(val) {
+ switch(val) {
+ case 1:
+ default:
+ incrementX();
+ }
+}
+
+incrementX() {
+ x++;
+}
+
badswitches(val) {
// Test some badly formed switch bodies.
// 01 - a label/statement without a following case/default.
@@ -81,5 +96,8 @@ main() {
Expect.equals(200, switcher2(4));
Expect.equals(200, switcher2(5));
+ switcher3(1);
+ Expect.equals(1, x);
+
badswitches(42);
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698