| Index: test/unittests/compiler/js-builtin-reducer-unittest.cc
|
| diff --git a/test/unittests/compiler/js-builtin-reducer-unittest.cc b/test/unittests/compiler/js-builtin-reducer-unittest.cc
|
| index 017016be01163d5bddbfaad933a091732197aeac..552365b5cfca0c5ed0b7ad7d4a6b97ce89d04141 100644
|
| --- a/test/unittests/compiler/js-builtin-reducer-unittest.cc
|
| +++ b/test/unittests/compiler/js-builtin-reducer-unittest.cc
|
| @@ -203,6 +203,53 @@ TEST_F(JSBuiltinReducerTest, MathFround) {
|
| }
|
|
|
| // -----------------------------------------------------------------------------
|
| +// Math.atan
|
| +
|
| +TEST_F(JSBuiltinReducerTest, MathAtan) {
|
| + Node* function = MathFunction("atan");
|
| +
|
| + Node* effect = graph()->start();
|
| + Node* control = graph()->start();
|
| + Node* context = UndefinedConstant();
|
| + Node* frame_state = graph()->start();
|
| + TRACED_FOREACH(Type*, t0, kNumberTypes) {
|
| + Node* p0 = Parameter(t0, 0);
|
| + Node* call = graph()->NewNode(javascript()->CallFunction(3), function,
|
| + UndefinedConstant(), p0, context, frame_state,
|
| + effect, control);
|
| + Reduction r = Reduce(call);
|
| +
|
| + ASSERT_TRUE(r.Changed());
|
| + EXPECT_THAT(r.replacement(), IsNumberAtan(p0));
|
| + }
|
| +}
|
| +
|
| +// -----------------------------------------------------------------------------
|
| +// Math.atan2
|
| +
|
| +TEST_F(JSBuiltinReducerTest, MathAtan2) {
|
| + Node* function = MathFunction("atan2");
|
| +
|
| + Node* effect = graph()->start();
|
| + Node* control = graph()->start();
|
| + Node* context = UndefinedConstant();
|
| + Node* frame_state = graph()->start();
|
| + TRACED_FOREACH(Type*, t0, kNumberTypes) {
|
| + Node* p0 = Parameter(t0, 0);
|
| + TRACED_FOREACH(Type*, t1, kNumberTypes) {
|
| + Node* p1 = Parameter(t1, 0);
|
| + Node* call = graph()->NewNode(javascript()->CallFunction(4), function,
|
| + UndefinedConstant(), p0, p1, context,
|
| + frame_state, effect, control);
|
| + Reduction r = Reduce(call);
|
| +
|
| + ASSERT_TRUE(r.Changed());
|
| + EXPECT_THAT(r.replacement(), IsNumberAtan2(p0, p1));
|
| + }
|
| + }
|
| +}
|
| +
|
| +// -----------------------------------------------------------------------------
|
| // Math.log
|
|
|
| TEST_F(JSBuiltinReducerTest, MathLog) {
|
|
|