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::ElementsAre; | 10 using testing::ElementsAre; |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 const Operator kOp0(kOpcode0, Operator::kNoProperties, "Op0", 0, 0, 0, 1, 0, 0); | 26 const Operator kOp0(kOpcode0, Operator::kNoProperties, "Op0", 0, 0, 0, 1, 0, 0); |
27 const Operator kOp1(kOpcode1, Operator::kNoProperties, "Op1", 1, 0, 0, 1, 0, 0); | 27 const Operator kOp1(kOpcode1, Operator::kNoProperties, "Op1", 1, 0, 0, 1, 0, 0); |
28 const Operator kOp2(kOpcode2, Operator::kNoProperties, "Op2", 2, 0, 0, 1, 0, 0); | 28 const Operator kOp2(kOpcode2, Operator::kNoProperties, "Op2", 2, 0, 0, 1, 0, 0); |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 | 32 |
33 TEST_F(NodeTest, New) { | 33 TEST_F(NodeTest, New) { |
34 Node* const node = Node::New(zone(), 1, &kOp0, 0, nullptr, false); | 34 Node* const node = Node::New(zone(), 1, &kOp0, 0, nullptr, false); |
35 EXPECT_EQ(1, node->id()); | 35 EXPECT_EQ(1U, node->id()); |
36 EXPECT_EQ(0, node->UseCount()); | 36 EXPECT_EQ(0, node->UseCount()); |
37 EXPECT_TRUE(node->uses().empty()); | 37 EXPECT_TRUE(node->uses().empty()); |
38 EXPECT_EQ(0, node->InputCount()); | 38 EXPECT_EQ(0, node->InputCount()); |
39 EXPECT_TRUE(node->inputs().empty()); | 39 EXPECT_TRUE(node->inputs().empty()); |
40 EXPECT_EQ(&kOp0, node->op()); | 40 EXPECT_EQ(&kOp0, node->op()); |
41 EXPECT_EQ(kOpcode0, node->opcode()); | 41 EXPECT_EQ(kOpcode0, node->opcode()); |
42 } | 42 } |
43 | 43 |
44 | 44 |
45 TEST_F(NodeTest, NewWithInputs) { | 45 TEST_F(NodeTest, NewWithInputs) { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 for (int i = 0; i < size; i++) { | 252 for (int i = 0; i < size; i++) { |
253 EXPECT_EQ(inputs[i], node->InputAt(i)); | 253 EXPECT_EQ(inputs[i], node->InputAt(i)); |
254 } | 254 } |
255 } | 255 } |
256 } | 256 } |
257 | 257 |
258 | 258 |
259 } // namespace compiler | 259 } // namespace compiler |
260 } // namespace internal | 260 } // namespace internal |
261 } // namespace v8 | 261 } // namespace v8 |
OLD | NEW |