diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2017-06-14 17:32:26 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2017-06-14 17:32:26 +0000 |
commit | 6cd1865e1d8bc8fd1cb62fe4ef51c8c908385609 (patch) | |
tree | ea136a4ed6ae9d22a95f3ec6ae62593a126beb7a /lib/sanitizer_common/tests | |
parent | fccfd4523bbad39dfaf5e1a9dbf7491abbc80a22 (diff) |
[sanitizer] Reverting D34152
Summary:
This broke thread_local_quarantine_pthread_join.cc on some architectures, due
to the overhead of the stashed regions. Reverting while figuring out the best
way to deal with it.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D34213
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305404 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/tests')
-rw-r--r-- | lib/sanitizer_common/tests/sanitizer_common_test.cc | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/lib/sanitizer_common/tests/sanitizer_common_test.cc b/lib/sanitizer_common/tests/sanitizer_common_test.cc index c1077e628..ebc885db7 100644 --- a/lib/sanitizer_common/tests/sanitizer_common_test.cc +++ b/lib/sanitizer_common/tests/sanitizer_common_test.cc @@ -77,8 +77,8 @@ TEST(SanitizerCommon, MmapAlignedOrDie) { for (uptr size = 1; size <= 32; size *= 2) { for (uptr alignment = 1; alignment <= 32; alignment *= 2) { for (int iter = 0; iter < 100; iter++) { - uptr res = (uptr)MmapAlignedOrDie(size * PageSize, alignment * PageSize, - "MmapAlignedOrDieTest", nullptr); + uptr res = (uptr)MmapAlignedOrDie( + size * PageSize, alignment * PageSize, "MmapAlignedOrDieTest"); EXPECT_EQ(0U, res % (alignment * PageSize)); internal_memset((void*)res, 1, size * PageSize); UnmapOrDie((void*)res, size * PageSize); @@ -87,37 +87,6 @@ TEST(SanitizerCommon, MmapAlignedOrDie) { } } -TEST(SanitizerCommon, MmapAlignedOrDiePaddingChunk) { - uptr PageSize = GetPageSizeCached(); - for (uptr size = 1; size <= 32; size *= 2) { - for (uptr alignment = 1; alignment <= 32; alignment *= 2) { - for (int iter = 0; iter < 100; iter++) { - uptr padding_chunk; - uptr res = (uptr)MmapAlignedOrDie(size * PageSize, alignment * PageSize, - "MmapAlignedOrDiePaddingChunkTest", &padding_chunk); - EXPECT_EQ(0U, res % (alignment * PageSize)); - internal_memset((void*)res, 1, size * PageSize); - UnmapOrDie((void*)res, size * PageSize); - if (SANITIZER_WINDOWS || (size != alignment)) { - // Not supported on Windows or for different size and alignment. - EXPECT_EQ(0U, padding_chunk); - continue; - } - if (size == 1 && alignment == 1) { - // mmap returns PageSize aligned chunks, so this is a specific case - // where we can check that padding_chunk will never be 0. - EXPECT_NE(0U, padding_chunk); - } - if (padding_chunk) { - EXPECT_EQ(res + size * PageSize, padding_chunk); - internal_memset((void*)padding_chunk, 1, alignment * PageSize); - UnmapOrDie((void*)padding_chunk, alignment * PageSize); - } - } - } - } -} - #if SANITIZER_LINUX TEST(SanitizerCommon, SanitizerSetThreadName) { const char *names[] = { |