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

Unified Diff: tests/language/issue10321_test.dart

Issue 14602011: Fix issue 10321 by invalidating previous "generate at use site" optimizations based on a pure instr… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « sdk/lib/_internal/compiler/implementation/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/language/issue10321_test.dart
===================================================================
--- tests/language/issue10321_test.dart (revision 0)
+++ tests/language/issue10321_test.dart (revision 0)
@@ -0,0 +1,41 @@
+// Copyright (c) 2013, 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.
+
+import "package:expect/expect.dart";
+
+// Regression test for dart2js that used to miscompile [A.foo].
+
+var global = 54;
+
+class A {
+ int a = 0;
+ int b = 42;
+ final int c = global;
+ foo() {
+ int start = a - 1;
+ a = 54;
+ if (b == 42) {
+ b = 32;
+ } else {
+ b = 42;
+ }
+ Expect.equals(-1, start);
+ }
+
+ bar() {
+ int start = a - c - 1;
+ a = 42;
+ if (b == 42) {
+ b = 32;
+ } else {
+ b = 42;
+ }
+ Expect.equals(-55, start);
+ }
+}
+
+main() {
+ new A().foo();
+ new A().bar();
+}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698