Index: test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc |
diff --git a/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc b/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc |
index 73532aab2a1acaad8f10fbb22af5b26fe237694a..5d51d99b155b1c1f11b599ef755bf51c338b08cf 100644 |
--- a/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc |
+++ b/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc |
@@ -2250,6 +2250,25 @@ TEST_P(InstructionSelectorMemoryAccessTest, StoreWithImmediateIndex) { |
} |
} |
+TEST_P(InstructionSelectorMemoryAccessTest, StoreZero) { |
+ const MemoryAccess memacc = GetParam(); |
+ TRACED_FOREACH(int32_t, index, memacc.immediates) { |
+ StreamBuilder m(this, MachineType::Int32(), MachineType::Pointer()); |
+ m.Store(memacc.type.representation(), m.Parameter(0), |
+ m.Int32Constant(index), m.Int32Constant(0), kNoWriteBarrier); |
+ m.Return(m.Int32Constant(0)); |
+ Stream s = m.Build(); |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode()); |
+ EXPECT_EQ(kMode_MRI, s[0]->addressing_mode()); |
+ ASSERT_EQ(3U, s[0]->InputCount()); |
+ ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind()); |
+ EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1))); |
+ ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(2)->kind()); |
+ EXPECT_EQ(0, s.ToInt64(s[0]->InputAt(2))); |
+ EXPECT_EQ(0U, s[0]->OutputCount()); |
+ } |
+} |
INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, |
InstructionSelectorMemoryAccessTest, |