Chromium Code Reviews| Index: src/compiler/js-builtin-reducer-unittest.cc |
| diff --git a/src/compiler/js-builtin-reducer-unittest.cc b/src/compiler/js-builtin-reducer-unittest.cc |
| index 557ce27fa3911d3931ea65281b57c7ada5160a95..998cab998d6258017ed32cb4c5a19f675910b3c6 100644 |
| --- a/src/compiler/js-builtin-reducer-unittest.cc |
| +++ b/src/compiler/js-builtin-reducer-unittest.cc |
| @@ -60,6 +60,26 @@ Type* const kNumberTypes[] = { |
| // ----------------------------------------------------------------------------- |
| +// Math.sqrt |
| + |
| + |
| +TEST_F(JSBuiltinReducerTest, MathSqrt) { |
| + Handle<JSFunction> f(isolate()->context()->math_sqrt_fun()); |
| + |
| + TRACED_FOREACH(Type*, t0, kNumberTypes) { |
| + Node* p0 = Parameter(t0, 0); |
| + Node* fun = HeapConstant(Unique<HeapObject>::CreateUninitialized(f)); |
| + Node* call = graph()->NewNode(javascript()->Call(3, NO_CALL_FUNCTION_FLAGS), |
| + fun, UndefinedConstant(), p0); |
| + Reduction r = Reduce(call); |
| + |
| + EXPECT_TRUE(r.Changed()); |
|
Benedikt Meurer
2014/09/24 06:34:43
Nit: use ASSERT_TRUE, doesn't make sense to do the
Michael Starzinger
2014/09/24 08:20:51
Done, here and at all occurrences below.
|
| + EXPECT_THAT(r.replacement(), IsFloat64Sqrt(p0)); |
| + } |
| +} |
| + |
| + |
| +// ----------------------------------------------------------------------------- |
| // Math.max |