Index: test/compiler-unittests/common-operator-unittest.cc |
diff --git a/test/compiler-unittests/common-operator-unittest.cc b/test/compiler-unittests/common-operator-unittest.cc |
index fa5af1ea6a97ac478187b814f5e413518f5ddfeb..f034127f92c00b841f41b1861e776e399f427dca 100644 |
--- a/test/compiler-unittests/common-operator-unittest.cc |
+++ b/test/compiler-unittests/common-operator-unittest.cc |
@@ -15,6 +15,30 @@ CommonOperatorTest::CommonOperatorTest() : common_(zone()) {} |
CommonOperatorTest::~CommonOperatorTest() {} |
+ |
+TEST_F(CommonOperatorTest, ControlEffect) { |
+ Operator* op = common()->ControlEffect(); |
+ EXPECT_EQ(1, OperatorProperties::GetControlInputCount(op)); |
+ EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op)); |
+ EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op)); |
+ EXPECT_EQ(1, OperatorProperties::GetEffectOutputCount(op)); |
+ EXPECT_EQ(0, OperatorProperties::GetValueOutputCount(op)); |
+} |
+ |
+ |
+TEST_F(CommonOperatorTest, Finish) { |
+ static const int kArguments[] = {1, 5, 6, 42, 100, 10000, kMaxInt}; |
+ TRACED_FOREACH(int, arguments, kArguments) { |
+ Operator* op = common()->Finish(arguments); |
+ EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op)); |
+ EXPECT_EQ(arguments, OperatorProperties::GetEffectInputCount(op)); |
+ EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op)); |
+ EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op)); |
+ EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op)); |
+ EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op)); |
+ } |
+} |
+ |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |