Index: test/unittests/compiler/graph-reducer-unittest.cc |
diff --git a/test/unittests/compiler/graph-reducer-unittest.cc b/test/unittests/compiler/graph-reducer-unittest.cc |
index 3ca6052af9fd0253a7a2d69a1a4a420329b35d92..599af72983a53bc0068d9b3a4efebeac40aea24a 100644 |
--- a/test/unittests/compiler/graph-reducer-unittest.cc |
+++ b/test/unittests/compiler/graph-reducer-unittest.cc |
@@ -290,7 +290,8 @@ const IfExceptionHint kNoHint = IfExceptionHint::kLocallyCaught; |
TEST_F(AdvancedReducerTest, ReplaceWithValue_ValueUse) { |
CommonOperatorBuilder common(zone()); |
Node* node = graph()->NewNode(&kMockOperator); |
- Node* use_value = graph()->NewNode(common.Return(), node); |
+ Node* start = graph()->NewNode(common.Start(1)); |
+ Node* use_value = graph()->NewNode(common.Return(), node, start, start); |
Node* replacement = graph()->NewNode(&kMockOperator); |
GraphReducer graph_reducer(zone(), graph(), nullptr); |
ReplaceWithValueReducer r(&graph_reducer); |
@@ -306,16 +307,18 @@ TEST_F(AdvancedReducerTest, ReplaceWithValue_EffectUse) { |
CommonOperatorBuilder common(zone()); |
Node* start = graph()->NewNode(common.Start(1)); |
Node* node = graph()->NewNode(&kMockOpEffect, start); |
- Node* use_effect = graph()->NewNode(common.EffectPhi(1), node); |
+ Node* use_control = graph()->NewNode(common.Merge(1), start); |
+ Node* use_effect = graph()->NewNode(common.EffectPhi(1), node, use_control); |
Node* replacement = graph()->NewNode(&kMockOperator); |
GraphReducer graph_reducer(zone(), graph(), nullptr); |
ReplaceWithValueReducer r(&graph_reducer); |
r.ReplaceWithValue(node, replacement); |
EXPECT_EQ(start, use_effect->InputAt(0)); |
EXPECT_EQ(0, node->UseCount()); |
- EXPECT_EQ(2, start->UseCount()); |
+ EXPECT_EQ(3, start->UseCount()); |
EXPECT_EQ(0, replacement->UseCount()); |
- EXPECT_THAT(start->uses(), UnorderedElementsAre(use_effect, node)); |
+ EXPECT_THAT(start->uses(), |
+ UnorderedElementsAre(use_effect, use_control, node)); |
} |