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

Unified Diff: tests/compiler/dart2js_extra/27354_test.dart

Issue 2339853004: Avoid merging conditions across loop boundary (Closed)
Patch Set: Add test Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen_helpers.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/27354_test.dart
diff --git a/tests/compiler/dart2js_extra/27354_test.dart b/tests/compiler/dart2js_extra/27354_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..942dc49b422169a17067ba1e0cd6ad8ac0f5c770
--- /dev/null
+++ b/tests/compiler/dart2js_extra/27354_test.dart
@@ -0,0 +1,14 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for Issue 27354.
+
+int total = 1;
+void inc() => total++ < 10 ? null : throw "do not loop forever!";
Siggi Cherem (dart-lang) 2016/09/15 00:07:10 just realized `void` here might be an over stateme
+
+void main() {
+ // Problem was moving the load of 'total' inside the loop.
+ int count = null ?? total;
+ for (int i = 0; i < count; i++) inc();
+}
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen_helpers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698