[ASan] fixes for Android build
authorAlexey Samsonov <samsonov@google.com>
Fri, 18 Jan 2013 09:20:06 +0000 (09:20 +0000)
committerAlexey Samsonov <samsonov@google.com>
Fri, 18 Jan 2013 09:20:06 +0000 (09:20 +0000)
llvm-svn: 172800

compiler-rt/lib/asan/asan_linux.cc
compiler-rt/lib/asan/tests/asan_noinst_test.cc
compiler-rt/lib/asan/tests/asan_test.cc

index 1606ab2..845493d 100644 (file)
@@ -127,7 +127,7 @@ void ReadContextStack(void *context, uptr *stack, uptr *ssize) {
 }
 #else
 void ReadContextStack(void *context, uptr *stack, uptr *ssize) {
-  return UNIMPLEMENTED();
+  UNIMPLEMENTED();
 }
 #endif
 
index 80667ac..576312b 100644 (file)
@@ -390,7 +390,7 @@ TEST(AddressSanitizerInterface, GetAllocatedSizeAndOwnershipTest) {
     // allocated size.
     EXPECT_TRUE(__asan_get_ownership(zero_alloc));
     // Allocated size is 0 or 1 depending on the allocator used.
-    EXPECT_LT(__asan_get_allocated_size(zero_alloc), 2);
+    EXPECT_LT(__asan_get_allocated_size(zero_alloc), 2U);
   }
   free(zero_alloc);
 }
index ef7846d..5fa65b2 100644 (file)
@@ -1667,7 +1667,7 @@ TEST(AddressSanitizer, DISABLED_MemIntrinsicCallByPointerTest) {
   CallMemTransferByPointer(&memmove);
 }
 
-#if defined(__linux__) && !defined(ANDROID)
+#if defined(__linux__) && !defined(ANDROID) && !defined(__ANDROID__)
 #define READ_TEST(READ_N_BYTES)                                          \
   char *x = new char[10];                                                \
   int fd = open("/proc/self/stat", O_RDONLY);                            \
@@ -1690,7 +1690,7 @@ TEST(AddressSanitizer, pread64) {
 TEST(AddressSanitizer, read) {
   READ_TEST(read(fd, x, 15));
 }
-#endif  // defined(__linux__) && !defined(ANDROID)
+#endif  // defined(__linux__) && !defined(ANDROID) && !defined(__ANDROID__)
 
 // This test case fails
 // Clang optimizes memcpy/memset calls which lead to unaligned access