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

Unified Diff: tests/language/vm/load_to_load_forwarding_vm_test.dart

Issue 183303002: Fix bug in load elimination with multiple phis. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/vm/load_to_load_forwarding_vm_test.dart
===================================================================
--- tests/language/vm/load_to_load_forwarding_vm_test.dart (revision 33112)
+++ tests/language/vm/load_to_load_forwarding_vm_test.dart (working copy)
@@ -169,6 +169,27 @@
0.1, 0.0, -0.1], result);
}
+
+class C {
+ C(this.box, this.parent);
+ final box;
+ final C parent;
+}
+
+testPhiForwarding5(C c) {
+ var s = 0;
+ var tmp = c;
+ var a = c.parent;
+ if (a.box + tmp.box != 1) throw "failed";
+ do {
+ s += tmp.box + a.box;
+ tmp = a;
+ a = a.parent;
+ } while (a != null);
+ return s;
+}
+
+
class U {
var x, y;
U() : x = 0, y = 0;
@@ -260,6 +281,8 @@
final obj = new X(new X(new X(null)));
+ final cs = new C(0, new C(1, new C(2, null)));
+
for (var i = 0; i < 20; i++) {
Expect.listEquals([0x02010000, 0x03020100], foo(new A(0, 0)));
Expect.listEquals([0x02010000, 0x03020100], bar(new A(0, 0), false));
@@ -270,6 +293,7 @@
testPhiForwarding2(obj);
testPhiForwarding3();
testPhiForwarding4();
+ Expect.equals(4, testPhiForwarding5(cs));
testEqualPhisElimination();
}
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698