Index: test/unittests/compiler/common-operator-reducer-unittest.cc |
diff --git a/test/unittests/compiler/common-operator-reducer-unittest.cc b/test/unittests/compiler/common-operator-reducer-unittest.cc |
index ce10b1e63593729feb3bdafcf3da00315e52aa81..129eb425482b3ee96d0142bb97167e6368d28348 100644 |
--- a/test/unittests/compiler/common-operator-reducer-unittest.cc |
+++ b/test/unittests/compiler/common-operator-reducer-unittest.cc |
@@ -221,6 +221,28 @@ TEST_F(CommonOperatorReducerTest, RedundantSelect) { |
} |
+TEST_F(CommonOperatorReducerTest, SelectWithFalseConstant) { |
+ Node* p0 = Parameter(0); |
+ Node* p1 = Parameter(1); |
+ Node* select = graph()->NewNode(common()->Select(kMachAnyTagged), |
+ FalseConstant(), p0, p1); |
+ Reduction r = Reduce(select); |
+ ASSERT_TRUE(r.Changed()); |
+ EXPECT_EQ(p1, r.replacement()); |
+} |
+ |
+ |
+TEST_F(CommonOperatorReducerTest, SelectWithTrueConstant) { |
+ Node* p0 = Parameter(0); |
+ Node* p1 = Parameter(1); |
+ Node* select = graph()->NewNode(common()->Select(kMachAnyTagged), |
+ TrueConstant(), p0, p1); |
+ Reduction r = Reduce(select); |
+ ASSERT_TRUE(r.Changed()); |
+ EXPECT_EQ(p0, r.replacement()); |
+} |
+ |
+ |
TEST_F(CommonOperatorReducerTest, SelectToFloat32Abs) { |
Node* p0 = Parameter(0); |
Node* c0 = Float32Constant(0.0); |