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

Unified Diff: test/unittests/compiler/node-properties-unittest.cc

Issue 941993002: Add missing test for CollectControlProjections on calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_trycatch-4
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698