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

Unified Diff: tests/language/type_propagation_phi_test.dart

Issue 10855004: Fix dominatedUsers for phis. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 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 | « lib/compiler/implementation/ssa/nodes.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/type_propagation_phi_test.dart
diff --git a/tests/language/type_propagation_in_for_update_test.dart b/tests/language/type_propagation_phi_test.dart
similarity index 53%
copy from tests/language/type_propagation_in_for_update_test.dart
copy to tests/language/type_propagation_phi_test.dart
index 2a41e0cdbea7bb648a47d2db5f3d72f4a00fd67f..b64cfa767b76e579170af7706196f9ff7e2ef734 100644
--- a/tests/language/type_propagation_in_for_update_test.dart
+++ b/tests/language/type_propagation_phi_test.dart
@@ -4,23 +4,18 @@
// Check that phi type computation in the Dart2Js compiler does the
// correct thing.
-bar() => 'foo';
+bar() => 490;
+bar2() => 0;
-main() {
- Expect.throws(foo1);
- Expect.throws(foo2);
-}
-
-foo1() {
- var a = bar();
- for (;; a = 1 + a) {
- if (a != 'foo') return;
- }
+foo(b) {
+ var x = bar();
+ var x2 = x;
+ if (b) x2 = bar2();
+ var x3 = 9 + x; // Guarantees that x is a number. Dart2js propagated the
+ // type information back to the phi (for x2).
+ return x2 + x3;
}
-foo2() {
- var a = bar();
- for (;; a = 1 + a) {
- if (a != 'foo') break;
- }
+main() {
+ Expect.equals(499, foo(true));
}
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698