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 "test/unittests/compiler/graph-unittest.h" | 5 #include "test/unittests/compiler/graph-unittest.h" |
6 | 6 |
7 #include "src/compiler/node-properties-inl.h" | 7 #include "src/compiler/node-properties-inl.h" |
8 #include "test/unittests/compiler/node-test-utils.h" | 8 #include "test/unittests/compiler/node-test-utils.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 TypedGraphTest::~TypedGraphTest() {} | 99 TypedGraphTest::~TypedGraphTest() {} |
100 | 100 |
101 | 101 |
102 Node* TypedGraphTest::Parameter(Type* type, int32_t index) { | 102 Node* TypedGraphTest::Parameter(Type* type, int32_t index) { |
103 Node* node = GraphTest::Parameter(index); | 103 Node* node = GraphTest::Parameter(index); |
104 NodeProperties::SetBounds(node, Bounds(type)); | 104 NodeProperties::SetBounds(node, Bounds(type)); |
105 return node; | 105 return node; |
106 } | 106 } |
107 | 107 |
| 108 |
| 109 namespace { |
| 110 |
| 111 const Operator kDummyOperator(0, Operator::kNoProperties, "Dummy", 0, 0, 0, 1, |
| 112 0, 0); |
| 113 |
| 114 } // namespace |
| 115 |
| 116 |
| 117 TEST_F(GraphTest, NewNode) { |
| 118 Node* n0 = graph()->NewNode(&kDummyOperator); |
| 119 Node* n1 = graph()->NewNode(&kDummyOperator); |
| 120 EXPECT_NE(n0, n1); |
| 121 EXPECT_LT(0, n0->id()); |
| 122 EXPECT_LT(0, n1->id()); |
| 123 EXPECT_NE(n0->id(), n1->id()); |
| 124 EXPECT_EQ(&kDummyOperator, n0->op()); |
| 125 EXPECT_EQ(&kDummyOperator, n1->op()); |
| 126 } |
| 127 |
108 } // namespace compiler | 128 } // namespace compiler |
109 } // namespace internal | 129 } // namespace internal |
110 } // namespace v8 | 130 } // namespace v8 |
OLD | NEW |