Disable some tests in heap_verification_test when running with ASan.

Now that the String class is allocated in the non-moving space when
the runtime is running without a boot image (which is the case in some
of the test cases in heap_verification_test), some unexpressed
assumptions about the accessibility of the memory around the String
class object may no longer hold (there may be poisoned areas before
and after the String class). When running with AddressSanizer, those
cases will trigger a use-after-poison error. Disable those test cases
when running with ASan.

Test: SANITIZE_HOST=address art/test.py
Bug: 68181300
Bug: 67628039
Change-Id: Ia9b0e6254257afa82686bd33a5e421c5096ce712
diff --git a/runtime/gc/heap_verification_test.cc b/runtime/gc/heap_verification_test.cc
index 6caca84..3754129 100644
--- a/runtime/gc/heap_verification_test.cc
+++ b/runtime/gc/heap_verification_test.cc
@@ -83,7 +83,12 @@
 }
 
 TEST_F(VerificationTest, IsValidClassInHeap) {
-  TEST_DISABLED_FOR_MEMORY_TOOL_WITH_HEAP_POISONING();
+  // Now that the String class is allocated in the non-moving space when the
+  // runtime is running without a boot image (which is the case in this gtest),
+  // and we run with AddressSanizer, it is possible that the (presumably
+  // invalid) memory location `uint_klass - kObjectAlignment` tested below is
+  // poisoned when running with AddressSanizer. Disable this test in that case.
+  TEST_DISABLED_FOR_MEMORY_TOOL();
   ScopedObjectAccess soa(Thread::Current());
   VariableSizedHandleScope hs(soa.Self());
   Handle<mirror::String> string(
@@ -106,7 +111,13 @@
 }
 
 TEST_F(VerificationTest, DumpValidObjectInfo) {
-  TEST_DISABLED_FOR_MEMORY_TOOL_WITH_HEAP_POISONING();
+  // Now that the String class is allocated in the non-moving space when the
+  // runtime is running without a boot image (which is the case in this gtest),
+  // and we run with AddressSanizer, it is possible that the calls to
+  // Verification::DumpObjectInfo below involving the String class object
+  // (`string->GetClass()`, `uint_klass`, etc.) access poisoned memory when they
+  // call Verification::DumpRAMAroundAddress. Disable this test in that case.
+  TEST_DISABLED_FOR_MEMORY_TOOL();
   ScopedLogSeverity sls(LogSeverity::INFO);
   ScopedObjectAccess soa(Thread::Current());
   Runtime* const runtime = Runtime::Current();
@@ -126,7 +137,13 @@
 }
 
 TEST_F(VerificationTest, LogHeapCorruption) {
-  TEST_DISABLED_FOR_MEMORY_TOOL_WITH_HEAP_POISONING();
+  // Now that the String class is allocated in the non-moving space when the
+  // runtime is running without a boot image (which is the case in this gtest),
+  // and we run with AddressSanizer, it is possible that the call to
+  // Verification::LogHeapCorruption below involving the String class object
+  // (`string->GetClass()`) accesses poisoned memory when it calls
+  // Verification::DumpRAMAroundAddress. Disable this test in that case.
+  TEST_DISABLED_FOR_MEMORY_TOOL();
   ScopedLogSeverity sls(LogSeverity::INFO);
   ScopedObjectAccess soa(Thread::Current());
   Runtime* const runtime = Runtime::Current();