[compiler-rt] 69e01fa - [test][HWASAN] Add XFAILs for missing hwasan features

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


Author: Vitaly Buka
Date: 2023-04-26T12:55:21-07:00
New Revision: 69e01fa1e9279f7361069809c93f53e4e2648b5c

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

LOG: [test][HWASAN] Add XFAILs for missing hwasan features

Reviewed By: thurston

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

Added: 
    

Modified: 
    compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cpp
    compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp
    compiler-rt/test/sanitizer_common/TestCases/Linux/malloc_usable_size.c
    compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cpp
    compiler-rt/test/sanitizer_common/TestCases/Posix/dump_registers.cpp
    compiler-rt/test/sanitizer_common/TestCases/Posix/mmap_write_exec.cpp
    compiler-rt/test/sanitizer_common/TestCases/Posix/print-module-map.cpp
    compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cpp
    compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
    compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp
    compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cpp
index 03ddf06ae2d41..1c740153a81d7 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cpp
@@ -3,6 +3,9 @@
 // Fails with debug checks: https://bugs.llvm.org/show_bug.cgi?id=46860
 // XFAIL: !compiler-rt-optimized && tsan
 
+// FIXME: Implement.
+// XFAIL: hwasan
+
 // RUN: %clangxx -O0 %s -o %t
 
 // RUN: %env_tool_opts=handle_segv=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp
index 81150fae977e0..4482713dd424d 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp
@@ -1,6 +1,9 @@
 // RUN: %clangxx %s -o %t && %run not %t 1 2>&1 | FileCheck %s
 // UNSUPPORTED: lsan,ubsan,android
 
+// FIXME: Implement.
+// XFAIL: hwasan
+
 #include <dlfcn.h>
 #include <stdio.h>
 #include <string>

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 55a06b6ec5d0e..f91799fc911ac 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
@@ -1,7 +1,10 @@
 // RUN: %clang -O2 %s -o %t && %run %t
 
-// Ubsan does not provide allocator.
-// UNSUPPORTED: ubsan
+// Must not be implemented, no other reason to install interceptors.
+// XFAIL: ubsan
+
+// FIXME: Implement.
+// XFAIL: hwasan
 
 #include <assert.h>
 #include <malloc.h>

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cpp
index a952922aaabc8..09b05d1a44434 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cpp
@@ -1,13 +1,24 @@
+// Test that sanitizers suppress mlock.
 // RUN: %clang  %s -o %t && %run %t
-// XFAIL: ubsan,lsan
+
+// No shadow, so no need to disable mlock.
+// XFAIL: ubsan, lsan
+
+// FIXME: Implement.
+// XFAIL: hwasan
 
 #include <assert.h>
 #include <sys/mman.h>
 
 int main() {
+#if defined(__has_feature)
+#  if __has_feature(hwaddress_sanitizer)
+  // Don't mlock, it may claim all memory.
+  abort();
+#  endif
+#endif
   assert(0 == mlockall(MCL_CURRENT));
   assert(0 == mlock((void *)0x12345, 0x5678));
   assert(0 == munlockall());
   assert(0 == munlock((void *)0x987, 0x654));
 }
-

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/dump_registers.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/dump_registers.cpp
index 07e87bedc131c..f09b2bf4447cc 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/dump_registers.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/dump_registers.cpp
@@ -4,11 +4,7 @@
 // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DUMP
 //
 // FIXME: Implement.
-// UNSUPPORTED: asan
-// UNSUPPORTED: lsan
-// UNSUPPORTED: msan
-// UNSUPPORTED: tsan
-// UNSUPPORTED: ubsan
+// XFAIL: *
 
 #include <signal.h>
 

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/mmap_write_exec.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/mmap_write_exec.cpp
index eec2161573a77..f4165b73db5c1 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/mmap_write_exec.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/mmap_write_exec.cpp
@@ -7,6 +7,9 @@
 // TODO: Fix option on Android, it hangs there for unknown reasons.
 // XFAIL: android
 
+// FIXME: Implement.
+// XFAIL: hwasan
+
 #if defined(__APPLE__)
 #include <Availability.h>
 #endif

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/print-module-map.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/print-module-map.cpp
index c0e80d9debab7..00df7242b9ed2 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/print-module-map.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/print-module-map.cpp
@@ -18,8 +18,8 @@
 // FIXME: Add linux support.
 // XFAIL: msan && target={{.*linux.*}}
 
-// FIXME: Add lsan support.
-// XFAIL: lsan
+// FIXME: Implement.
+// XFAIL: lsan, hwasan
 
 int global;
 

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cpp
index ba98f47b35e08..e95de739fe784 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cpp
@@ -1,10 +1,11 @@
 // Test the weak hooks.
-// RUN: %clangxx %s -o %t
-// RUN: %run %t
+// RUN: %clangxx %s -o %t && %run %t
 
-// Hooks are not implemented for lsan.
-// XFAIL: lsan
-// XFAIL: ubsan
+// Must not be implemented, no other reason to install interceptors.
+// XFAIL: lsan, ubsan
+
+// FIXME: Implement.
+// XFAIL: hwasan
 
 #include <assert.h>
 #include <string.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 1683063baea26..5f31b1f025d29 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
@@ -1,7 +1,10 @@
 // RUN: %clangxx -O0 -g %s -o %t && %run %t
 
-// UBSan does not have its own allocator
-// UNSUPPORTED: ubsan
+// Must not be implemented, no other reason to install interceptors.
+// XFAIL: ubsan
+
+// FIXME: Implement.
+// XFAIL: hwasan
 
 #include <assert.h>
 #include <sanitizer/allocator_interface.h>

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp b/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp
index 160e4e1bd1754..123910818abda 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp
@@ -2,8 +2,13 @@
 
 // Malloc/free hooks are not supported on Windows.
 // XFAIL: target={{.*windows-msvc.*}}
+
+// Must not be implemented, no other reason to install interceptors.
 // XFAIL: ubsan
 
+// FIXME: Implement.
+// XFAIL: hwasan
+
 #include <stdlib.h>
 #include <unistd.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 44f2935434e89..41ff45005d3b4 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp
@@ -43,6 +43,9 @@
 // win32 is disabled due to failing errno tests.
 // UNSUPPORTED: ubsan, target={{.*windows-msvc.*}}
 
+// FIXME: Implement.
+// XFAIL: hwasan
+
 #include <assert.h>
 #include <errno.h>
 #include <limits>


        


More information about the llvm-commits mailing list