[sanitizer] fix gcc warnings, enable one tests under asan_allocator2

llvm-svn: 171036
This commit is contained in:
Kostya Serebryany 2012-12-24 14:53:13 +00:00
parent fc7de2910c
commit db3250b8b3
2 changed files with 2 additions and 4 deletions

View File

@ -717,8 +717,6 @@ TEST(AddressSanitizerInterface, SetErrorReportCallbackTest) {
TEST(AddressSanitizerInterface, GetOwnershipStressTest) {
std::vector<char *> pointers;
std::vector<size_t> sizes;
if (ASAN_ALLOCATOR_VERSION == 2 && SANITIZER_WORDSIZE == 32)
return; // FIXME: this is too slow.
const size_t kNumMallocs =
(SANITIZER_WORDSIZE <= 32 || ASAN_LOW_MEMORY) ? 1 << 10 : 1 << 14;
for (size_t i = 0; i < kNumMallocs; i++) {

View File

@ -291,7 +291,7 @@ TEST(SanitizerCommon, LargeMmapAllocator) {
uptr max_alignment = SANITIZER_WORDSIZE == 64 ? (1 << 28) : (1 << 24);
for (uptr alignment = 8; alignment <= max_alignment; alignment *= 2) {
const uptr kNumAlignedAllocs = 100;
for (int i = 0; i < kNumAlignedAllocs; i++) {
for (uptr i = 0; i < kNumAlignedAllocs; i++) {
uptr size = ((i % 10) + 1) * 4096;
char *p = allocated[i] = (char *)a.Allocate(size, alignment);
CHECK_EQ(p, a.GetBlockBegin(p));
@ -300,7 +300,7 @@ TEST(SanitizerCommon, LargeMmapAllocator) {
CHECK_EQ(0, (uptr)allocated[i] % alignment);
p[0] = p[size - 1] = 0;
}
for (int i = 0; i < kNumAlignedAllocs; i++) {
for (uptr i = 0; i < kNumAlignedAllocs; i++) {
a.Deallocate(allocated[i]);
}
}