| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/node.h" | 5 #include "src/compiler/node.h" |
| 6 #include "src/compiler/schedule.h" | 6 #include "src/compiler/schedule.h" |
| 7 #include "test/unittests/test-utils.h" | 7 #include "test/unittests/test-utils.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 | 9 |
| 10 using testing::ElementsAre; | 10 using testing::ElementsAre; |
| 11 | 11 |
| 12 namespace v8 { | 12 namespace v8 { |
| 13 namespace internal { | 13 namespace internal { |
| 14 namespace compiler { | 14 namespace compiler { |
| 15 | 15 |
| 16 typedef TestWithZone BasicBlockTest; | 16 typedef TestWithIsolateAndZone BasicBlockTest; |
| 17 | 17 |
| 18 | 18 |
| 19 TEST_F(BasicBlockTest, Constructor) { | 19 TEST_F(BasicBlockTest, Constructor) { |
| 20 int const id = random_number_generator()->NextInt(); | 20 int const id = random_number_generator()->NextInt(); |
| 21 BasicBlock b(zone(), BasicBlock::Id::FromInt(id)); | 21 BasicBlock b(zone(), BasicBlock::Id::FromInt(id)); |
| 22 EXPECT_FALSE(b.deferred()); | 22 EXPECT_FALSE(b.deferred()); |
| 23 EXPECT_GT(0, b.dominator_depth()); | 23 EXPECT_GT(0, b.dominator_depth()); |
| 24 EXPECT_EQ(nullptr, b.dominator()); | 24 EXPECT_EQ(nullptr, b.dominator()); |
| 25 EXPECT_EQ(nullptr, b.rpo_next()); | 25 EXPECT_EQ(nullptr, b.rpo_next()); |
| 26 EXPECT_EQ(id, b.id().ToInt()); | 26 EXPECT_EQ(id, b.id().ToInt()); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 EXPECT_EQ(1u, end->PredecessorCount()); | 210 EXPECT_EQ(1u, end->PredecessorCount()); |
| 211 EXPECT_EQ(0u, end->SuccessorCount()); | 211 EXPECT_EQ(0u, end->SuccessorCount()); |
| 212 EXPECT_EQ(mblock, end->PredecessorAt(0)); | 212 EXPECT_EQ(mblock, end->PredecessorAt(0)); |
| 213 EXPECT_THAT(end->predecessors(), ElementsAre(mblock)); | 213 EXPECT_THAT(end->predecessors(), ElementsAre(mblock)); |
| 214 } | 214 } |
| 215 | 215 |
| 216 } // namespace compiler | 216 } // namespace compiler |
| 217 } // namespace internal | 217 } // namespace internal |
| 218 } // namespace v8 | 218 } // namespace v8 |
| OLD | NEW |