Index: test/cctest/compiler/test-run-machops.cc |
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc |
index 2092dc9c63631b4494444263245d2db4c33f7c3b..3da6b261d781afd70d91c71e433e17fad9cd9cc5 100644 |
--- a/test/cctest/compiler/test-run-machops.cc |
+++ b/test/cctest/compiler/test-run-machops.cc |
@@ -6739,6 +6739,34 @@ TEST(ParentFramePointer) { |
CHECK_EQ(1, r.Call(1)); |
} |
+#if V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64 |
+ |
+TEST(StackSlotAlignment) { |
+ RawMachineAssemblerTester<int32_t> r; |
+ RawMachineLabel tlabel; |
+ RawMachineLabel flabel; |
+ RawMachineLabel merge; |
+ |
+ int alignments[] = {4, 8, 16}; |
+ int alignment_count = arraysize(alignments); |
+ |
+ Node* alignment_counter = r.Int32Constant(0); |
+ for (int i = 0; i < alignment_count; i++) { |
+ for (int j = 0; j < 5; j++) { |
+ Node* stack_slot = |
+ r.StackSlot(MachineRepresentation::kWord32, alignments[i]); |
+ alignment_counter = r.Int32Add( |
+ alignment_counter, |
+ r.Word32And(stack_slot, r.Int32Constant(alignments[i] - 1))); |
+ } |
+ } |
+ |
+ r.Return(alignment_counter); |
+ CHECK_EQ(0, r.Call(1)); |
+} |
+ |
+#endif // V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64 |
+ |
#if V8_TARGET_ARCH_64_BIT |
TEST(Regression5923) { |