Index: test/compiler-unittests/x64/instruction-selector-x64-unittest.cc |
diff --git a/test/compiler-unittests/x64/instruction-selector-x64-unittest.cc b/test/compiler-unittests/x64/instruction-selector-x64-unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4e5c65527697af91f233b4dc0464b834df6364b8 |
--- /dev/null |
+++ b/test/compiler-unittests/x64/instruction-selector-x64-unittest.cc |
@@ -0,0 +1,43 @@ |
+// Copyright 2014 the V8 project authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "test/compiler-unittests/instruction-selector-unittest.h" |
+ |
+namespace v8 { |
+namespace internal { |
+namespace compiler { |
+ |
+// ----------------------------------------------------------------------------- |
+// Conversions. |
+ |
+ |
+TEST_F(InstructionSelectorTest, ChangeInt32ToInt64WithParameter) { |
+ StreamBuilder m(this, kMachInt64, kMachInt32); |
+ m.Return(m.ChangeInt32ToInt64(m.Parameter(0))); |
+ Stream s = m.Build(); |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kX64Movsxlq, s[0]->arch_opcode()); |
+} |
+ |
+ |
+TEST_F(InstructionSelectorTest, ChangeUint32ToUint64WithParameter) { |
+ StreamBuilder m(this, kMachUint64, kMachUint32); |
+ m.Return(m.ChangeUint32ToUint64(m.Parameter(0))); |
+ Stream s = m.Build(); |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kX64Movl, s[0]->arch_opcode()); |
+} |
+ |
+ |
+TEST_F(InstructionSelectorTest, TruncateInt64ToInt32WithParameter) { |
+ StreamBuilder m(this, kMachInt32, kMachInt64); |
+ m.Return(m.TruncateInt64ToInt32(m.Parameter(0))); |
+ Stream s = m.Build(); |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(kX64Movl, s[0]->arch_opcode()); |
+} |
+ |
+} // namespace compiler |
+} // namespace internal |
+} // namespace v8 |