Index: test/unittests/compiler/int64-lowering-unittest.cc |
diff --git a/test/unittests/compiler/int64-lowering-unittest.cc b/test/unittests/compiler/int64-lowering-unittest.cc |
index 83c8d003dbeeffd8be7ccc6c0dab8f8595ebb550..b55f81908816a0154873a8cc2e37d55dd304d30a 100644 |
--- a/test/unittests/compiler/int64-lowering-unittest.cc |
+++ b/test/unittests/compiler/int64-lowering-unittest.cc |
@@ -237,6 +237,38 @@ TEST_F(Int64LoweringTest, Int64Store) { |
INT64_STORE_LOWERING(Store, rep32, rep64); |
} |
+TEST_F(Int64LoweringTest, Int32Store) { |
+ const StoreRepresentation rep32(MachineRepresentation::kWord32, |
+ WriteBarrierKind::kNoWriteBarrier); |
+ int32_t base = 1111; |
+ int32_t index = 2222; |
+ int32_t return_value = 0x5555; |
+ |
+ Signature<MachineRepresentation>::Builder sig_builder(zone(), 1, 0); |
+ sig_builder.AddReturn(MachineRepresentation::kWord32); |
+ |
+ Node* store = graph()->NewNode(machine()->Store(rep32), Int32Constant(base), |
+ Int32Constant(index), Int64Constant(value(0)), |
+ start(), start()); |
+ |
+ Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
+ Node* ret = graph()->NewNode(common()->Return(), zero, |
+ Int32Constant(return_value), store, start()); |
+ |
+ NodeProperties::MergeControlToEnd(graph(), common(), ret); |
+ |
+ Int64Lowering lowering(graph(), machine(), common(), zone(), |
+ sig_builder.Build()); |
+ lowering.LowerGraph(); |
+ |
+ EXPECT_THAT( |
+ graph()->end()->InputAt(1), |
+ IsReturn(IsInt32Constant(return_value), |
+ IsStore(rep32, IsInt32Constant(base), IsInt32Constant(index), |
+ IsInt32Constant(low_word_value(0)), start(), start()), |
+ start())); |
+} |
+ |
TEST_F(Int64LoweringTest, Int64UnalignedStore) { |
const UnalignedStoreRepresentation rep64(MachineRepresentation::kWord64); |
const UnalignedStoreRepresentation rep32(MachineRepresentation::kWord32); |