From 56ee5d9337fac7fcf9e755e75d85563d84d1b89c Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Fri, 6 May 2022 15:50:33 +0200 Subject: [PATCH] [Support] Fix asan AllocatorTest after ba0d50ad7ec66 We were counting the number of bytes allocated, but under asan there's extra redzone bytes by default. Disable this. --- llvm/unittests/Support/AllocatorTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/unittests/Support/AllocatorTest.cpp b/llvm/unittests/Support/AllocatorTest.cpp index 665d1b7e38f0..b361b0aa7252 100644 --- a/llvm/unittests/Support/AllocatorTest.cpp +++ b/llvm/unittests/Support/AllocatorTest.cpp @@ -105,6 +105,7 @@ TEST(AllocatorTest, TestAlignment) { // we end up creating a slab for it. TEST(AllocatorTest, TestZero) { BumpPtrAllocator Alloc; + Alloc.setRedZoneSize(0); // else our arithmetic is all off EXPECT_EQ(0u, Alloc.GetNumSlabs()); EXPECT_EQ(0u, Alloc.getBytesAllocated());