Commit 7dba829b authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Add missing test for CollectControlProjections on calls.

R=bmeurer@chromium.org
TEST=unittests/NodePropertiesTest.CollectControlProjections_Call

Review URL: https://codereview.chromium.org/941993002

Cr-Commit-Position: refs/heads/master@{#26777}
parent b039a75e
......@@ -26,6 +26,8 @@ const Operator kMockOpEffect(IrOpcode::kDead, Operator::kNoProperties,
"MockOpEffect", 0, 1, 0, 1, 1, 0);
const Operator kMockOpControl(IrOpcode::kDead, Operator::kNoProperties,
"MockOpControl", 0, 0, 1, 1, 0, 1);
const Operator kMockCallOperator(IrOpcode::kCall, Operator::kNoProperties,
"MockCallOperator", 0, 0, 0, 0, 0, 2);
} // namespace
......@@ -98,6 +100,18 @@ TEST_F(NodePropertiesTest, CollectControlProjections_Branch) {
}
TEST_F(NodePropertiesTest, CollectControlProjections_Call) {
Node* result[2];
CommonOperatorBuilder common(zone());
Node* call = Node::New(zone(), 1, &kMockCallOperator, 0, nullptr, false);
Node* if_ex = Node::New(zone(), 2, common.IfException(), 1, &call, false);
Node* if_ok = Node::New(zone(), 3, common.IfSuccess(), 1, &call, false);
NodeProperties::CollectControlProjections(call, result, arraysize(result));
EXPECT_EQ(if_ok, result[0]);
EXPECT_EQ(if_ex, result[1]);
}
TEST_F(NodePropertiesTest, CollectControlProjections_Switch) {
Node* result[3];
CommonOperatorBuilder common(zone());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment