Index: test/unittests/compiler/machine-operator-reducer-unittest.cc |
diff --git a/test/unittests/compiler/machine-operator-reducer-unittest.cc b/test/unittests/compiler/machine-operator-reducer-unittest.cc |
index b81ec2f3c568d41af52fa2a45f811ed851716408..127ddf355718cf677ce26f9a9630fc65fa39e63c 100644 |
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc |
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc |
@@ -1772,6 +1772,37 @@ TEST_F(MachineOperatorReducerTest, Float64Log1pWithConstant) { |
} |
// ----------------------------------------------------------------------------- |
+// Float64Pow |
+ |
+TEST_F(MachineOperatorReducerTest, Float64PowWithConstant) { |
+ TRACED_FOREACH(double, x, kFloat64Values) { |
+ TRACED_FOREACH(double, y, kFloat64Values) { |
+ Reduction const r = Reduce(graph()->NewNode( |
+ machine()->Float64Pow(), Float64Constant(x), Float64Constant(y))); |
+ ASSERT_TRUE(r.Changed()); |
+ EXPECT_THAT(r.replacement(), |
+ IsFloat64Constant(NanSensitiveDoubleEq(Pow(x, y)))); |
+ } |
+ } |
+} |
+ |
+TEST_F(MachineOperatorReducerTest, Float64PowWithZeroExponent) { |
+ Node* const p0 = Parameter(0); |
+ { |
+ Reduction const r = Reduce( |
+ graph()->NewNode(machine()->Float64Pow(), p0, Float64Constant(-0.0))); |
+ ASSERT_TRUE(r.Changed()); |
+ EXPECT_THAT(r.replacement(), IsFloat64Constant(1.0)); |
+ } |
+ { |
+ Reduction const r = Reduce( |
+ graph()->NewNode(machine()->Float64Pow(), p0, Float64Constant(0.0))); |
+ ASSERT_TRUE(r.Changed()); |
+ EXPECT_THAT(r.replacement(), IsFloat64Constant(1.0)); |
+ } |
+} |
+ |
+// ----------------------------------------------------------------------------- |
// Float64Sin |
TEST_F(MachineOperatorReducerTest, Float64SinWithConstant) { |