ASan: Disable alloc/dealloc mismatch test on Android. It's not supposed to work there
authorAlexey Samsonov <samsonov@google.com>
Mon, 14 Jan 2013 11:07:59 +0000 (11:07 +0000)
committerAlexey Samsonov <samsonov@google.com>
Mon, 14 Jan 2013 11:07:59 +0000 (11:07 +0000)
llvm-svn: 172398

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

index db35d5b5b0f78943381b85e9358aa6d1bd1f453c..ccfc8cbf82f8c65ded450325720ec62c50265211 100644 (file)
@@ -2060,9 +2060,9 @@ TEST(AddressSanitizer, AttributeNoAddressSafetyTest) {
   Ident(NoAddressSafety)();
 }
 
-// TODO(glider): Enable this test on Mac when alloc/dealloc mismatch is
-// fixed there.
-#ifndef __APPLE__
+// TODO(glider): Enable this test on Mac.
+// It doesn't work on Android, as calls to new/delete go through malloc/free.
+#if !defined(__APPLE__) && !defined(ANDROID) && !defined(__ANDROID__)
 static string MismatchStr(const string &str) {
   return string("AddressSanitizer: alloc-dealloc-mismatch \\(") + str;
 }
@@ -2081,7 +2081,7 @@ TEST(AddressSanitizer, AllocDeallocMismatch) {
   EXPECT_DEATH(delete [] (Ident((int*)malloc(2 * sizeof(int)))),
                MismatchStr("malloc vs operator delete \\[\\]"));
 }
-#endif  // __APPLE__
+#endif
 
 // ------------------ demo tests; run each one-by-one -------------
 // e.g. --gtest_filter=*DemoOOBLeftHigh --gtest_also_run_disabled_tests