#include "src/compiler/machine-operator.h"
#include "src/compiler/opcodes.h"
#include "src/compiler/operator.h"
#include "src/compiler/operator-properties.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace compiler {
namespace machine_operator_unittest {
template <typename T>
class MachineOperatorTestWithParam
: public TestWithZone,
public ::testing::WithParamInterface<
::testing::tuple<MachineRepresentation, T> > { … };
const MachineRepresentation kMachineReps[] = …;
const MachineType kMachineTypesForAccess[] = …;
const MachineRepresentation kRepresentationsForStore[] = …;
MachineLoadOperatorTest;
TEST_P(MachineLoadOperatorTest, InstancesAreGloballyShared) { … }
TEST_P(MachineLoadOperatorTest, NumberOfInputsAndOutputs) { … }
TEST_P(MachineLoadOperatorTest, OpcodeIsCorrect) { … }
TEST_P(MachineLoadOperatorTest, ParameterIsCorrect) { … }
INSTANTIATE_TEST_SUITE_P(…);
class MachineStoreOperatorTest
: public MachineOperatorTestWithParam<
::testing::tuple<MachineRepresentation, WriteBarrierKind> > { … };
TEST_P(MachineStoreOperatorTest, InstancesAreGloballyShared) { … }
TEST_P(MachineStoreOperatorTest, NumberOfInputsAndOutputs) { … }
TEST_P(MachineStoreOperatorTest, OpcodeIsCorrect) { … }
TEST_P(MachineStoreOperatorTest, ParameterIsCorrect) { … }
INSTANTIATE_TEST_SUITE_P(…);
struct PureOperator { … };
std::ostream& operator<<(std::ostream& os, PureOperator const& pop) { … }
const PureOperator kPureOperators[] = …;
class MachinePureOperatorTest : public TestWithZone { … };
TEST_F(MachinePureOperatorTest, PureOperators) { … }
struct OptionalOperatorEntry { … };
std::ostream& operator<<(std::ostream& os, OptionalOperatorEntry const& pop) { … }
const OptionalOperatorEntry kOptionalOperators[] = …;
class MachineOptionalOperatorTest : public TestWithZone { … };
TEST_F(MachineOptionalOperatorTest, OptionalOperators) { … }
MachineOperatorTest;
TEST_F(MachineOperatorTest, PseudoOperatorsWhenWordSizeIs32Bit) { … }
TEST_F(MachineOperatorTest, PseudoOperatorsWhenWordSizeIs64Bit) { … }
}
}
}
}