From fbe3f89bcf54cd8f674308d839a5a8f318915a8e Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Mon, 19 Dec 2022 11:32:24 -0800 Subject: [PATCH] [tsan] Convert tests to check 'target=...' Part of the project to eliminate special handling for triples in lit expressions. --- compiler-rt/test/tsan/Linux/dlopen_static_tls.cpp | 2 +- compiler-rt/test/tsan/cond_cancel.c | 2 +- compiler-rt/test/tsan/dtls.c | 2 +- compiler-rt/test/tsan/getline_nohang.cpp | 2 +- compiler-rt/test/tsan/ignore_lib1.cpp | 2 +- compiler-rt/test/tsan/ignore_lib4.cpp | 4 ++-- compiler-rt/test/tsan/ignore_lib5.cpp | 4 ++-- compiler-rt/test/tsan/ignore_lib6.cpp | 4 ++-- compiler-rt/test/tsan/java_race_pc.cpp | 2 +- compiler-rt/test/tsan/map32bit.cpp | 12 ++++++------ compiler-rt/test/tsan/mutex_lock_destroyed.cpp | 2 +- compiler-rt/test/tsan/race_range_pc.cpp | 2 +- compiler-rt/test/tsan/setuid2.c | 2 +- compiler-rt/test/tsan/signal_errno.cpp | 2 +- compiler-rt/test/tsan/signal_longjmp.cpp | 2 +- compiler-rt/test/tsan/signal_sync2.cpp | 2 +- compiler-rt/test/tsan/strerror_r.cpp | 2 +- compiler-rt/test/tsan/thread_exit.c | 2 +- 18 files changed, 26 insertions(+), 26 deletions(-) diff --git a/compiler-rt/test/tsan/Linux/dlopen_static_tls.cpp b/compiler-rt/test/tsan/Linux/dlopen_static_tls.cpp index f97348d..c661293 100644 --- a/compiler-rt/test/tsan/Linux/dlopen_static_tls.cpp +++ b/compiler-rt/test/tsan/Linux/dlopen_static_tls.cpp @@ -24,7 +24,7 @@ // Failing on bots: // https://lab.llvm.org/buildbot#builders/184/builds/1580 // https://lab.llvm.org/buildbot#builders/18/builds/3167 -// UNSUPPORTED: aarch64, powerpc64, powerpc64le +// UNSUPPORTED: target={{(aarch64|powerpc64).*}} #ifdef BUILD_SO diff --git a/compiler-rt/test/tsan/cond_cancel.c b/compiler-rt/test/tsan/cond_cancel.c index 7f20b8f..03070bf 100644 --- a/compiler-rt/test/tsan/cond_cancel.c +++ b/compiler-rt/test/tsan/cond_cancel.c @@ -8,7 +8,7 @@ // (defined in sanitizer_thread_registry.cpp). It might seem a bug on glibc, // however the same version GLIBC-2.17 will not make fail the test on // powerpc64 BE (VMA=46) -// UNSUPPORTED: powerpc64-unknown-linux-gnu +// UNSUPPORTED: target=powerpc64-unknown-linux-gnu{{.*}} #include "test.h" diff --git a/compiler-rt/test/tsan/dtls.c b/compiler-rt/test/tsan/dtls.c index 57c9da8..adcd11e 100644 --- a/compiler-rt/test/tsan/dtls.c +++ b/compiler-rt/test/tsan/dtls.c @@ -2,7 +2,7 @@ // RUN: %clang_tsan %darwin_min_target_with_tls_support %s -DBUILD_SO -fPIC -o \ // RUN: %t-so.so -shared // RUN: %run %t 2>&1 | FileCheck %s -// XFAIL: netbsd +// XFAIL: target={{.*netbsd.*}} // Test that tsan cleans up dynamic TLS memory between reuse. diff --git a/compiler-rt/test/tsan/getline_nohang.cpp b/compiler-rt/test/tsan/getline_nohang.cpp index 027ba7b..d1bb279 100644 --- a/compiler-rt/test/tsan/getline_nohang.cpp +++ b/compiler-rt/test/tsan/getline_nohang.cpp @@ -1,7 +1,7 @@ // RUN: %clangxx_tsan -O1 %s -o %t && %run %t // Data race randomly triggered. -// UNSUPPORTED: netbsd +// UNSUPPORTED: target={{.*netbsd.*}} // Make sure TSan doesn't deadlock on a file stream lock at program shutdown. // See https://github.com/google/sanitizers/issues/454 diff --git a/compiler-rt/test/tsan/ignore_lib1.cpp b/compiler-rt/test/tsan/ignore_lib1.cpp index 0113951..c8cd3f4 100644 --- a/compiler-rt/test/tsan/ignore_lib1.cpp +++ b/compiler-rt/test/tsan/ignore_lib1.cpp @@ -12,7 +12,7 @@ // in called_from_lib suppression are ignored. // REQUIRES: stable-runtime -// UNSUPPORTED: powerpc64le +// UNSUPPORTED: target=powerpc64le{{.*}} // FIXME: This test regularly fails on powerpc64 LE possibly starting with // r279664. Re-enable the test once the problem(s) have been fixed. diff --git a/compiler-rt/test/tsan/ignore_lib4.cpp b/compiler-rt/test/tsan/ignore_lib4.cpp index 06241c7..d65ecd8 100644 --- a/compiler-rt/test/tsan/ignore_lib4.cpp +++ b/compiler-rt/test/tsan/ignore_lib4.cpp @@ -8,10 +8,10 @@ // powerpc64 big endian bots failed with "FileCheck error: '-' is empty" due // to a segmentation fault. -// UNSUPPORTED: powerpc64-unknown-linux-gnu +// UNSUPPORTED: target=powerpc64-unknown-linux-gnu{{.*}} // aarch64 bots failed with "called_from_lib suppression 'libignore_lib4.so' // is matched against 2 libraries". -// UNSUPPORTED: aarch64 +// UNSUPPORTED: target=aarch64{{.*}} // Test longjmp in ignored lib. // It used to crash since we jumped out of ScopedInterceptor scope. diff --git a/compiler-rt/test/tsan/ignore_lib5.cpp b/compiler-rt/test/tsan/ignore_lib5.cpp index a71d560..8850c12 100644 --- a/compiler-rt/test/tsan/ignore_lib5.cpp +++ b/compiler-rt/test/tsan/ignore_lib5.cpp @@ -9,7 +9,7 @@ // RUN: %env_tsan_opts=suppressions='%s.supp' %run %t-dir/executable 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP // REQUIRES: stable-runtime -// UNSUPPORTED: powerpc64le +// UNSUPPORTED: target=powerpc64le{{.*}} // FIXME: This test occasionally fails on powerpc64 LE possibly starting with // r279664. Re-enable the test once the problem(s) have been fixed. @@ -19,7 +19,7 @@ // This was caused by non-atomicity of reading of /proc/self/maps. // ReadProcMaps() on NetBSD does not handle >=1MB of memory layout information -// UNSUPPORTED: netbsd +// UNSUPPORTED: target={{.*netbsd.*}} #ifndef LIB diff --git a/compiler-rt/test/tsan/ignore_lib6.cpp b/compiler-rt/test/tsan/ignore_lib6.cpp index b03bde3..507c929 100644 --- a/compiler-rt/test/tsan/ignore_lib6.cpp +++ b/compiler-rt/test/tsan/ignore_lib6.cpp @@ -6,8 +6,8 @@ // Copied from ignore_lib5.cpp: // REQUIRES: stable-runtime -// UNSUPPORTED: powerpc64le -// UNSUPPORTED: netbsd +// UNSUPPORTED: target=powerpc64le{{.*}} +// UNSUPPORTED: target={{.*netbsd.*}} // Test that pthread_detach works in libraries ignored by called_from_lib. // For more context see: diff --git a/compiler-rt/test/tsan/java_race_pc.cpp b/compiler-rt/test/tsan/java_race_pc.cpp index be1c5f2..ccd996c 100644 --- a/compiler-rt/test/tsan/java_race_pc.cpp +++ b/compiler-rt/test/tsan/java_race_pc.cpp @@ -2,7 +2,7 @@ // This test fails on powerpc64 big endian. // The Tsan report is returning wrong information about // the location of the race. -// XFAIL: powerpc64-unknown-linux-gnu +// XFAIL: target=powerpc64-unknown-linux-gnu{{.*}} #include "java.h" void foobar() { diff --git a/compiler-rt/test/tsan/map32bit.cpp b/compiler-rt/test/tsan/map32bit.cpp index 614b270..e8bac22 100644 --- a/compiler-rt/test/tsan/map32bit.cpp +++ b/compiler-rt/test/tsan/map32bit.cpp @@ -8,14 +8,14 @@ // https://github.com/google/sanitizers/issues/412 // MAP_32BIT flag for mmap is supported only for x86_64. -// XFAIL: mips -// XFAIL: aarch64 -// XFAIL: powerpc64 -// XFAIL: s390x -// XFAIL: loongarch64 +// XFAIL: target=mips{{.*}} +// XFAIL: target=aarch64{{.*}} +// XFAIL: target=powerpc64{{.*}} +// XFAIL: target=s390x{{.*}} +// XFAIL: target=loongarch64{{.*}} // MAP_32BIT doesn't exist on OS X and NetBSD. -// UNSUPPORTED: darwin,netbsd +// UNSUPPORTED: darwin,target={{.*netbsd.*}} void *Thread(void *ptr) { *(int*)ptr = 42; diff --git a/compiler-rt/test/tsan/mutex_lock_destroyed.cpp b/compiler-rt/test/tsan/mutex_lock_destroyed.cpp index 892d444..b727b92 100644 --- a/compiler-rt/test/tsan/mutex_lock_destroyed.cpp +++ b/compiler-rt/test/tsan/mutex_lock_destroyed.cpp @@ -3,7 +3,7 @@ // RUN: %deflake %run %t 1 | FileCheck %s // The pthread_mutex_lock interceptor assumes incompatible internals w/ NetBSD -// XFAIL: netbsd +// XFAIL: target={{.*netbsd.*}} #include #include diff --git a/compiler-rt/test/tsan/race_range_pc.cpp b/compiler-rt/test/tsan/race_range_pc.cpp index a4689bd..30d89e5 100644 --- a/compiler-rt/test/tsan/race_range_pc.cpp +++ b/compiler-rt/test/tsan/race_range_pc.cpp @@ -2,7 +2,7 @@ // This test fails on powerpc64 big endian. // The Tsan report is returning wrong information about // the location of the race. -// XFAIL: powerpc64-unknown-linux-gnu +// XFAIL: target=powerpc64-unknown-linux-gnu{{.*}} #include "test.h" diff --git a/compiler-rt/test/tsan/setuid2.c b/compiler-rt/test/tsan/setuid2.c index 3ea8978..6f42223 100644 --- a/compiler-rt/test/tsan/setuid2.c +++ b/compiler-rt/test/tsan/setuid2.c @@ -4,7 +4,7 @@ // the unsupported flag. // https://llvm.org/bugs/show_bug.cgi?id=25799 // -// UNSUPPORTED: powerpc64-unknown-linux-gnu +// UNSUPPORTED: target=powerpc64-unknown-linux-gnu{{.*}} #include "test.h" #include #include diff --git a/compiler-rt/test/tsan/signal_errno.cpp b/compiler-rt/test/tsan/signal_errno.cpp index 5e6b1ce..7e1fd4b 100644 --- a/compiler-rt/test/tsan/signal_errno.cpp +++ b/compiler-rt/test/tsan/signal_errno.cpp @@ -1,7 +1,7 @@ // RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s // This test fails on powerpc64 BE (VMA=44), it does not appear to be // a functional problem, but the Tsan report is missing some info. -// XFAIL: powerpc64-unknown-linux-gnu +// XFAIL: target=powerpc64-unknown-linux-gnu{{.*}} #include "test.h" #include diff --git a/compiler-rt/test/tsan/signal_longjmp.cpp b/compiler-rt/test/tsan/signal_longjmp.cpp index f9fa4f5..7e9ffca 100644 --- a/compiler-rt/test/tsan/signal_longjmp.cpp +++ b/compiler-rt/test/tsan/signal_longjmp.cpp @@ -6,7 +6,7 @@ // This test fails on powerpc64 BE (VMA=44), a segmentation fault // error happens at the second assignment // "((volatile int *volatile)mem)[1] = 1". -// XFAIL: powerpc64-unknown-linux-gnu +// XFAIL: target=powerpc64-unknown-linux-gnu{{.*}} #include #include diff --git a/compiler-rt/test/tsan/signal_sync2.cpp b/compiler-rt/test/tsan/signal_sync2.cpp index a1c31dc..2bc1383 100644 --- a/compiler-rt/test/tsan/signal_sync2.cpp +++ b/compiler-rt/test/tsan/signal_sync2.cpp @@ -2,7 +2,7 @@ // UNSUPPORTED: darwin // Fails episodically on powerpc bots: // https://lab.llvm.org/buildbot/#/builders/121/builds/13391 -// UNSUPPORTED: powerpc64, powerpc64le +// UNSUPPORTED: target=powerpc64{{.*}} #include "test.h" #include #include diff --git a/compiler-rt/test/tsan/strerror_r.cpp b/compiler-rt/test/tsan/strerror_r.cpp index 438f549..6adab1e 100644 --- a/compiler-rt/test/tsan/strerror_r.cpp +++ b/compiler-rt/test/tsan/strerror_r.cpp @@ -1,7 +1,7 @@ // RUN: %clangxx_tsan -O1 -DTEST_ERROR=ERANGE %s -o %t && %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-SYS %s // RUN: %clangxx_tsan -O1 -DTEST_ERROR=-1 %s -o %t && not %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-USER %s // This test is for GNU specific version of strerror_r() -// UNSUPPORTED: darwin, netbsd, freebsd +// UNSUPPORTED: darwin, target={{.*(netbsd|freebsd).*}} #include "test.h" diff --git a/compiler-rt/test/tsan/thread_exit.c b/compiler-rt/test/tsan/thread_exit.c index 7038baa..9c97672 100644 --- a/compiler-rt/test/tsan/thread_exit.c +++ b/compiler-rt/test/tsan/thread_exit.c @@ -1,7 +1,7 @@ // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s // Crashes on powerpc64be -// UNSUPPORTED: powerpc64 +// UNSUPPORTED: target=powerpc64{{.*}} #include "test.h" -- 2.7.4