diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2012-08-15 14:25:33 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2012-08-15 14:25:33 +0000 |
commit | cbeeced8f995ca0689131af2c4ad864e9e8fd88f (patch) | |
tree | 6d1ff12e753d87aab0828e076774d987733cd7c4 | |
parent | fcf1c6fceba8fc39a2933c0ed3709a0d70a4b1ec (diff) | |
download | compiler-rt-cbeeced8f995ca0689131af2c4ad864e9e8fd88f.tar.gz |
tsan: add some more tests for memory allocator
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161950 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/sanitizer_common/tests/sanitizer_allocator64_test.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sanitizer_common/tests/sanitizer_allocator64_test.cc b/lib/sanitizer_common/tests/sanitizer_allocator64_test.cc index 1410f26ce..87d564b16 100644 --- a/lib/sanitizer_common/tests/sanitizer_allocator64_test.cc +++ b/lib/sanitizer_common/tests/sanitizer_allocator64_test.cc @@ -193,6 +193,13 @@ TEST(SanitizerCommon, CombinedAllocator) { Allocator a; a.Init(); cache.Init(); + + EXPECT_EQ(a.Allocate(&cache, -1, 1), (void*)0); + EXPECT_EQ(a.Allocate(&cache, -1, 1024), (void*)0); + EXPECT_EQ(a.Allocate(&cache, (uptr)-1 - 1024, 1), (void*)0); + EXPECT_EQ(a.Allocate(&cache, (uptr)-1 - 1024, 1024), (void*)0); + EXPECT_EQ(a.Allocate(&cache, (uptr)-1 - 1023, 1024), (void*)0); + const uptr kNumAllocs = 100000; const uptr kNumIter = 10; for (uptr iter = 0; iter < kNumIter; iter++) { |