Index: test/cctest/heap/test-heap.cc |
diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc |
index e559ae41adb1710fe079bfdf673f707d71fb3ba0..e54724c1cbcb1d4201ed72a3bc40e7b595ed6f2b 100644 |
--- a/test/cctest/heap/test-heap.cc |
+++ b/test/cctest/heap/test-heap.cc |
@@ -2218,6 +2218,18 @@ static Address AlignOldSpace(AllocationAlignment alignment, int offset) { |
// Test the case where allocation must be done from the free list, so filler |
// may precede or follow the object. |
TEST(TestAlignedOverAllocation) { |
+ Heap* heap = CcTest::heap(); |
+ // Test checks for fillers before and behind objects and requires a fresh |
+ // page and empty free list. |
+ heap::AbandonCurrentlyFreeMemory(heap->old_space()); |
+ // Allocate a dummy object to properly set up the linear allocation info. |
+ AllocationResult dummy = |
+ heap->old_space()->AllocateRawUnaligned(kPointerSize); |
+ CHECK(!dummy.IsRetry()); |
+ heap->CreateFillerObjectAt( |
+ HeapObject::cast(dummy.ToObjectChecked())->address(), kPointerSize, |
+ ClearRecordedSlots::kNo); |
+ |
// Double misalignment is 4 on 32-bit platforms, 0 on 64-bit ones. |
const intptr_t double_misalignment = kDoubleSize - kPointerSize; |
Address start; |