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

Unified Diff: tests/compiler/dart2js/cpa_inference_test.dart

Issue 18034027: Handle do-while (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Sync to head, address comments. Created 7 years, 5 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/types/concrete_types_inferrer.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/cpa_inference_test.dart
diff --git a/tests/compiler/dart2js/cpa_inference_test.dart b/tests/compiler/dart2js/cpa_inference_test.dart
index 7d85b9a10230e30a1b48ed61936e7ff76360326b..bb12e2951b4d41e0852e965551e7fec00f3afebb 100644
--- a/tests/compiler/dart2js/cpa_inference_test.dart
+++ b/tests/compiler/dart2js/cpa_inference_test.dart
@@ -292,6 +292,28 @@ testWhile() {
result.checkNodeHasType('bar', [result.int]);
}
+testDoWhile() {
+ final String source = r"""
+ class A { f() => new B(); }
+ class B { f() => new C(); }
+ class C { f() => new A(); }
+ main() {
+ var bar = null;
+ var foo = new A();
+ do {
+ foo = foo.f();
+ } while (bar = 42);
+ foo; bar;
+ }
+ """;
+ AnalysisResult result = analyze(source);
+ result.checkNodeHasType(
+ 'foo',
+ [result.base('A'), result.base('B'), result.base('C')]);
+ // Check that the condition is evaluated.
+ result.checkNodeHasType('bar', [result.int]);
+}
+
testFor1() {
final String source = r"""
class A { f() => new B(); }
@@ -1544,6 +1566,7 @@ void main() {
testIfThenElse();
testTernaryIf();
testWhile();
+ testDoWhile();
testFor1();
testFor2();
testFor3();
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698