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/operator.h" | 6 #include "src/compiler/operator.h" |
7 #include "test/unittests/test-utils.h" | 7 #include "test/unittests/test-utils.h" |
8 #include "testing/gmock-support.h" | 8 #include "testing/gmock-support.h" |
9 | 9 |
| 10 using testing::Contains; |
10 using testing::ElementsAre; | 11 using testing::ElementsAre; |
| 12 using testing::ElementsAreArray; |
11 using testing::UnorderedElementsAre; | 13 using testing::UnorderedElementsAre; |
12 | 14 |
13 namespace v8 { | 15 namespace v8 { |
14 namespace internal { | 16 namespace internal { |
15 namespace compiler { | 17 namespace compiler { |
16 | 18 |
17 typedef TestWithZone NodeTest; | 19 typedef TestWithZone NodeTest; |
18 | 20 |
19 | 21 |
20 namespace { | 22 namespace { |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 inputs[i] = i & 1 ? n0 : n1; | 247 inputs[i] = i & 1 ? n0 : n1; |
246 } | 248 } |
247 | 249 |
248 for (int size = 13; size <= kMaxSize; size += 9) { | 250 for (int size = 13; size <= kMaxSize; size += 9) { |
249 Node* node = Node::New(zone(), 12345, &kOp0, size, inputs, false); | 251 Node* node = Node::New(zone(), 12345, &kOp0, size, inputs, false); |
250 EXPECT_EQ(size, node->InputCount()); | 252 EXPECT_EQ(size, node->InputCount()); |
251 | 253 |
252 for (int i = 0; i < size; i++) { | 254 for (int i = 0; i < size; i++) { |
253 EXPECT_EQ(inputs[i], node->InputAt(i)); | 255 EXPECT_EQ(inputs[i], node->InputAt(i)); |
254 } | 256 } |
| 257 |
| 258 EXPECT_THAT(n0->uses(), Contains(node)); |
| 259 EXPECT_THAT(n1->uses(), Contains(node)); |
| 260 EXPECT_THAT(node->inputs(), ElementsAreArray(inputs, size)); |
255 } | 261 } |
256 } | 262 } |
257 | 263 |
258 | 264 |
259 } // namespace compiler | 265 } // namespace compiler |
260 } // namespace internal | 266 } // namespace internal |
261 } // namespace v8 | 267 } // namespace v8 |
OLD | NEW |