summaryrefslogtreecommitdiff
path: root/lib/asan/tests/asan_test.cc
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-10-20 15:35:01 +0000
committerDan Albert <danalbert@google.com>2014-10-20 15:35:01 +0000
commit75a00b772e5e035a420eb9639eba1dacf191f7d4 (patch)
tree39de222f836119b15454355b962cfc8e408aa1b9 /lib/asan/tests/asan_test.cc
parentd97858de5d17a669dcdf6c0b3c0eaf9d6e4fef75 (diff)
Fix checks for Android.
__ANDROID__ is a define that comes from the toolchain when building for Android targets. ANDROID has a different meaning. ANDROID is defined for _every_ Android build, including those done for host modules. For host modules, we want to build the regular Linux sanitizers and builtins, not the one for Android devices. This hasn't been a problem until now because we only just started building the sanitizers for the host. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220203 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/tests/asan_test.cc')
-rw-r--r--lib/asan/tests/asan_test.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/asan/tests/asan_test.cc b/lib/asan/tests/asan_test.cc
index adf39486c..91a735696 100644
--- a/lib/asan/tests/asan_test.cc
+++ b/lib/asan/tests/asan_test.cc
@@ -117,7 +117,7 @@ TEST(AddressSanitizer, CallocReturnsZeroMem) {
}
// No valloc on Windows or Android.
-#if !defined(_WIN32) && !defined(ANDROID) && !defined(__ANDROID__)
+#if !defined(_WIN32) && !defined(__ANDROID__)
TEST(AddressSanitizer, VallocTest) {
void *a = valloc(100);
EXPECT_EQ(0U, (uintptr_t)a % kPageSize);
@@ -769,7 +769,7 @@ char* MallocAndMemsetString(size_t size) {
return MallocAndMemsetString(size, 'z');
}
-#if defined(__linux__) && !defined(ANDROID) && !defined(__ANDROID__)
+#if defined(__linux__) && !defined(__ANDROID__)
#define READ_TEST(READ_N_BYTES) \
char *x = new char[10]; \
int fd = open("/proc/self/stat", O_RDONLY); \
@@ -792,7 +792,7 @@ TEST(AddressSanitizer, pread64) {
TEST(AddressSanitizer, read) {
READ_TEST(read(fd, x, 15));
}
-#endif // defined(__linux__) && !defined(ANDROID) && !defined(__ANDROID__)
+#endif // defined(__linux__) && !defined(__ANDROID__)
// This test case fails
// Clang optimizes memcpy/memset calls which lead to unaligned access
@@ -1153,7 +1153,7 @@ TEST(AddressSanitizer, AttributeNoSanitizeAddressTest) {
// https://code.google.com/p/address-sanitizer/issues/detail?id=131
// Windows support is tracked here:
// https://code.google.com/p/address-sanitizer/issues/detail?id=309
-#if !defined(ANDROID) && !defined(__ANDROID__) && \
+#if !defined(__ANDROID__) && \
!defined(__APPLE__) && \
!defined(_WIN32)
static string MismatchStr(const string &str) {