| Index: test/unittests/compiler/js-typed-lowering-unittest.cc
|
| diff --git a/test/unittests/compiler/js-typed-lowering-unittest.cc b/test/unittests/compiler/js-typed-lowering-unittest.cc
|
| index 97ff106329770269274b74bfeef435ed7e63e0a3..af70284aef96b1a04ae1949f35512767ccb3baac 100644
|
| --- a/test/unittests/compiler/js-typed-lowering-unittest.cc
|
| +++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
|
| @@ -397,6 +397,51 @@ TEST_F(JSTypedLoweringTest, JSStrictEqualWithTheHole) {
|
|
|
|
|
| // -----------------------------------------------------------------------------
|
| +// JSBitwiseAnd
|
| +
|
| +
|
| +TEST_F(JSTypedLoweringTest, JSBitwiseAndWithBitish) {
|
| + Node* const context = Parameter(Type::Any(), 2);
|
| + Node* const effect = graph()->start();
|
| + Node* const control = graph()->start();
|
| + Handle<Object> zero = factory()->NewNumber(0);
|
| + Handle<Object> one = factory()->NewNumber(1);
|
| + {
|
| + Node* const lhs = Parameter(Type::Range(one, one, zone()), 0);
|
| + Node* const rhs = Parameter(Type::Range(zero, one, zone()), 1);
|
| + Reduction r = Reduce(graph()->NewNode(javascript()->BitwiseAnd(), lhs, rhs,
|
| + context, effect, control));
|
| + ASSERT_TRUE(r.Changed());
|
| + EXPECT_EQ(rhs, r.replacement());
|
| + }
|
| + {
|
| + Node* const lhs = Parameter(Type::Range(one, one, zone()), 0);
|
| + Node* const rhs = Parameter(Type::Boolean(), 1);
|
| + Reduction r = Reduce(graph()->NewNode(javascript()->BitwiseAnd(), lhs, rhs,
|
| + context, effect, control));
|
| + ASSERT_TRUE(r.Changed());
|
| + EXPECT_THAT(r.replacement(), IsBooleanToNumber(rhs));
|
| + }
|
| + {
|
| + Node* const lhs = Parameter(Type::Range(zero, one, zone()), 0);
|
| + Node* const rhs = Parameter(Type::Range(one, one, zone()), 1);
|
| + Reduction r = Reduce(graph()->NewNode(javascript()->BitwiseAnd(), lhs, rhs,
|
| + context, effect, control));
|
| + ASSERT_TRUE(r.Changed());
|
| + EXPECT_EQ(lhs, r.replacement());
|
| + }
|
| + {
|
| + Node* const lhs = Parameter(Type::Boolean(), 0);
|
| + Node* const rhs = Parameter(Type::Range(one, one, zone()), 1);
|
| + Reduction r = Reduce(graph()->NewNode(javascript()->BitwiseAnd(), lhs, rhs,
|
| + context, effect, control));
|
| + ASSERT_TRUE(r.Changed());
|
| + EXPECT_THAT(r.replacement(), IsBooleanToNumber(lhs));
|
| + }
|
| +}
|
| +
|
| +
|
| +// -----------------------------------------------------------------------------
|
| // JSShiftLeft
|
|
|
|
|
|
|