OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "test/compiler-unittests/instruction-selector-unittest.h" |
| 6 |
| 7 namespace v8 { |
| 8 namespace internal { |
| 9 namespace compiler { |
| 10 |
| 11 // ----------------------------------------------------------------------------- |
| 12 // Conversions. |
| 13 |
| 14 |
| 15 TEST_F(InstructionSelectorTest, ChangeInt32ToInt64WithParameter) { |
| 16 StreamBuilder m(this, kMachInt64, kMachInt32); |
| 17 m.Return(m.ChangeInt32ToInt64(m.Parameter(0))); |
| 18 Stream s = m.Build(); |
| 19 ASSERT_EQ(1U, s.size()); |
| 20 EXPECT_EQ(kX64Movsxlq, s[0]->arch_opcode()); |
| 21 } |
| 22 |
| 23 |
| 24 TEST_F(InstructionSelectorTest, ChangeUint32ToUint64WithParameter) { |
| 25 StreamBuilder m(this, kMachUint64, kMachUint32); |
| 26 m.Return(m.ChangeUint32ToUint64(m.Parameter(0))); |
| 27 Stream s = m.Build(); |
| 28 ASSERT_EQ(1U, s.size()); |
| 29 EXPECT_EQ(kX64Movl, s[0]->arch_opcode()); |
| 30 } |
| 31 |
| 32 |
| 33 TEST_F(InstructionSelectorTest, TruncateInt64ToInt32WithParameter) { |
| 34 StreamBuilder m(this, kMachInt32, kMachInt64); |
| 35 m.Return(m.TruncateInt64ToInt32(m.Parameter(0))); |
| 36 Stream s = m.Build(); |
| 37 ASSERT_EQ(1U, s.size()); |
| 38 EXPECT_EQ(kX64Movl, s[0]->arch_opcode()); |
| 39 } |
| 40 |
| 41 } // namespace compiler |
| 42 } // namespace internal |
| 43 } // namespace v8 |
OLD | NEW |