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

Unified Diff: tests/language/propagate_past_constant_test.dart

Issue 918653002: Propagate pseudo-constants expressions separately in tree rewriter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 10 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/js_backend_cps_ir_supercall_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/propagate_past_constant_test.dart
diff --git a/tests/language/regress_21998_2_test.dart b/tests/language/propagate_past_constant_test.dart
similarity index 55%
copy from tests/language/regress_21998_2_test.dart
copy to tests/language/propagate_past_constant_test.dart
index 53cace0ad782e5702a3f63c10369624363dd1984..03858b4b56aa238de47ad6417cc6e58a54e1cac3 100644
--- a/tests/language/regress_21998_2_test.dart
+++ b/tests/language/propagate_past_constant_test.dart
@@ -2,18 +2,19 @@
// 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 'dart:math' as Math;
import 'package:expect/expect.dart';
-import 'regress_21998_lib1.dart' as lib1;
-main() {
- Expect.equals(4, new C().m());
-}
+foo(x) => x;
-class C {
- max(a) => a;
+check(y) {
+ Expect.equals('foo', y);
+}
- m() {
- return max(Math.max(2, lib1.max('a', 'b', 'cd').length));
- }
-}
+main() {
+ var x = foo('foo');
+ var y = foo(x);
+ x = 'constant';
+ check(y); // 'y' should not propagate here unless reference to 'x' is rewritten
+ foo(x);
+ foo(x);
+}
« no previous file with comments | « tests/compiler/dart2js/js_backend_cps_ir_supercall_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698