[compiler-rt] 1f2d945 - [HWASAN] Run sanitizer_common tests

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 12:58:39 PDT 2023


Author: Vitaly Buka
Date: 2023-04-26T12:58:33-07:00
New Revision: 1f2d945f29950e6c794d013df58f256d48c90139

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

LOG: [HWASAN] Run sanitizer_common tests

ninja check-sanitizer will run tests with hwasan as well

Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D149234

Added: 
    

Modified: 
    compiler-rt/test/sanitizer_common/CMakeLists.txt
    compiler-rt/test/sanitizer_common/lit.common.cfg.py

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt
index f28ab0f62735..f2df8cec3549 100644
--- a/compiler-rt/test/sanitizer_common/CMakeLists.txt
+++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt
@@ -7,7 +7,7 @@ set(SANITIZER_COMMON_TESTSUITES)
 # FIXME(dliew): We should switch to COMPILER_RT_SANITIZERS_TO_BUILD instead of
 # the hard coded `SUPPORTED_TOOLS_INIT` list once we know that the other
 # sanitizers work.
-set(SUPPORTED_TOOLS_INIT asan lsan msan tsan ubsan)
+set(SUPPORTED_TOOLS_INIT asan lsan hwasan msan tsan ubsan)
 set(SUPPORTED_TOOLS)
   foreach(SANITIZER_TOOL ${SUPPORTED_TOOLS_INIT})
     string(TOUPPER ${SANITIZER_TOOL} SANITIZER_TOOL_UPPER)

diff  --git a/compiler-rt/test/sanitizer_common/lit.common.cfg.py b/compiler-rt/test/sanitizer_common/lit.common.cfg.py
index 13a21c6c4adc..7d7262bfb168 100644
--- a/compiler-rt/test/sanitizer_common/lit.common.cfg.py
+++ b/compiler-rt/test/sanitizer_common/lit.common.cfg.py
@@ -10,6 +10,11 @@
 if config.tool_name == "asan":
   tool_cflags = ["-fsanitize=address"]
   tool_options = "ASAN_OPTIONS"
+elif config.tool_name == "hwasan":
+  tool_cflags = ["-fsanitize=hwaddress", "-fuse-ld=lld"]
+  if config.target_arch == "x86_64":
+    tool_cflags += ["-fsanitize-hwaddress-experimental-aliasing"]
+  tool_options = "HWASAN_OPTIONS"
 elif config.tool_name == "tsan":
   tool_cflags = ["-fsanitize=thread"]
   tool_options = "TSAN_OPTIONS"


        


More information about the llvm-commits mailing list