Reviewers: Benedikt Meurer,

Description:
Add missing test for CollectControlProjections on calls.

[email protected]
TEST=unittests/NodePropertiesTest.CollectControlProjections_Call

Please review this at https://codereview.chromium.org/941993002/

Base URL: https://chromium.googlesource.com/v8/v8.git@local_trycatch-4

Affected files (+14, -0 lines):
  M test/unittests/compiler/node-properties-unittest.cc


Index: test/unittests/compiler/node-properties-unittest.cc
diff --git a/test/unittests/compiler/node-properties-unittest.cc b/test/unittests/compiler/node-properties-unittest.cc index f4ce0d31266456e3136a756872561e87bedd752e..edaf430f8e690b2a39a2b6dc42afe2e592258e8b 100644
--- a/test/unittests/compiler/node-properties-unittest.cc
+++ b/test/unittests/compiler/node-properties-unittest.cc
@@ -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());


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to