| 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 "src/compiler/machine-operator.h" | 5 #include "src/compiler/machine-operator.h" |
| 6 #include "src/compiler/operator-properties-inl.h" | 6 #include "src/compiler/operator-properties-inl.h" |
| 7 #include "test/compiler-unittests/compiler-unittests.h" | 7 #include "test/compiler-unittests/compiler-unittests.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 | 9 |
| 10 using testing::IsNull; | 10 using testing::IsNull; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 TEST_P(MachineOperatorCommonTest, ChangeUint32ToUint64) { | 50 TEST_P(MachineOperatorCommonTest, ChangeUint32ToUint64) { |
| 51 Operator* op = machine()->ChangeUint32ToUint64(); | 51 Operator* op = machine()->ChangeUint32ToUint64(); |
| 52 EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op)); | 52 EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op)); |
| 53 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op)); | 53 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op)); |
| 54 EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op)); | 54 EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op)); |
| 55 EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op)); | 55 EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op)); |
| 56 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op)); | 56 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op)); |
| 57 } | 57 } |
| 58 | 58 |
| 59 | 59 |
| 60 TEST_P(MachineOperatorCommonTest, TruncateFloat64ToInt32) { |
| 61 Operator* op = machine()->TruncateFloat64ToInt32(); |
| 62 EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op)); |
| 63 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op)); |
| 64 EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op)); |
| 65 EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op)); |
| 66 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op)); |
| 67 } |
| 68 |
| 69 |
| 60 TEST_P(MachineOperatorCommonTest, TruncateInt64ToInt32) { | 70 TEST_P(MachineOperatorCommonTest, TruncateInt64ToInt32) { |
| 61 Operator* op = machine()->TruncateInt64ToInt32(); | 71 Operator* op = machine()->TruncateInt64ToInt32(); |
| 62 EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op)); | 72 EXPECT_EQ(1, OperatorProperties::GetValueInputCount(op)); |
| 63 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op)); | 73 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op)); |
| 64 EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op)); | 74 EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op)); |
| 65 EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op)); | 75 EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op)); |
| 66 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op)); | 76 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op)); |
| 67 } | 77 } |
| 68 | 78 |
| 69 | 79 |
| 70 INSTANTIATE_TEST_CASE_P(MachineOperatorTest, MachineOperatorCommonTest, | 80 INSTANTIATE_TEST_CASE_P(MachineOperatorTest, MachineOperatorCommonTest, |
| 71 ::testing::Values(kRepWord32, kRepWord64)); | 81 ::testing::Values(kRepWord32, kRepWord64)); |
| 72 | 82 |
| 73 } // namespace compiler | 83 } // namespace compiler |
| 74 } // namespace internal | 84 } // namespace internal |
| 75 } // namespace v8 | 85 } // namespace v8 |
| OLD | NEW |