| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/instruction-selector-unittest.h" | 5 #include "src/compiler/instruction-selector-unittest.h" |
| 6 | 6 |
| 7 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 namespace compiler { | 9 namespace compiler { |
| 10 | 10 |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 Node* param = m.Parameter(0); | 497 Node* param = m.Parameter(0); |
| 498 Node* mult = m.Int32Mul(param, m.Int32Constant(m_param.value)); | 498 Node* mult = m.Int32Mul(param, m.Int32Constant(m_param.value)); |
| 499 m.Return(mult); | 499 m.Return(mult); |
| 500 Stream s = m.Build(); | 500 Stream s = m.Build(); |
| 501 ASSERT_EQ(1U, s.size()); | 501 ASSERT_EQ(1U, s.size()); |
| 502 EXPECT_EQ(m_param.addressing_mode, s[0]->addressing_mode()); | 502 EXPECT_EQ(m_param.addressing_mode, s[0]->addressing_mode()); |
| 503 if (m_param.lea_expected) { | 503 if (m_param.lea_expected) { |
| 504 EXPECT_EQ(kIA32Lea, s[0]->arch_opcode()); | 504 EXPECT_EQ(kIA32Lea, s[0]->arch_opcode()); |
| 505 ASSERT_EQ(InputCountForLea(s[0]->addressing_mode()), s[0]->InputCount()); | 505 ASSERT_EQ(InputCountForLea(s[0]->addressing_mode()), s[0]->InputCount()); |
| 506 } else { | 506 } else { |
| 507 EXPECT_EQ(kIA32Lea, s[0]->arch_opcode()); | 507 EXPECT_EQ(kIA32Imul, s[0]->arch_opcode()); |
| 508 ASSERT_EQ(2U, s[0]->InputCount()); | 508 ASSERT_EQ(2U, s[0]->InputCount()); |
| 509 } | 509 } |
| 510 EXPECT_EQ(param->id(), s.ToVreg(s[0]->InputAt(0))); | 510 EXPECT_EQ(param->id(), s.ToVreg(s[0]->InputAt(0))); |
| 511 } | 511 } |
| 512 | 512 |
| 513 |
| 514 INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, InstructionSelectorMultTest, |
| 515 ::testing::ValuesIn(kMultParams)); |
| 516 |
| 513 } // namespace compiler | 517 } // namespace compiler |
| 514 } // namespace internal | 518 } // namespace internal |
| 515 } // namespace v8 | 519 } // namespace v8 |
| OLD | NEW |