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

Unified Diff: test/unittests/compiler/common-operator-unittest.cc

Issue 1391333003: Adding support for multiple returns in compiled functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: formatting Created 5 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
Index: test/unittests/compiler/common-operator-unittest.cc
diff --git a/test/unittests/compiler/common-operator-unittest.cc b/test/unittests/compiler/common-operator-unittest.cc
index 66eb140d27291d265e6df921938a6ae21d94297d..bed100a6d8c2340edc461e411f758ba7f18c3116 100644
--- a/test/unittests/compiler/common-operator-unittest.cc
+++ b/test/unittests/compiler/common-operator-unittest.cc
@@ -53,7 +53,6 @@ const SharedOperator kSharedOperators[] = {
SHARED(IfFalse, Operator::kKontrol, 0, 0, 1, 0, 0, 1),
SHARED(IfSuccess, Operator::kKontrol, 0, 0, 1, 0, 0, 1),
SHARED(Throw, Operator::kKontrol, 1, 1, 1, 0, 0, 1),
- SHARED(Return, Operator::kNoThrow, 1, 1, 1, 0, 0, 1),
SHARED(Terminate, Operator::kKontrol, 0, 1, 1, 0, 0, 1)
#undef SHARED
};
@@ -188,6 +187,23 @@ TEST_F(CommonOperatorTest, End) {
}
+TEST_F(CommonOperatorTest, Return) {
+ TRACED_FOREACH(int, input_count, kArguments) {
+ const Operator* const op = common()->Return(input_count);
+ EXPECT_EQ(IrOpcode::kReturn, op->opcode());
+ EXPECT_EQ(Operator::kNoThrow, op->properties());
+ EXPECT_EQ(input_count, op->ValueInputCount());
+ EXPECT_EQ(1, op->EffectInputCount());
+ EXPECT_EQ(1, static_cast<uint32_t>(op->ControlInputCount()));
+ EXPECT_EQ(2 + input_count, static_cast<uint32_t>(
+ OperatorProperties::GetTotalInputCount(op)));
+ EXPECT_EQ(0, op->ValueOutputCount());
+ EXPECT_EQ(0, op->EffectOutputCount());
+ EXPECT_EQ(1, op->ControlOutputCount());
+ }
+}
+
+
TEST_F(CommonOperatorTest, Branch) {
TRACED_FOREACH(BranchHint, hint, kBranchHints) {
const Operator* const op = common()->Branch(hint);
« test/cctest/compiler/test-multiple-return.cc ('K') | « test/cctest/compiler/test-multiple-return.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698