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 "testing/gtest-support.h" | 7 #include "testing/gtest-support.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
11 namespace compiler { | 11 namespace compiler { |
12 | 12 |
13 #if GTEST_HAS_COMBINE | 13 #if GTEST_HAS_COMBINE |
14 | 14 |
15 // TODO(bmeurer): Find a new home for these. | |
16 inline std::ostream& operator<<(std::ostream& os, const MachineType& type) { | |
17 OStringStream ost; | |
18 ost << type; | |
19 return os << ost.c_str(); | |
20 } | |
21 inline std::ostream& operator<<(std::ostream& os, | |
22 const WriteBarrierKind& write_barrier_kind) { | |
23 OStringStream ost; | |
24 ost << write_barrier_kind; | |
25 return os << ost.c_str(); | |
26 } | |
27 | |
28 | |
29 template <typename T> | 15 template <typename T> |
30 class MachineOperatorTestWithParam | 16 class MachineOperatorTestWithParam |
31 : public ::testing::TestWithParam< ::testing::tuple<MachineType, T> > { | 17 : public ::testing::TestWithParam< ::testing::tuple<MachineType, T> > { |
32 protected: | 18 protected: |
33 MachineType type() const { return ::testing::get<0>(B::GetParam()); } | 19 MachineType type() const { return ::testing::get<0>(B::GetParam()); } |
34 const T& GetParam() const { return ::testing::get<1>(B::GetParam()); } | 20 const T& GetParam() const { return ::testing::get<1>(B::GetParam()); } |
35 | 21 |
36 private: | 22 private: |
37 typedef ::testing::TestWithParam< ::testing::tuple<MachineType, T> > B; | 23 typedef ::testing::TestWithParam< ::testing::tuple<MachineType, T> > B; |
38 }; | 24 }; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 EXPECT_EQ(machine.Int64UDiv(), machine.IntUDiv()); | 302 EXPECT_EQ(machine.Int64UDiv(), machine.IntUDiv()); |
317 EXPECT_EQ(machine.Int64Mod(), machine.IntMod()); | 303 EXPECT_EQ(machine.Int64Mod(), machine.IntMod()); |
318 EXPECT_EQ(machine.Int64UMod(), machine.IntUMod()); | 304 EXPECT_EQ(machine.Int64UMod(), machine.IntUMod()); |
319 EXPECT_EQ(machine.Int64LessThan(), machine.IntLessThan()); | 305 EXPECT_EQ(machine.Int64LessThan(), machine.IntLessThan()); |
320 EXPECT_EQ(machine.Int64LessThanOrEqual(), machine.IntLessThanOrEqual()); | 306 EXPECT_EQ(machine.Int64LessThanOrEqual(), machine.IntLessThanOrEqual()); |
321 } | 307 } |
322 | 308 |
323 } // namespace compiler | 309 } // namespace compiler |
324 } // namespace internal | 310 } // namespace internal |
325 } // namespace v8 | 311 } // namespace v8 |
OLD | NEW |