[compiler-rt] [TySan][Sanitizer Common] Enable TySan testing in the sanitizer commo… (PR #191385)

Matthew Nagy via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 03:33:20 PDT 2026


https://github.com/gbMattN updated https://github.com/llvm/llvm-project/pull/191385

>From 8eec40d03cc49506c9feece03d0b6937be2475e7 Mon Sep 17 00:00:00 2001
From: gbMattN <matthew.nagy at sony.com>
Date: Fri, 10 Apr 2026 11:41:47 +0100
Subject: [PATCH] [TySan][Sanitizer Common] Enable TySan testing in the
 sanitizer common test suite

---
 compiler-rt/test/sanitizer_common/CMakeLists.txt              | 2 +-
 .../TestCases/Linux/aligned_alloc-alignment.cpp               | 2 +-
 .../TestCases/Linux/allocator_returns_null_std.cpp            | 4 ++--
 .../sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp   | 3 +++
 .../test/sanitizer_common/TestCases/Linux/deepbind.cpp        | 2 +-
 .../sanitizer_common/TestCases/Linux/free_aligned_sized.c     | 2 +-
 .../test/sanitizer_common/TestCases/Linux/free_sized.c        | 2 +-
 .../sanitizer_common/TestCases/Linux/malloc_usable_size.c     | 2 +-
 .../test/sanitizer_common/TestCases/Linux/mlock_test.cpp      | 2 +-
 compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp  | 2 +-
 .../sanitizer_common/TestCases/Linux/pvalloc-overflow.cpp     | 2 +-
 .../sanitizer_common/TestCases/Linux/release_to_os_test.cpp   | 2 +-
 .../TestCases/Linux/replace_dlopen_main_program_test.cpp      | 2 +-
 .../sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp   | 2 +-
 .../TestCases/Linux/soft_rss_limit_mb_test.cpp                | 4 ++--
 .../test/sanitizer_common/TestCases/Linux/tls_get_addr.c      | 2 +-
 .../test/sanitizer_common/TestCases/Linux/tls_malloc_hook.c   | 2 +-
 .../TestCases/Linux/unexpected_format_specifier_test.cpp      | 1 +
 .../test/sanitizer_common/TestCases/Posix/huge_malloc.c       | 2 +-
 .../test/sanitizer_common/TestCases/Posix/mmap_write_exec.cpp | 3 +++
 .../TestCases/Posix/posix_memalign-alignment.cpp              | 2 +-
 .../sanitizer_common/TestCases/Posix/print-module-map.cpp     | 2 +-
 .../TestCases/Posix/sanitizer_set_death_callback_test.cpp     | 2 +-
 .../test/sanitizer_common/TestCases/Posix/weak_hook_test.cpp  | 2 ++
 .../test/sanitizer_common/TestCases/allocator_interface.cpp   | 2 +-
 .../sanitizer_common/TestCases/allocator_returns_null.cpp     | 2 +-
 .../test/sanitizer_common/TestCases/compress_stack_depot.cpp  | 2 ++
 compiler-rt/test/sanitizer_common/TestCases/corelimit.cpp     | 2 +-
 .../test/sanitizer_common/TestCases/get_allocated_begin.cpp   | 2 +-
 .../sanitizer_common/TestCases/hard_rss_limit_mb_test.cpp     | 4 ++--
 compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp   | 2 +-
 .../TestCases/malloc_hook_get_allocated_size_fast.cpp         | 2 +-
 .../test/sanitizer_common/TestCases/max_allocation_size.cpp   | 3 ++-
 .../test/sanitizer_common/TestCases/reallocarray-overflow.cpp | 2 +-
 .../TestCases/sanitizer_coverage_symbolize.cpp                | 2 ++
 .../TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp       | 2 +-
 .../TestCases/sanitizer_coverage_trace_pc_guard.cpp           | 2 +-
 compiler-rt/test/sanitizer_common/lit.common.cfg.py           | 3 +++
 38 files changed, 51 insertions(+), 34 deletions(-)

diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt
index 739879d961248..684aa552b571a 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 hwasan msan tsan ubsan)
+set(SUPPORTED_TOOLS_INIT asan lsan hwasan msan tsan tysan 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/TestCases/Linux/aligned_alloc-alignment.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/aligned_alloc-alignment.cpp
index ef7f1cb44e60c..3dd79614b9c2b 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/aligned_alloc-alignment.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/aligned_alloc-alignment.cpp
@@ -14,7 +14,7 @@
 
 // REQUIRES: stable-runtime
 
-// UNSUPPORTED: android, ubsan
+// UNSUPPORTED: android, tysan, ubsan
 
 #include <assert.h>
 #include <errno.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/allocator_returns_null_std.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/allocator_returns_null_std.cpp
index 812cf049f2a9b..dd80f12f20cb6 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/allocator_returns_null_std.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/allocator_returns_null_std.cpp
@@ -4,8 +4,8 @@
 // RUN: %clangxx -O0 %s -o %t
 // RUN: %env_tool_opts=allocator_may_return_null=0 not %run %t 2>&1 | FileCheck %s
 
-// UBSAN has no allocator.
-// UNSUPPORTED: ubsan
+// TYSAN and UBSAN has no allocator.
+// UNSUPPORTED: tysan, ubsan
 
 // REQUIRES: x86_64-target-arch
 
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp
index d0400afe743b3..93d5963c5f12b 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp
@@ -4,6 +4,9 @@
 // REQUIRES: stable-runtime
 // XFAIL: android && asan
 
+// Implement
+// XFAIL: tysan
+
 #include <errno.h>
 #include <fcntl.h>
 #include <pthread.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp
index 4482713dd424d..d82cdc522ab87 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp
@@ -1,5 +1,5 @@
 // RUN: %clangxx %s -o %t && %run not %t 1 2>&1 | FileCheck %s
-// UNSUPPORTED: lsan,ubsan,android
+// UNSUPPORTED: lsan,tysan,ubsan,android
 
 // FIXME: Implement.
 // XFAIL: hwasan
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/free_aligned_sized.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/free_aligned_sized.c
index 7c52af1e9dbda..e51d54913d82c 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/free_aligned_sized.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/free_aligned_sized.c
@@ -1,5 +1,5 @@
 // RUN: %clang -std=c23 -O0 %s -o %t && %run %t
-// UNSUPPORTED: ubsan
+// UNSUPPORTED: tysan, ubsan
 
 #include <stddef.h>
 #include <stdlib.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/free_sized.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/free_sized.c
index 3dde1277496a2..3c2acc2484d04 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/free_sized.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/free_sized.c
@@ -1,5 +1,5 @@
 // RUN: %clang -std=c23 -O0 %s -o %t && %run %t
-// UNSUPPORTED: ubsan
+// UNSUPPORTED: tysan, ubsan
 
 #include <stddef.h>
 #include <stdlib.h>
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 0fdec468e08ae..9b555084330ca 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,7 @@
 // RUN: %clang -O2 %s -o %t && %run %t
 
 // Must not be implemented, no other reason to install interceptors.
-// XFAIL: ubsan
+// XFAIL: tysan, ubsan
 
 #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 09b05d1a44434..38c62361cbcb8 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cpp
@@ -5,7 +5,7 @@
 // XFAIL: ubsan, lsan
 
 // FIXME: Implement.
-// XFAIL: hwasan
+// XFAIL: hwasan, tysan
 
 #include <assert.h>
 #include <sys/mman.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp
index 7633eb4762292..698517a81c67e 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp
@@ -1,5 +1,5 @@
 // RUN: %clangxx %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: android, hwasan, ubsan
+// UNSUPPORTED: android, hwasan, tysan, ubsan
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/pvalloc-overflow.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/pvalloc-overflow.cpp
index b082191cb0092..1843c9c3f0778 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/pvalloc-overflow.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/pvalloc-overflow.cpp
@@ -6,7 +6,7 @@
 
 // REQUIRES: stable-runtime
 
-// UNSUPPORTED: android, target={{.*(freebsd|netbsd).*}}, ubsan
+// UNSUPPORTED: android, target={{.*(freebsd|netbsd).*}}, tysan, ubsan
 
 // Checks that pvalloc overflows are caught. If the allocator is allowed to
 // return null, the errno should be set to ENOMEM.
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/release_to_os_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/release_to_os_test.cpp
index c7a5534696361..90fa1af9f7daa 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/release_to_os_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/release_to_os_test.cpp
@@ -6,7 +6,7 @@
 // UNSUPPORTED: target={{(powerpc64|loongarch64).*}}
 
 // Not needed, no allocator.
-// UNSUPPORTED: ubsan
+// UNSUPPORTED: tysan, ubsan
 
 // FIXME: This mode uses 32bit allocator without purge.
 // UNSUPPORTED: hwasan-aliasing
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/replace_dlopen_main_program_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/replace_dlopen_main_program_test.cpp
index 72fff2719def2..122c6bb0299ad 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/replace_dlopen_main_program_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/replace_dlopen_main_program_test.cpp
@@ -8,7 +8,7 @@
 // REQUIRES: glibc
 
 // Does not intercept dlopen
-// UNSUPPORTED: hwasan, lsan, ubsan
+// UNSUPPORTED: hwasan, lsan, tysan, ubsan
 
 // Flag has no effect with dynamic runtime
 // UNSUPPORTED: asan-dynamic-runtime
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp
index 3e9ff924a3c4a..95930cd6016c3 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp
@@ -6,7 +6,7 @@
 // UNSUPPORTED: i386-linux
 
 // Do not intercept __tls_get_addr
-// UNSUPPORTED: hwasan, lsan, ubsan, android
+// UNSUPPORTED: hwasan, lsan, tysan, ubsan, android
 
 // FIXME: Investigate
 // UNSUPPORTED: target=powerpc64{{.*}}
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cpp
index e6d1c6eaca08e..24cce3d5829a0 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cpp
@@ -10,8 +10,8 @@
 // RUN: %env_tool_opts=soft_rss_limit_mb=420:quarantine_size=1:allocator_may_return_null=0:can_use_proc_maps_statm=0 not %run %t 2>&1 | FileCheck %s -check-prefix=CHECK_MAY_RETURN_0 --implicit-check-not="returned null"
 // REQUIRES: stable-runtime
 
-// Ubsan does not intercept pthread_create.
-// XFAIL: ubsan
+// Tysan and Ubsan do not intercept pthread_create.
+// XFAIL: tysan, ubsan
 
 // THUMB starts background thead only for Asan.
 // XFAIL: target=thumb{{.*}} && !asan
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_get_addr.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_get_addr.c
index a4a4f64ed3706..c008781a95951 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_get_addr.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_get_addr.c
@@ -8,7 +8,7 @@
 // XFAIL: i386-linux
 
 // These don't intercept __tls_get_addr.
-// XFAIL: lsan,hwasan,ubsan
+// XFAIL: lsan,hwasan,tysan,ubsan
 
 // FIXME: Fails for unknown reasons.
 // UNSUPPORTED: powerpc64le-target-arch
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_malloc_hook.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_malloc_hook.c
index 587f3b1401f10..8028d70884b88 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_malloc_hook.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_malloc_hook.c
@@ -7,7 +7,7 @@
 // REQUIRES: glibc
 
 // No allocator and hooks.
-// XFAIL: ubsan
+// XFAIL: tysan, ubsan
 
 #ifndef BUILD_SO
 #  include <assert.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp
index fdce916ad1e1a..942f81f4e8a6f 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp
@@ -2,6 +2,7 @@
 // UNSUPPORTED: hwasan
 // UNSUPPORTED: lsan
 // UNSUPPORTED: msan
+// UNSUPPORTED: tysan
 // UNSUPPORTED: ubsan
 #include <stdio.h>
 int main() {
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/huge_malloc.c b/compiler-rt/test/sanitizer_common/TestCases/Posix/huge_malloc.c
index 16ebeda5315e0..edd5e08fb3c8c 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/huge_malloc.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/huge_malloc.c
@@ -7,7 +7,7 @@
 // UNSUPPORTED: android-26
 
 // FIXME: Hangs.
-// UNSUPPORTED: tsan
+// UNSUPPORTED: tsan, tysan
 
 // Hwasan requires tagging of new allocations, so needs RSS for shadow.
 // UNSUPPORTED: hwasan
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..5e12fe647b75a 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
@@ -4,6 +4,9 @@
 // RUN:   --check-prefix=CHECK-DISABLED
 // ubsan and lsan do not install mmap interceptors UNSUPPORTED: ubsan, lsan
 
+// tysan doesn't use common mmap interceptors (maybe could support this?)
+// UNSUPPORTED: tysan
+
 // TODO: Fix option on Android, it hangs there for unknown reasons.
 // XFAIL: android
 
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_memalign-alignment.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_memalign-alignment.cpp
index 70fba25f59b84..edcf32883e621 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_memalign-alignment.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_memalign-alignment.cpp
@@ -17,7 +17,7 @@
 
 // REQUIRES: stable-runtime
 
-// UNSUPPORTED: ubsan
+// UNSUPPORTED: tysan, ubsan
 
 #include <assert.h>
 #include <errno.h>
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 00df7242b9ed2..4bd5b8546265a 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
@@ -19,7 +19,7 @@
 // XFAIL: msan && target={{.*linux.*}}
 
 // FIXME: Implement.
-// XFAIL: lsan, hwasan
+// XFAIL: lsan, hwasan, tysan
 
 int global;
 
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cpp
index 9c5ae13cfd8b7..ace190d2f6c6e 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cpp
@@ -2,7 +2,7 @@
 
 // REQUIRES: stable-runtime
 
-// XFAIL: ubsan
+// XFAIL: tysan, ubsan
 // FIXME: On Darwin, LSAn detects the leak, but does not invoke the death_callback.
 // XFAIL: darwin && lsan
 
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 e95de739fe784..228ddaee4ebbd 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
@@ -7,6 +7,8 @@
 // FIXME: Implement.
 // XFAIL: hwasan
 
+// UNSUPPORTED: tysan
+
 #include <assert.h>
 #include <string.h>
 #if defined(_GNU_SOURCE)
diff --git a/compiler-rt/test/sanitizer_common/TestCases/allocator_interface.cpp b/compiler-rt/test/sanitizer_common/TestCases/allocator_interface.cpp
index 6f5f05639800a..08427ffd4e9ac 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/allocator_interface.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/allocator_interface.cpp
@@ -2,7 +2,7 @@
 // RUN: %clangxx %s -o %t && %run %t 5678910
 
 // No allocator.
-// UNSUPPORTED: ubsan
+// UNSUPPORTED: tysan, ubsan
 
 #include <assert.h>
 #include <sanitizer/allocator_interface.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp b/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp
index ca6f637b9a3f5..4be4a09ce809a 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp
@@ -36,7 +36,7 @@
 // RUN:   | FileCheck %s --check-prefix=CHECK-NULL
 
 // TODO(alekseyshl): win32 is disabled due to failing errno tests, fix it there.
-// UNSUPPORTED: ubsan, target={{.*windows-msvc.*}}
+// UNSUPPORTED: tysan, ubsan, target={{.*windows-msvc.*}}
 
 #include <assert.h>
 #include <errno.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/compress_stack_depot.cpp b/compiler-rt/test/sanitizer_common/TestCases/compress_stack_depot.cpp
index 7ad0ff08df33d..ba66156222cac 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/compress_stack_depot.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/compress_stack_depot.cpp
@@ -7,6 +7,8 @@
 
 // Ubsan does not store stacks.
 // UNSUPPORTED: ubsan
+// Tysan does not store stacks.
+// UNSUPPORTED: tysan
 
 // FIXME: Fails for unknown reason.
 // UNSUPPORTED: target=s390x{{.*}}
diff --git a/compiler-rt/test/sanitizer_common/TestCases/corelimit.cpp b/compiler-rt/test/sanitizer_common/TestCases/corelimit.cpp
index 9b56471905aaf..340c3f5c39ba7 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/corelimit.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/corelimit.cpp
@@ -1,5 +1,5 @@
 // RUN: %clangxx -O0 %s -o %t && %run %t
-// UNSUPPORTED: lsan,ubsan
+// UNSUPPORTED: lsan,tysan,ubsan
 
 #include <assert.h>
 #include <sys/time.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 7ae2df5d5647b..2415d17c96de4 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,7 @@
 // RUN: %clangxx -O0 -g %s -o %t && %run %t
 
 // Must not be implemented, no other reason to install interceptors.
-// XFAIL: ubsan
+// XFAIL: tysan, ubsan
 
 #include <assert.h>
 #include <sanitizer/allocator_interface.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cpp
index 4eb2247b1d38f..09187b47bce5d 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cpp
@@ -10,8 +10,8 @@
 // RUN: %env_tool_opts=hard_rss_limit_mb=4000 %run %t
 // RUN: %run %t
 //
-// Ubsan does not intercept pthread_create.
-// XFAIL: ubsan
+// Neither Tysan nor Ubsan intercept pthread_create.
+// XFAIL: tysan, ubsan
 // UNSUPPORTED: target={{.*(freebsd|solaris).*}}, darwin
 
 // THUMB starts background thead only for Asan.
diff --git a/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp b/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp
index 44dffcd47a51a..846071ae83606 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp
@@ -4,7 +4,7 @@
 // XFAIL: target={{.*windows-msvc.*}}
 
 // Must not be implemented, no other reason to install interceptors.
-// XFAIL: ubsan
+// XFAIL: tysan, ubsan
 
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/malloc_hook_get_allocated_size_fast.cpp b/compiler-rt/test/sanitizer_common/TestCases/malloc_hook_get_allocated_size_fast.cpp
index 68b22d4f99f63..c96d865592ece 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/malloc_hook_get_allocated_size_fast.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/malloc_hook_get_allocated_size_fast.cpp
@@ -4,7 +4,7 @@
 // XFAIL: target={{.*windows-msvc.*}}
 
 // Must not be implemented, no other reason to install interceptors.
-// XFAIL: ubsan
+// XFAIL: tysan, ubsan
 
 #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 2fde16fbed3d2..b3d6081bde422 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp
@@ -41,7 +41,8 @@
 // RUN:   %run %t strndup 2>&1 | FileCheck %s --check-prefix=CHECK-NULL
 
 // win32 is disabled due to failing errno tests.
-// UNSUPPORTED: ubsan, target={{.*windows-msvc.*}}
+// tysan doesn't support the max_allocation_size_mb flag
+// UNSUPPORTED: tysan, ubsan, target={{.*windows-msvc.*}}
 
 // Symbolizer needs to allocated memory when reporting.
 // UNSUPPORTED: internal_symbolizer
diff --git a/compiler-rt/test/sanitizer_common/TestCases/reallocarray-overflow.cpp b/compiler-rt/test/sanitizer_common/TestCases/reallocarray-overflow.cpp
index 245a5b47ab246..1864af836c083 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/reallocarray-overflow.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/reallocarray-overflow.cpp
@@ -2,7 +2,7 @@
 // RUN: %env_tool_opts=allocator_may_return_null=0 not %run %t 2>&1 | FileCheck %s
 // RUN: %env_tool_opts=allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NULL
 
-// REQUIRES: stable-runtime && !ubsan && !darwin
+// REQUIRES: stable-runtime && !tysan && !ubsan && !darwin
 
 #include <stdio.h>
 
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp
index ba59e28f688a7..addf78984949b 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp
@@ -3,6 +3,8 @@
 // REQUIRES: x86_64-linux
 // XFAIL: tsan
 //
+// UNSUPPORTED: tysan
+//
 // RUN: rm -rf %t_workdir
 // RUN: mkdir -p %t_workdir
 // RUN: cd %t_workdir
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp
index f6ccbb6981352..926ce56ad3676 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp
@@ -2,7 +2,7 @@
 
 // REQUIRES: has_sancovcc
 // Doesn't work on big-endian targets.
-// UNSUPPORTED: ubsan,target={{(powerpc64|s390x|sparc|thumb).*}}
+// UNSUPPORTED: tysan,ubsan,target={{(powerpc64|s390x|sparc|thumb).*}}
 // XFAIL: tsan,darwin
 // XFAIL: android && asan
 
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp
index 3797c469eb186..9c44009c6c156 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp
@@ -3,7 +3,7 @@
 // REQUIRES: has_sancovcc
 // UNSUPPORTED: ubsan,i386-darwin,target={{(powerpc64|s390x|sparc|thumb).*}}
 // This test is failing for lsan on darwin on x86_64h.
-// UNSUPPORTED: x86_64h-darwin && lsan
+// UNSUPPORTED: tysan, x86_64h-darwin && lsan
 // XFAIL: tsan
 // XFAIL: android && asan
 // XFAIL: darwin-remote
diff --git a/compiler-rt/test/sanitizer_common/lit.common.cfg.py b/compiler-rt/test/sanitizer_common/lit.common.cfg.py
index 5614229d9a126..36d50dec445c1 100644
--- a/compiler-rt/test/sanitizer_common/lit.common.cfg.py
+++ b/compiler-rt/test/sanitizer_common/lit.common.cfg.py
@@ -34,6 +34,9 @@
 elif config.tool_name == "ubsan":
     tool_cflags = ["-fsanitize=undefined"]
     tool_options = "UBSAN_OPTIONS"
+elif config.tool_name == "tysan":
+    tool_cflags = ["-fsanitize=type"]
+    tool_options = "TYSAN_OPTIONS"
 else:
     lit_config.fatal("Unknown tool for sanitizer_common tests: %r" % config.tool_name)
 



More information about the llvm-commits mailing list