[llvm] a0e402d - [test] Disable DynamicLibrary with HWASAN

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 10:19:28 PDT 2022


Author: Vitaly Buka
Date: 2022-08-18T10:19:18-07:00
New Revision: a0e402d41fad9059b48ac1b109e1aaadbb41e6b8

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

LOG: [test] Disable DynamicLibrary with HWASAN

Re-enabled when https://github.com/llvm/llvm-project/issues/57206 fixed.

Added: 
    

Modified: 
    llvm/include/llvm/Support/Compiler.h
    llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index bf299bc1d0d7f..cf330662cf4b4 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -423,6 +423,14 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
 # define __asan_unpoison_memory_region(p, size)
 #endif
 
+/// \macro LLVM_HWADDRESS_SANITIZER_BUILD
+/// Whether LLVM itself is built with HWAddressSanitizer instrumentation.
+#if __has_feature(hwaddress_sanitizer)
+#define LLVM_HWADDRESS_SANITIZER_BUILD 1
+#else
+#define LLVM_HWADDRESS_SANITIZER_BUILD 0
+#endif
+
 /// \macro LLVM_THREAD_SANITIZER_BUILD
 /// Whether LLVM itself is built with ThreadSanitizer instrumentation.
 #if __has_feature(thread_sanitizer) || defined(__SANITIZE_THREAD__)

diff  --git a/llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp b/llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
index 784b9c1bb2d27..ef17a084b41f9 100644
--- a/llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
+++ b/llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
@@ -8,6 +8,7 @@
 
 #include "llvm/Support/DynamicLibrary.h"
 #include "llvm/Config/config.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Path.h"
@@ -15,6 +16,9 @@
 
 #include "PipSqueak.h"
 
+// FIXME: Missing globals/DSO https://github.com/llvm/llvm-project/issues/57206.
+#if !LLVM_HWADDRESS_SANITIZER_BUILD
+
 using namespace llvm;
 using namespace llvm::sys;
 
@@ -182,3 +186,5 @@ TEST(DynamicLibrary, Unsupported) {
 }
 
 #endif
+
+#endif


        


More information about the llvm-commits mailing list