[compiler-rt] fbe3f89 - [tsan] Convert tests to check 'target=...'

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 11:32:46 PST 2022


Author: Paul Robinson
Date: 2022-12-19T11:32:38-08:00
New Revision: fbe3f89bcf54cd8f674308d839a5a8f318915a8e

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

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

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

Added: 
    

Modified: 
    compiler-rt/test/tsan/Linux/dlopen_static_tls.cpp
    compiler-rt/test/tsan/cond_cancel.c
    compiler-rt/test/tsan/dtls.c
    compiler-rt/test/tsan/getline_nohang.cpp
    compiler-rt/test/tsan/ignore_lib1.cpp
    compiler-rt/test/tsan/ignore_lib4.cpp
    compiler-rt/test/tsan/ignore_lib5.cpp
    compiler-rt/test/tsan/ignore_lib6.cpp
    compiler-rt/test/tsan/java_race_pc.cpp
    compiler-rt/test/tsan/map32bit.cpp
    compiler-rt/test/tsan/mutex_lock_destroyed.cpp
    compiler-rt/test/tsan/race_range_pc.cpp
    compiler-rt/test/tsan/setuid2.c
    compiler-rt/test/tsan/signal_errno.cpp
    compiler-rt/test/tsan/signal_longjmp.cpp
    compiler-rt/test/tsan/signal_sync2.cpp
    compiler-rt/test/tsan/strerror_r.cpp
    compiler-rt/test/tsan/thread_exit.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/tsan/Linux/dlopen_static_tls.cpp b/compiler-rt/test/tsan/Linux/dlopen_static_tls.cpp
index f97348d54f77..c6612937ce88 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 7f20b8f8add4..03070bfb3265 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 57c9da83a374..adcd11e91eea 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 027ba7bac26a..d1bb279a450f 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 01139519e491..c8cd3f466410 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 06241c7b89f3..d65ecd8bec0b 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 a71d560ab913..8850c12c6d8a 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 b03bde3765e3..507c9294a93b 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 be1c5f26a3b1..ccd996ced449 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 614b27007338..e8bac22647bb 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 892d44400541..b727b92b31ac 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 <pthread.h>
 #include <stdio.h>

diff  --git a/compiler-rt/test/tsan/race_range_pc.cpp b/compiler-rt/test/tsan/race_range_pc.cpp
index a4689bd93ff4..30d89e549fd0 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 3ea897802cc5..6f422231e688 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 <sys/types.h>
 #include <unistd.h>

diff  --git a/compiler-rt/test/tsan/signal_errno.cpp b/compiler-rt/test/tsan/signal_errno.cpp
index 5e6b1cef633e..7e1fd4b0c5a5 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 <signal.h>

diff  --git a/compiler-rt/test/tsan/signal_longjmp.cpp b/compiler-rt/test/tsan/signal_longjmp.cpp
index f9fa4f54f507..7e9ffcacea38 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 <setjmp.h>
 #include <signal.h>

diff  --git a/compiler-rt/test/tsan/signal_sync2.cpp b/compiler-rt/test/tsan/signal_sync2.cpp
index a1c31dcdc1ee..2bc1383d8bd7 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 <errno.h>
 #include <signal.h>

diff  --git a/compiler-rt/test/tsan/strerror_r.cpp b/compiler-rt/test/tsan/strerror_r.cpp
index 438f54914d6c..6adab1ef17b4 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 7038baa4368d..9c97672ff7c8 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"
 


        


More information about the llvm-commits mailing list