[compiler-rt] 1cf428a - Skip MemtagBasicDeathTest#Unsupported when running with HWASan (#84243)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 13:46:12 PST 2024


Author: Florian Mayer
Date: 2024-03-08T13:46:08-08:00
New Revision: 1cf428a05a62711200d37a1b12722ca16c33a6ea

URL: https://github.com/llvm/llvm-project/commit/1cf428a05a62711200d37a1b12722ca16c33a6ea
DIFF: https://github.com/llvm/llvm-project/commit/1cf428a05a62711200d37a1b12722ca16c33a6ea.diff

LOG: Skip MemtagBasicDeathTest#Unsupported when running with HWASan (#84243)

Tested in AOSP.

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp b/compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp
index fd277f962a9aaa..37a18858e67c2c 100644
--- a/compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp
+++ b/compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp
@@ -12,12 +12,17 @@
 #include "platform.h"
 #include "tests/scudo_unit_test.h"
 
+extern "C" void __hwasan_init() __attribute__((weak));
+
 #if SCUDO_LINUX
 namespace scudo {
 
 TEST(MemtagBasicDeathTest, Unsupported) {
   if (archSupportsMemoryTagging())
     GTEST_SKIP();
+  // Skip when running with HWASan.
+  if (&__hwasan_init != 0)
+    GTEST_SKIP();
 
   EXPECT_DEATH(archMemoryTagGranuleSize(), "not supported");
   EXPECT_DEATH(untagPointer((uptr)0), "not supported");


        


More information about the llvm-commits mailing list