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

Unified Diff: test/cctest/compiler/test-scheduler.cc

Issue 651843004: Add Terminate operator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test case for scheduler. Created 6 years, 2 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
« src/compiler/common-operator.cc ('K') | « src/compiler/verifier.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-scheduler.cc
diff --git a/test/cctest/compiler/test-scheduler.cc b/test/cctest/compiler/test-scheduler.cc
index c5412e09557ee92965e4a1220dd24717dffc1db3..894f0f0acc554132d928647d4dd13b161b8432aa 100644
--- a/test/cctest/compiler/test-scheduler.cc
+++ b/test/cctest/compiler/test-scheduler.cc
@@ -1888,4 +1888,31 @@ TEST(BranchHintFalse) {
CHECK(!schedule->block(f)->deferred());
}
+
+TEST(ScheduleTerminate) {
+ HandleAndZoneScope scope;
+ Graph graph(scope.main_zone());
+ CommonOperatorBuilder common(scope.main_zone());
+
+ Node* start = graph.NewNode(common.Start(1));
+ graph.SetStart(start);
+
+ Node* loop = graph.NewNode(common.Loop(2), start, start);
+ loop->ReplaceInput(1, loop); // self loop, NTL.
+
+ Node* effect = graph.NewNode(common.EffectPhi(1), start, loop);
+ effect->ReplaceInput(0, effect);
+
+ Node* terminate = graph.NewNode(common.Terminate(1), effect, loop);
+ Node* end = graph.NewNode(common.End(), terminate);
+
+ graph.SetEnd(end);
+
+ Schedule* schedule = ComputeAndVerifySchedule(5, &graph);
+ BasicBlock* block = schedule->block(loop);
+ CHECK_NE(NULL, loop);
+ CHECK_EQ(block, schedule->block(effect));
+ CHECK_GE(block->rpo_number(), 0);
+}
+
#endif
« src/compiler/common-operator.cc ('K') | « src/compiler/verifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698