[compiler-rt] 79e7621 - [test][HWASAN] Add hwasan-aliasing

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 14:02:24 PDT 2023


Author: Vitaly Buka
Date: 2023-04-26T14:02:11-07:00
New Revision: 79e76211df9a6f9f583184f1c54e3a085ff1a6a1

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

LOG: [test][HWASAN] Add hwasan-aliasing

Some tests of D149234 deppend on
aliasing mode.

Added: 
    

Modified: 
    compiler-rt/test/sanitizer_common/TestCases/Linux/malloc_usable_size.c
    compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c
    compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
    compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp
    compiler-rt/test/sanitizer_common/lit.common.cfg.py

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/malloc_usable_size.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/malloc_usable_size.c
index f91799fc911a..318c12aa1488 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/malloc_usable_size.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/malloc_usable_size.c
@@ -4,7 +4,7 @@
 // XFAIL: ubsan
 
 // FIXME: Implement.
-// XFAIL: hwasan
+// XFAIL: hwasan-aliasing
 
 #include <assert.h>
 #include <malloc.h>

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c
index e29cb1e73036..58a2d457f359 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c
@@ -6,6 +6,9 @@
 // RUN: %env_tool_opts=handle_sigbus=2 not %run %t 4 2>&1 | FileCheck %s -DSIGNAME=BUS
 // RUN: %env_tool_opts=handle_sigtrap=2 not %run %t 5 2>&1 | FileCheck %s -DSIGNAME=TRAP
 
+// FIXME: Hwasan misclassify TRAP as tag missmatch.
+// XFAIL: hwasan && !hwasan-aliasing
+
 #include <signal.h>
 #include <stdlib.h>
 

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp b/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
index 5f31b1f025d2..943baaf4f857 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
@@ -4,7 +4,7 @@
 // XFAIL: ubsan
 
 // FIXME: Implement.
-// XFAIL: hwasan
+// XFAIL: hwasan-aliasing
 
 #include <assert.h>
 #include <sanitizer/allocator_interface.h>

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp b/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp
index 41ff45005d3b..ca3baaa6ec7d 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp
@@ -43,8 +43,8 @@
 // win32 is disabled due to failing errno tests.
 // UNSUPPORTED: ubsan, target={{.*windows-msvc.*}}
 
-// FIXME: Implement.
-// XFAIL: hwasan
+// FIXME: Something crashes.
+// XFAIL: hwasan-aliasing
 
 #include <assert.h>
 #include <errno.h>

diff  --git a/compiler-rt/test/sanitizer_common/lit.common.cfg.py b/compiler-rt/test/sanitizer_common/lit.common.cfg.py
index 7d7262bfb168..f6f74d8ab7f9 100644
--- a/compiler-rt/test/sanitizer_common/lit.common.cfg.py
+++ b/compiler-rt/test/sanitizer_common/lit.common.cfg.py
@@ -14,6 +14,7 @@
   tool_cflags = ["-fsanitize=hwaddress", "-fuse-ld=lld"]
   if config.target_arch == "x86_64":
     tool_cflags += ["-fsanitize-hwaddress-experimental-aliasing"]
+    config.available_features.add("hwasan-aliasing")
   tool_options = "HWASAN_OPTIONS"
 elif config.tool_name == "tsan":
   tool_cflags = ["-fsanitize=thread"]


        


More information about the llvm-commits mailing list