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)); |
} |