Chromium Code Reviews| 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..7a6863ef2b00352ee50b561bdb6cbb6a7e377210 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(MachineType::Int32()); |
|
ahaas
2017/05/08 08:58:37
I think you don't need a parameter for this test,
|
| + RawMachineLabel tlabel; |
| + RawMachineLabel flabel; |
| + RawMachineLabel merge; |
| + |
| + int alignments[] = {4, 8, 16}; |
| + int alignment_count = sizeof(alignments) / sizeof(int); |
|
ahaas
2017/05/08 08:58:37
You can just use 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) { |