[llvm] r217331 - Try to unflake AllocatorTest.TestAlignmentPastSlab
Hans Wennborg
hans at hanshq.net
Sat Sep 6 22:14:30 PDT 2014
Author: hans
Date: Sun Sep 7 00:14:29 2014
New Revision: 217331
URL: http://llvm.org/viewvc/llvm-project?rev=217331&view=rev
Log:
Try to unflake AllocatorTest.TestAlignmentPastSlab
Modified:
llvm/trunk/unittests/Support/AllocatorTest.cpp
Modified: llvm/trunk/unittests/Support/AllocatorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/AllocatorTest.cpp?rev=217331&r1=217330&r2=217331&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/AllocatorTest.cpp (original)
+++ llvm/trunk/unittests/Support/AllocatorTest.cpp Sun Sep 7 00:14:29 2014
@@ -118,10 +118,11 @@ TEST(AllocatorTest, TestSmallSlabSize) {
// Test requesting alignment that goes past the end of the current slab.
TEST(AllocatorTest, TestAlignmentPastSlab) {
BumpPtrAllocator Alloc;
- Alloc.Allocate(1234, 1);
+ Alloc.Allocate(4095, 1);
- // Any attempt to align the pointer in the current slab would move it beyond
- // the end of that slab.
+ // Aligning the current slab pointer is likely to move it past the end of the
+ // slab, which would confuse any unsigned comparisons with the difference of
+ // the the end pointer and the aligned pointer.
Alloc.Allocate(1024, 8192);
EXPECT_EQ(2U, Alloc.GetNumSlabs());
More information about the llvm-commits
mailing list