[llvm-commits] [compiler-rt] r166093 - /compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc

Kostya Serebryany kcc at google.com
Wed Oct 17 01:50:53 PDT 2012


Author: kcc
Date: Wed Oct 17 03:50:53 2012
New Revision: 166093

URL: http://llvm.org/viewvc/llvm-project?rev=166093&view=rev
Log:
[asan] fix gcc warnings while building asan-rt

Modified:
    compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc

Modified: compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc?rev=166093&r1=166092&r2=166093&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc Wed Oct 17 03:50:53 2012
@@ -370,20 +370,20 @@
   // We cannot call GetAllocatedSize from the memory we didn't map,
   // and from the interior pointers (not returned by previous malloc).
   void *wild_addr = (void*)0x1;
-  EXPECT_EQ(false, __asan_get_ownership(wild_addr));
+  EXPECT_FALSE( __asan_get_ownership(wild_addr));
   EXPECT_DEATH(__asan_get_allocated_size(wild_addr), kGetAllocatedSizeErrorMsg);
-  EXPECT_EQ(false, __asan_get_ownership(array + kArraySize / 2));
+  EXPECT_FALSE(__asan_get_ownership(array + kArraySize / 2));
   EXPECT_DEATH(__asan_get_allocated_size(array + kArraySize / 2),
                kGetAllocatedSizeErrorMsg);
 
   // NULL is not owned, but is a valid argument for __asan_get_allocated_size().
-  EXPECT_EQ(false, __asan_get_ownership(NULL));
+  EXPECT_FALSE(__asan_get_ownership(NULL));
   EXPECT_EQ(0U, __asan_get_allocated_size(NULL));
 
   // When memory is freed, it's not owned, and call to GetAllocatedSize
   // is forbidden.
   free(array);
-  EXPECT_EQ(false, __asan_get_ownership(array));
+  EXPECT_FALSE( __asan_get_ownership(array));
   EXPECT_DEATH(__asan_get_allocated_size(array), kGetAllocatedSizeErrorMsg);
 
   delete int_ptr;
@@ -477,6 +477,8 @@
     old_free_bytes = new_free_bytes;
   }
   EXPECT_DEATH(DoLargeMallocForGetFreeBytesTestAndDie(), "double-free");
+  for (i = 0; i < kNumOfChunks; i++)
+    free(chunks[i]);
 }
 
 static const size_t kManyThreadsMallocSizes[] = {5, 1UL<<10, 1UL<<20, 357};





More information about the llvm-commits mailing list