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/machine-operator.h" | 5 #include "src/compiler/machine-operator.h" |
6 #include "src/compiler/operator-properties-inl.h" | 6 #include "src/compiler/operator-properties-inl.h" |
7 #include "test/compiler-unittests/compiler-unittests.h" | 7 #include "test/compiler-unittests/compiler-unittests.h" |
8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
9 | 9 |
10 using testing::IsNull; | 10 using testing::IsNull; |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 namespace compiler { | 14 namespace compiler { |
15 | 15 |
16 class MachineOperatorCommonTest : public CompilerTestWithParam<MachineType> { | 16 class MachineOperatorCommonTest : public CompilerTestWithParam<MachineType> { |
17 public: | 17 public: |
18 MachineOperatorCommonTest() : machine_(NULL) {} | 18 MachineOperatorCommonTest() : machine_(NULL) {} |
19 virtual ~MachineOperatorCommonTest() { EXPECT_THAT(machine_, IsNull()); } | 19 virtual ~MachineOperatorCommonTest() { EXPECT_THAT(machine_, IsNull()); } |
20 | 20 |
21 virtual void SetUp() V8_OVERRIDE { | 21 virtual void SetUp() V8_OVERRIDE { |
22 CompilerTestWithParam::SetUp(); | 22 CompilerTestWithParam<MachineType>::SetUp(); |
23 machine_ = new MachineOperatorBuilder(zone(), GetParam()); | 23 machine_ = new MachineOperatorBuilder(zone(), GetParam()); |
24 } | 24 } |
25 | 25 |
26 virtual void TearDown() V8_OVERRIDE { | 26 virtual void TearDown() V8_OVERRIDE { |
27 delete machine_; | 27 delete machine_; |
28 machine_ = NULL; | 28 machine_ = NULL; |
29 CompilerTestWithParam::TearDown(); | 29 CompilerTestWithParam<MachineType>::TearDown(); |
30 } | 30 } |
31 | 31 |
32 protected: | 32 protected: |
33 MachineOperatorBuilder* machine() const { return machine_; } | 33 MachineOperatorBuilder* machine() const { return machine_; } |
34 | 34 |
35 private: | 35 private: |
36 MachineOperatorBuilder* machine_; | 36 MachineOperatorBuilder* machine_; |
37 }; | 37 }; |
38 | 38 |
39 | 39 |
(...skipping 26 matching lines...) Expand all Loading... |
66 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op)); | 66 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op)); |
67 } | 67 } |
68 | 68 |
69 | 69 |
70 INSTANTIATE_TEST_CASE_P(MachineOperatorTest, MachineOperatorCommonTest, | 70 INSTANTIATE_TEST_CASE_P(MachineOperatorTest, MachineOperatorCommonTest, |
71 ::testing::Values(kRepWord32, kRepWord64)); | 71 ::testing::Values(kRepWord32, kRepWord64)); |
72 | 72 |
73 } // namespace compiler | 73 } // namespace compiler |
74 } // namespace internal | 74 } // namespace internal |
75 } // namespace v8 | 75 } // namespace v8 |
OLD | NEW |