Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(877)

Side by Side Diff: test/compiler-unittests/common-operator-unittest.cc

Issue 479163002: [turbofan] Add new ControlEffect and Finish operators. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/compiler-unittests/common-operator-unittest.h" 5 #include "test/compiler-unittests/common-operator-unittest.h"
6 6
7 #include "src/compiler/operator-properties-inl.h" 7 #include "src/compiler/operator-properties-inl.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
11 namespace compiler { 11 namespace compiler {
12 12
13 CommonOperatorTest::CommonOperatorTest() : common_(zone()) {} 13 CommonOperatorTest::CommonOperatorTest() : common_(zone()) {}
14 14
15 15
16 CommonOperatorTest::~CommonOperatorTest() {} 16 CommonOperatorTest::~CommonOperatorTest() {}
17 17
18
19 TEST_F(CommonOperatorTest, ControlEffect) {
20 Operator* op = common()->ControlEffect();
21 EXPECT_EQ(1, OperatorProperties::GetControlInputCount(op));
22 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op));
23 EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
24 EXPECT_EQ(1, OperatorProperties::GetEffectOutputCount(op));
25 EXPECT_EQ(0, OperatorProperties::GetValueOutputCount(op));
26 }
27
28
29 TEST_F(CommonOperatorTest, Finish) {
30 static const int kArguments[] = {1, 5, 6, 42, 100, 10000, kMaxInt};
31 TRACED_FOREACH(int, arguments, kArguments) {
32 Operator* op = common()->Finish(arguments);
33 EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op));
34 EXPECT_EQ(arguments, OperatorProperties::GetEffectInputCount(op));
35 EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op));
36 EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
37 EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op));
38 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op));
39 }
40 }
41
18 } // namespace compiler 42 } // namespace compiler
19 } // namespace internal 43 } // namespace internal
20 } // namespace v8 44 } // namespace v8
OLDNEW
« no previous file with comments | « test/compiler-unittests/change-lowering-unittest.cc ('k') | test/compiler-unittests/graph-unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698