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

Side by Side Diff: src/compiler/machine-operator-reducer-unittest.cc

Issue 540823002: Refactor common unit test code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes Created 6 years, 3 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 "src/base/bits.h" 5 #include "src/base/bits.h"
6 #include "src/compiler/graph-unittest.h" 6 #include "src/compiler/graph-unittest.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/machine-operator-reducer.h" 8 #include "src/compiler/machine-operator-reducer.h"
9 #include "src/compiler/typer.h" 9 #include "src/compiler/typer.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 namespace compiler { 13 namespace compiler {
14 14
15 class MachineOperatorReducerTest : public GraphTest { 15 class MachineOperatorReducerTest : public GraphTest {
16 public: 16 public:
17 explicit MachineOperatorReducerTest(int num_parameters = 2) 17 explicit MachineOperatorReducerTest(int num_parameters = 2)
18 : GraphTest(num_parameters), machine_(zone()) {} 18 : GraphTest(num_parameters), machine_(zone()) {}
19 virtual ~MachineOperatorReducerTest() {}
20 19
21 protected: 20 protected:
22 Reduction Reduce(Node* node) { 21 Reduction Reduce(Node* node) {
23 Typer typer(zone()); 22 Typer typer(zone());
24 JSGraph jsgraph(graph(), common(), &typer); 23 JSGraph jsgraph(graph(), common(), &typer);
25 MachineOperatorReducer reducer(&jsgraph); 24 MachineOperatorReducer reducer(&jsgraph);
26 return reducer.Reduce(node); 25 return reducer.Reduce(node);
27 } 26 }
28 27
29 MachineOperatorBuilder* machine() { return &machine_; } 28 MachineOperatorBuilder* machine() { return &machine_; }
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 EXPECT_TRUE(reduction.Changed()); 437 EXPECT_TRUE(reduction.Changed());
439 EXPECT_THAT(reduction.replacement(), 438 EXPECT_THAT(reduction.replacement(),
440 IsInt32Constant(base::bits::RotateRight32(x, y))); 439 IsInt32Constant(base::bits::RotateRight32(x, y)));
441 } 440 }
442 } 441 }
443 } 442 }
444 443
445 } // namespace compiler 444 } // namespace compiler
446 } // namespace internal 445 } // namespace internal
447 } // namespace v8 446 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector-unittest.cc ('k') | src/compiler/machine-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698