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 bafa89d581d120b7286537f07be2f8271d2fb49f..1dbaa9f60a37796c103c843ebd525469b33049fd 100644 |
--- a/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc |
+++ b/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc |
@@ -815,6 +815,36 @@ TEST_F(InstructionSelectorTest, Word32Clz) { |
EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
} |
+ |
+TEST_F(InstructionSelectorTest, Float32Abs) { |
+ StreamBuilder m(this, kMachFloat32, kMachFloat32); |
+ Node* const p0 = m.Parameter(0); |
+ Node* const n = m.Float32Abs(p0); |
+ m.Return(n); |
+ Stream s = m.Build(); |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kMipsAbsS, s[0]->arch_opcode()); |
+ ASSERT_EQ(1U, s[0]->InputCount()); |
+ EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
+ ASSERT_EQ(1U, s[0]->OutputCount()); |
+ EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
+} |
+ |
+ |
+TEST_F(InstructionSelectorTest, Float64Abs) { |
+ StreamBuilder m(this, kMachFloat64, kMachFloat64); |
+ Node* const p0 = m.Parameter(0); |
+ Node* const n = m.Float64Abs(p0); |
+ m.Return(n); |
+ Stream s = m.Build(); |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kMipsAbsD, s[0]->arch_opcode()); |
+ ASSERT_EQ(1U, s[0]->InputCount()); |
+ EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
+ ASSERT_EQ(1U, s[0]->OutputCount()); |
+ EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
+} |
+ |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |