Index: test/unittests/compiler/mips/instruction-selector-mips-unittest.cc |
diff --git a/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc b/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc |
index ec0474e40885cc33658152e552e5c85b8e7091c9..7d580bc2518eee486083ac129cde932a2b742bb1 100644 |
--- a/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc |
+++ b/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc |
@@ -336,6 +336,25 @@ TEST_F(InstructionSelectorTest, Word32ShrWithWord32AndWithImmediate) { |
} |
+TEST_F(InstructionSelectorTest, Word32ShlWithWord32And) { |
+ TRACED_FORRANGE(int32_t, shift, 0, 30) { |
+ StreamBuilder m(this, kMachInt32, kMachInt32); |
+ Node* const p0 = m.Parameter(0); |
+ Node* const r = |
+ m.Word32Shl(m.Word32And(p0, m.Int32Constant((1 << (31 - shift)) - 1)), |
+ m.Int32Constant(shift + 1)); |
+ m.Return(r); |
+ Stream s = m.Build(); |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kMipsShl, s[0]->arch_opcode()); |
+ ASSERT_EQ(2U, s[0]->InputCount()); |
+ EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
+ ASSERT_EQ(1U, s[0]->OutputCount()); |
+ EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output())); |
+ } |
+} |
+ |
+ |
// ---------------------------------------------------------------------------- |
// Logical instructions. |
// ---------------------------------------------------------------------------- |