[compiler-rt] abd0975 - [asan] Convert tests to check 'target=...'

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 09:09:58 PST 2022


Author: Paul Robinson
Date: 2022-12-16T09:09:38-08:00
New Revision: abd09754edf156bf8c36ac6f52bf003706977b03

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

LOG: [asan] Convert tests to check 'target=...'

Part of the project to eliminate special handling for triples in lit
expressions.

Added: 
    

Modified: 
    compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
    compiler-rt/test/asan/TestCases/Linux/segv_read_write.c
    compiler-rt/test/asan/TestCases/Linux/static_tls.cpp
    compiler-rt/test/asan/TestCases/Posix/no-fd.cpp
    compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cpp
    compiler-rt/test/asan/TestCases/Posix/strndup_oob_test.cpp
    compiler-rt/test/asan/TestCases/Posix/strndup_oob_test2.cpp
    compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
    compiler-rt/test/asan/TestCases/intra-object-overflow.cpp
    compiler-rt/test/asan/TestCases/malloc-no-intercept.c
    compiler-rt/test/asan/TestCases/printf-4.c
    compiler-rt/test/asan/TestCases/printf-m.c
    compiler-rt/test/asan/TestCases/replaceable_new_delete.cpp
    compiler-rt/test/asan/TestCases/strcat-overlap.cpp
    compiler-rt/test/asan/TestCases/strstr_strict.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp b/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
index c294ca53b6be5..b096624a7f95b 100644
--- a/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp
@@ -32,7 +32,7 @@
 // AArch64 bots fail on this test.
 // TODO(alekseys): Android lit do not run ulimit on device.
 // REQUIRES: shadow-scale-3
-// UNSUPPORTED: s390,android,aarch64,powerpc64le
+// UNSUPPORTED: android, target={{(s390|aarch64|powerpc64le).*}}
 
 #include <stdlib.h>
 #include <string.h>

diff  --git a/compiler-rt/test/asan/TestCases/Linux/segv_read_write.c b/compiler-rt/test/asan/TestCases/Linux/segv_read_write.c
index b1379703ed86b..7e29386d6612b 100644
--- a/compiler-rt/test/asan/TestCases/Linux/segv_read_write.c
+++ b/compiler-rt/test/asan/TestCases/Linux/segv_read_write.c
@@ -1,7 +1,7 @@
 // RUN: %clangxx_asan -std=c++11 -O0 %s -o %t
 // RUN: not %run %t       2>&1 | FileCheck %s --check-prefix=READ
 // RUN: not %run %t write 2>&1 | FileCheck %s --check-prefix=WRITE
-// UNSUPPORTED: powerpc64,mips,s390
+// UNSUPPORTED: target={{(powerpc64|mips|s390).*}}
 
 #include <sys/mman.h>
 

diff  --git a/compiler-rt/test/asan/TestCases/Linux/static_tls.cpp b/compiler-rt/test/asan/TestCases/Linux/static_tls.cpp
index 1ee46dc36db81..8ef6ba4d44d34 100644
--- a/compiler-rt/test/asan/TestCases/Linux/static_tls.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/static_tls.cpp
@@ -9,9 +9,9 @@
 // CHECK: __tls_get_addr: static tls
 // CHECK: after
 
-// XFAIL: aarch64
+// XFAIL: target=aarch64{{.*}}
 // binutils 2.26 has a change that causes this test to fail on powerpc64.
-// UNSUPPORTED: powerpc64
+// UNSUPPORTED: target=powerpc64{{.*}}
 
 /// We call __tls_get_addr early in GetTls to work around an issue for glibc<2.25,
 /// so we don't get a log for f().

diff  --git a/compiler-rt/test/asan/TestCases/Posix/no-fd.cpp b/compiler-rt/test/asan/TestCases/Posix/no-fd.cpp
index 3130eda2e426a..f16268593ec40 100644
--- a/compiler-rt/test/asan/TestCases/Posix/no-fd.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/no-fd.cpp
@@ -13,7 +13,7 @@
 // on them remaining closed across an execve(). This is not the case on newer
 // versions of Android. On PPC with ASLR turned on, this fails when linked with
 // lld - see https://bugs.llvm.org/show_bug.cgi?id=45076.
-// UNSUPPORTED: android, powerpc
+// UNSUPPORTED: android, target=powerpc{{.*}}
 
 #include <assert.h>
 #include <stdio.h>

diff  --git a/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cpp b/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cpp
index d13b6187a8c87..927c1b0b1f84e 100644
--- a/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cpp
@@ -31,9 +31,9 @@
 // RUN: %env_asan_opts=min_uar_stack_size_log=24:max_uar_stack_size_log=24:verbosity=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-24 %s
 
 // This test runs out of stack on AArch64.
-// UNSUPPORTED: aarch64
+// UNSUPPORTED: target=aarch64{{.*}}
 // stack size log lower than expected
-// XFAIL: freebsd,netbsd
+// XFAIL: target={{.*(freebsd|netbsd).*}}
 
 // FIXME: Fix this test for dynamic runtime on arm linux.
 // UNSUPPORTED: (arm-linux || armhf-linux) && asan-dynamic-runtime

diff  --git a/compiler-rt/test/asan/TestCases/Posix/strndup_oob_test.cpp b/compiler-rt/test/asan/TestCases/Posix/strndup_oob_test.cpp
index 46c9dceec8d31..43e554723bd95 100644
--- a/compiler-rt/test/asan/TestCases/Posix/strndup_oob_test.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/strndup_oob_test.cpp
@@ -7,7 +7,7 @@
 // RUN: %clangxx_asan -O3 -xc %s -o %t && not %run %t 2>&1 | FileCheck %s
 
 // Unwind problem on arm: "main" is missing from the allocation stack trace.
-// UNSUPPORTED: windows-msvc,s390,arm && !fast-unwinder-works
+// UNSUPPORTED: target={{.*windows-msvc.*}},target=s390{{.*}},target=arm{{.*}} && !fast-unwinder-works
 
 #include <string.h>
 

diff  --git a/compiler-rt/test/asan/TestCases/Posix/strndup_oob_test2.cpp b/compiler-rt/test/asan/TestCases/Posix/strndup_oob_test2.cpp
index 774e7072090e3..6f342de04d479 100644
--- a/compiler-rt/test/asan/TestCases/Posix/strndup_oob_test2.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/strndup_oob_test2.cpp
@@ -7,7 +7,7 @@
 // RUN: %clang_asan -O3 -xc %s -o %t && not %run %t 2>&1 | FileCheck %s
 
 // Unwind problem on arm: "main" is missing from the allocation stack trace.
-// UNSUPPORTED: windows-msvc,s390,arm && !fast-unwinder-works
+// UNSUPPORTED: target={{.*windows-msvc.*}},target=s390{{.*}},target=arm{{.*}} && !fast-unwinder-works
 
 #include <string.h>
 

diff  --git a/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp b/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
index d1b20d7399e60..b498394795c27 100644
--- a/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
+++ b/compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
@@ -9,10 +9,10 @@
 // RUN: not %run %t l 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=LITERAL-NO-G
 
 /// Solaris ld -S has 
diff erent semantics.
-// XFAIL: solaris
+// XFAIL: target={{.*solaris.*}}
 
 /// MSVC linker doesn't support `-S`.
-// UNSUPPORTED: windows
+// UNSUPPORTED: target={{.*windows.*}}
 
 // CHECK: AddressSanitizer: global-buffer-overflow
 // CLASS_STATIC-NO-G: 0x{{.*}} is located 4 bytes after global variable '{{.*}}C::array{{.*}}' defined in '{{.*}}global-location.cpp' {{.*}} of size 40

diff  --git a/compiler-rt/test/asan/TestCases/intra-object-overflow.cpp b/compiler-rt/test/asan/TestCases/intra-object-overflow.cpp
index 17bf35dfe5edd..ff753caf18105 100644
--- a/compiler-rt/test/asan/TestCases/intra-object-overflow.cpp
+++ b/compiler-rt/test/asan/TestCases/intra-object-overflow.cpp
@@ -5,7 +5,7 @@
 // FIXME: fix 32-bits.
 // REQUIRES: asan-64-bits, shadow-scale-3
 // FIXME: Implement ASan intra-object padding in Clang's MS record layout
-// UNSUPPORTED: windows-msvc
+// UNSUPPORTED: target={{.*windows-msvc.*}}
 #include <stdio.h>
 #include <stdlib.h>
 class Foo {

diff  --git a/compiler-rt/test/asan/TestCases/malloc-no-intercept.c b/compiler-rt/test/asan/TestCases/malloc-no-intercept.c
index 3aa25e7b74bc6..eb02a30594a1c 100644
--- a/compiler-rt/test/asan/TestCases/malloc-no-intercept.c
+++ b/compiler-rt/test/asan/TestCases/malloc-no-intercept.c
@@ -11,7 +11,7 @@
 // Conflicts with BIONIC declarations.
 // Lacks mallinfo, mallopt except in libmalloc.  cfree with 
diff erent
 // signature in libc.
-// UNSUPPORTED: solaris
+// UNSUPPORTED: target={{.*solaris.*}}
 
 // Inhibit conflicting declaration of memalign on Solaris.
 #if defined(__sun__) && defined(__svr4__)

diff  --git a/compiler-rt/test/asan/TestCases/printf-4.c b/compiler-rt/test/asan/TestCases/printf-4.c
index 2af81b0efa15b..4c791c69c7748 100644
--- a/compiler-rt/test/asan/TestCases/printf-4.c
+++ b/compiler-rt/test/asan/TestCases/printf-4.c
@@ -4,7 +4,7 @@
 
 // FIXME: sprintf is not intercepted on Windows yet. But this test can
 // pass if sprintf calls memmove, which is intercepted, so we can't XFAIL it.
-// UNSUPPORTED: windows-msvc
+// UNSUPPORTED: target={{.*windows-msvc.*}}
 
 #include <stdio.h>
 int main() {

diff  --git a/compiler-rt/test/asan/TestCases/printf-m.c b/compiler-rt/test/asan/TestCases/printf-m.c
index 3998a6956f748..f7a564b02f2ec 100644
--- a/compiler-rt/test/asan/TestCases/printf-m.c
+++ b/compiler-rt/test/asan/TestCases/printf-m.c
@@ -1,7 +1,7 @@
 // RUN: %clang_asan -O2 %s -o %t && %run %t
 
 // FIXME: printf is not intercepted on Windows yet.
-// UNSUPPORTED: windows-msvc
+// UNSUPPORTED: target={{.*windows-msvc.*}}
 
 #include <stdio.h>
 

diff  --git a/compiler-rt/test/asan/TestCases/replaceable_new_delete.cpp b/compiler-rt/test/asan/TestCases/replaceable_new_delete.cpp
index 5de6c1ad8a683..677a571bba7d7 100644
--- a/compiler-rt/test/asan/TestCases/replaceable_new_delete.cpp
+++ b/compiler-rt/test/asan/TestCases/replaceable_new_delete.cpp
@@ -3,7 +3,7 @@
 // FIXME: Weak symbols aren't supported on Windows, although some code in
 // compiler-rt already exists to solve this problem. We should probably define
 // the new/delete interceptors as "weak" using those workarounds as well.
-// UNSUPPORTED: windows
+// UNSUPPORTED: target={{.*windows.*}}
 
 // RUN: %clangxx %s -o %t -fsanitize=address -shared-libsan && not %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx %s -o %t -fsanitize=address -static-libsan && not %run %t 2>&1 | FileCheck %s

diff  --git a/compiler-rt/test/asan/TestCases/strcat-overlap.cpp b/compiler-rt/test/asan/TestCases/strcat-overlap.cpp
index 34aaf68c24762..76fd3e1f11d14 100644
--- a/compiler-rt/test/asan/TestCases/strcat-overlap.cpp
+++ b/compiler-rt/test/asan/TestCases/strcat-overlap.cpp
@@ -31,7 +31,7 @@
 // depending on how strcat() is implemented. For now only run
 // on platforms where we know the test passes.
 // REQUIRES: x86_64h-darwin || x86_64-darwin || i386-darwin || x86_64-linux || i386-linux
-// UNSUPPORTED: windows-msvc
+// UNSUPPORTED: target={{.*windows-msvc.*}}
 // UNSUPPORTED: android
 
 #include <string.h>

diff  --git a/compiler-rt/test/asan/TestCases/strstr_strict.c b/compiler-rt/test/asan/TestCases/strstr_strict.c
index 0d9482723f5f6..8b7153ffc4092 100644
--- a/compiler-rt/test/asan/TestCases/strstr_strict.c
+++ b/compiler-rt/test/asan/TestCases/strstr_strict.c
@@ -4,7 +4,7 @@
 // Newer versions of Android's strstr() uses memchr() internally, which actually
 // does trigger a heap-buffer-overflow (as it tries to find the
 // null-terminator). The same applies to FreeBSD.
-// UNSUPPORTED: android, freebsd
+// UNSUPPORTED: android, target={{.*freebsd.*}}
 // RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1
 
 // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s


        


More information about the llvm-commits mailing list