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 9fe3948c0b6820ec1d3c8a1667ec8d13b765dc52..fdf73c910f5866b465158753656dbe8d0faa8cee 100644 |
--- a/test/unittests/compiler/common-operator-unittest.cc |
+++ b/test/unittests/compiler/common-operator-unittest.cc |
@@ -47,7 +47,6 @@ const SharedOperator kSharedOperators[] = { |
} |
SHARED(Dead, Operator::kFoldable, 0, 0, 0, 0, 1), |
SHARED(End, Operator::kFoldable, 0, 0, 1, 0, 0), |
- SHARED(Branch, Operator::kFoldable, 1, 0, 1, 0, 2), |
SHARED(IfTrue, Operator::kFoldable, 0, 0, 1, 0, 1), |
SHARED(IfFalse, Operator::kFoldable, 0, 0, 1, 0, 1), |
SHARED(Throw, Operator::kFoldable, 1, 0, 1, 0, 1), |
@@ -160,6 +159,24 @@ const double kDoubleValues[] = {-std::numeric_limits<double>::infinity(), |
} // namespace |
+TEST_F(CommonOperatorTest, Branch) { |
+ static const BranchHint kHints[] = {BranchHint::kNone, BranchHint::kTrue, |
+ BranchHint::kFalse}; |
+ TRACED_FOREACH(BranchHint, hint, kHints) { |
+ const Operator* const op = common()->Branch(hint); |
+ EXPECT_EQ(IrOpcode::kBranch, op->opcode()); |
+ EXPECT_EQ(Operator::kFoldable, op->properties()); |
+ EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op)); |
+ EXPECT_EQ(0, OperatorProperties::GetEffectInputCount(op)); |
+ EXPECT_EQ(1, OperatorProperties::GetControlInputCount(op)); |
+ EXPECT_EQ(2, OperatorProperties::GetTotalInputCount(op)); |
+ EXPECT_EQ(0, OperatorProperties::GetValueOutputCount(op)); |
+ EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op)); |
+ EXPECT_EQ(2, OperatorProperties::GetControlOutputCount(op)); |
+ } |
+} |
+ |
+ |
TEST_F(CommonOperatorTest, Float32Constant) { |
TRACED_FOREACH(float, value, kFloatValues) { |
const Operator* op = common()->Float32Constant(value); |