X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=unittests%2FSupport%2FAllocatorTest.cpp;fp=unittests%2FSupport%2FAllocatorTest.cpp;h=7f15776d6f007797d4510803a8bda8575019a9bc;hp=616f8af3415f847caf240a26114df731e90f42b2;hb=3f0922729280ea435e1e1df8eabb12d068f27263;hpb=4f240010fdea1fcbe7dac3c8e9ebad082e4036c2 diff --git a/unittests/Support/AllocatorTest.cpp b/unittests/Support/AllocatorTest.cpp index 616f8af3415..7f15776d6f0 100644 --- a/unittests/Support/AllocatorTest.cpp +++ b/unittests/Support/AllocatorTest.cpp @@ -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());