OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "src/compiler/common-operator.h" |
| 6 #include "src/compiler/node-properties-inl.h" |
| 7 #include "test/unittests/test-utils.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 |
| 10 using testing::IsNull; |
| 11 |
| 12 namespace v8 { |
| 13 namespace internal { |
| 14 namespace compiler { |
| 15 |
| 16 typedef TestWithZone NodePropertiesTest; |
| 17 |
| 18 |
| 19 TEST_F(NodePropertiesTest, FindProjection) { |
| 20 CommonOperatorBuilder common(zone()); |
| 21 Node* start = Node::New(zone(), 0, common.Start(1), 0, nullptr, false); |
| 22 Node* proj0 = Node::New(zone(), 1, common.Projection(0), 1, &start, false); |
| 23 Node* proj1 = Node::New(zone(), 2, common.Projection(1), 1, &start, false); |
| 24 EXPECT_EQ(proj0, NodeProperties::FindProjection(start, 0)); |
| 25 EXPECT_EQ(proj1, NodeProperties::FindProjection(start, 1)); |
| 26 EXPECT_THAT(NodeProperties::FindProjection(start, 2), IsNull()); |
| 27 EXPECT_THAT(NodeProperties::FindProjection(start, 1234567890), IsNull()); |
| 28 } |
| 29 |
| 30 } // namespace compiler |
| 31 } // namespace internal |
| 32 } // namespace v8 |
OLD | NEW |