llvm.org GIT mirror llvm / 3f09227
Try to unflake AllocatorTest.TestAlignmentPastSlab git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217331 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 5 years ago
1 changed file(s) with 4 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
117117 // Test requesting alignment that goes past the end of the current slab.
118118 TEST(AllocatorTest, TestAlignmentPastSlab) {
119119 BumpPtrAllocator Alloc;
120 Alloc.Allocate(1234, 1);
120 Alloc.Allocate(4095, 1);
121121
122 // Any attempt to align the pointer in the current slab would move it beyond
123 // the end of that slab.
122 // Aligning the current slab pointer is likely to move it past the end of the
123 // slab, which would confuse any unsigned comparisons with the difference of
124 // the the end pointer and the aligned pointer.
124125 Alloc.Allocate(1024, 8192);
125126
126127 EXPECT_EQ(2U, Alloc.GetNumSlabs());