Index: test/cctest/compiler/test-machine-operator-reducer.cc |
diff --git a/test/cctest/compiler/test-machine-operator-reducer.cc b/test/cctest/compiler/test-machine-operator-reducer.cc |
index 562766230d16d4a060642d24b3f2568061ad7efa..bcd68356e84db18c0f841d730592b7de77450293 100644 |
--- a/test/cctest/compiler/test-machine-operator-reducer.cc |
+++ b/test/cctest/compiler/test-machine-operator-reducer.cc |
@@ -30,6 +30,22 @@ Operator* NewConstantOperator<double>(CommonOperatorBuilder* common, |
} |
+template <typename T> |
+T ValueOfOperator(const Operator* op); |
+ |
+template <> |
+int32_t ValueOfOperator<int32_t>(const Operator* op) { |
+ CHECK_EQ(IrOpcode::kInt32Constant, op->opcode()); |
+ return OpParameter<int32_t>(op); |
+} |
+ |
+template <> |
+double ValueOfOperator<double>(const Operator* op) { |
+ CHECK_EQ(IrOpcode::kFloat64Constant, op->opcode()); |
+ return OpParameter<double>(op); |
+} |
+ |
+ |
class ReducerTester : public HandleAndZoneScope { |
public: |
explicit ReducerTester(int num_parameters = 0) |
@@ -61,6 +77,11 @@ class ReducerTester : public HandleAndZoneScope { |
return graph.NewNode(NewConstantOperator<T>(&common, value)); |
} |
+ template <typename T> |
+ const T ValueOf(const Operator* op) { |
+ return ValueOfOperator<T>(op); |
+ } |
+ |
// Check that the reduction of this binop applied to constants {a} and {b} |
// yields the {expect} value. |
template <typename T> |