Index: test/compiler-unittests/instruction-selector-unittest.cc |
diff --git a/test/compiler-unittests/instruction-selector-unittest.cc b/test/compiler-unittests/instruction-selector-unittest.cc |
index 91ae7cdd320667c7bf068e4f98c625c9c615ad55..d6fef2e8070d02d43882a42ac10f060019fe9d10 100644 |
--- a/test/compiler-unittests/instruction-selector-unittest.cc |
+++ b/test/compiler-unittests/instruction-selector-unittest.cc |
@@ -71,6 +71,10 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build( |
} |
+// ----------------------------------------------------------------------------- |
+// Return. |
+ |
+ |
TARGET_TEST_F(InstructionSelectorTest, ReturnParameter) { |
StreamBuilder m(this, kMachInt32, kMachInt32); |
m.Return(m.Parameter(0)); |
@@ -96,6 +100,23 @@ TARGET_TEST_F(InstructionSelectorTest, ReturnZero) { |
EXPECT_EQ(1U, s[1]->InputCount()); |
} |
+ |
+// ----------------------------------------------------------------------------- |
+// Conversions. |
+ |
+ |
+TARGET_TEST_F(InstructionSelectorTest, TruncateFloat64ToInt32WithParameter) { |
+ StreamBuilder m(this, kMachInt32, kMachFloat64); |
+ m.Return(m.TruncateFloat64ToInt32(m.Parameter(0))); |
+ Stream s = m.Build(kAllInstructions); |
+ ASSERT_EQ(3U, s.size()); |
+ EXPECT_EQ(kArchNop, s[0]->arch_opcode()); |
+ EXPECT_EQ(kArchTruncateDoubleToI, s[1]->arch_opcode()); |
+ EXPECT_EQ(1U, s[1]->InputCount()); |
+ EXPECT_EQ(1U, s[1]->OutputCount()); |
+ EXPECT_EQ(kArchRet, s[2]->arch_opcode()); |
+} |
+ |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |