[compiler-rt] e6e4362 - [ubsan] Convert tests to check 'target=...'

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 12:04:17 PST 2022


Author: Paul Robinson
Date: 2022-12-19T12:04:08-08:00
New Revision: e6e4362901ae95b455366f907fb1145938808208

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

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

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

Added: 
    

Modified: 
    compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp
    compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp
    compiler-rt/test/ubsan/TestCases/Misc/Linux/diag-stacktrace.cpp
    compiler-rt/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp
    compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp
    compiler-rt/test/ubsan/TestCases/Misc/enum.cpp
    compiler-rt/test/ubsan/TestCases/Misc/log-path_test.cpp
    compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp
    compiler-rt/test/ubsan/TestCases/Misc/monitor.cpp
    compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp
    compiler-rt/test/ubsan/TestCases/TypeCheck/PR33221.cpp
    compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
    compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-corrupted-vtable-itanium.cpp
    compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp
    compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base-construction.cpp
    compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp
    compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp b/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp
index 2d291b2004322..fdb3a0c13e000 100644
--- a/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp
@@ -12,7 +12,7 @@
 // RUN: not %run %t 9 2>&1 | FileCheck %s --check-prefix=CHECK-9
 
 // Issue #41838
-// XFAIL: sparc-target-arch && solaris
+// XFAIL: target={{sparc.*solaris.*}}
 
 // This test assumes float and double are IEEE-754 single- and double-precision.
 

diff  --git a/compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp b/compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp
index c6f8f4158401e..3d65caf949c66 100644
--- a/compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp
@@ -5,7 +5,7 @@
 // REQUIRES: can-symbolize
 // UNSUPPORTED: android
 // Output 
diff ers on OpenBSD longer by displaying the values.
-// XFAIL: openbsd
+// XFAIL: target={{.*openbsd.*}}
 
 // Fails without any suppression.
 // RUN: %env_ubsan_opts=halt_on_error=1 not %run %t 2>&1 | FileCheck %s

diff  --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/diag-stacktrace.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Linux/diag-stacktrace.cpp
index 8ccc080200119..9a3824c46ed7f 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/Linux/diag-stacktrace.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/Linux/diag-stacktrace.cpp
@@ -1,5 +1,5 @@
 /// Fast unwinder does not work with Thumb code
-// UNSUPPORTED: thumb
+// UNSUPPORTED: target={{.*thumb.*}}
 // UNSUPPORTED: android
 
 // RUN: %clangxx -fsanitize=return %gmlt -O2 -fno-omit-frame-pointer -fasynchronous-unwind-tables %s -o %t

diff  --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp
index e5c9fae5858ba..93c6bd66e127c 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cpp
@@ -2,7 +2,7 @@
 // RUN: %clangxx -fsanitize=undefined -O0 %s -o %t && UBSAN_OPTIONS=stack_trace_format=DEFAULT:fast_unwind_on_fatal=0 %run %t 2>&1 | FileCheck %s
 
 // This test is temporarily disabled due to broken unwinding on ARM.
-// UNSUPPORTED: -linux-
+// UNSUPPORTED: target={{.*-linux-.*}}
 
 // The test doesn't pass on Darwin in UBSan-TSan configuration, because TSan is
 // using the slow unwinder which is not supported on Darwin. The test should

diff  --git a/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp b/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp
index 4a94350ec1620..c53a725a986ec 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp
@@ -24,7 +24,7 @@
 // XFAIL: ubsan-tsan
 // UNSUPPORTED: ubsan-standalone-static
 // No coverage support
-// UNSUPPORTED: openbsd
+// UNSUPPORTED: target={{.*openbsd.*}}
 
 volatile int sink;
 int main(int argc, char **argv) {

diff  --git a/compiler-rt/test/ubsan/TestCases/Misc/enum.cpp b/compiler-rt/test/ubsan/TestCases/Misc/enum.cpp
index 569fb638526da..2684029c2960b 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/enum.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/enum.cpp
@@ -2,7 +2,7 @@
 
 // FIXME: UBSan fails to add the correct instrumentation code for some reason on
 // Windows.
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 enum E { a = 1 };
 enum class EClass { a = 1 };

diff  --git a/compiler-rt/test/ubsan/TestCases/Misc/log-path_test.cpp b/compiler-rt/test/ubsan/TestCases/Misc/log-path_test.cpp
index 1bcbd8439f67e..be5766d24e7d1 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/log-path_test.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/log-path_test.cpp
@@ -23,10 +23,10 @@
 // RUN: not cat %t.log.*
 
 // FIXME: log_path is not supported on Windows yet.
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 // Issue #41838
-// XFAIL: sparc-target-arch && solaris
+// XFAIL: target={{sparc.*solaris.*}}
 
 #include <stdio.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp b/compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp
index e8146d6c44b01..2ea76daf1fc16 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/missing_return.cpp
@@ -2,7 +2,7 @@
 // RUN: not %run %t 2>&1 | FileCheck %s
 // RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-STACKTRACE
 // Error message does not exact what expected
-// XFAIL: openbsd
+// XFAIL: target={{.*openbsd.*}}
 
 // CHECK: missing_return.cpp:[[@LINE+1]]:5: runtime error: execution reached the end of a value-returning function without returning a value
 int f() __attribute__((noinline)) {

diff  --git a/compiler-rt/test/ubsan/TestCases/Misc/monitor.cpp b/compiler-rt/test/ubsan/TestCases/Misc/monitor.cpp
index ca884cbc652e5..0a705cc4c1c6b 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/monitor.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/monitor.cpp
@@ -4,9 +4,9 @@
 // __ubsan_on_report is not defined as weak. Redefining it here isn't supported
 // on Windows.
 //
-// UNSUPPORTED: windows-msvc
+// UNSUPPORTED: target={{.*windows-msvc.*}}
 // Linkage issue
-// XFAIL: openbsd
+// XFAIL: target={{.*openbsd.*}}
 
 #include <cstdio>
 

diff  --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp
index 07402fdcd7085..06eb796a46bb6 100644
--- a/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp
+++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/Function/function.cpp
@@ -4,9 +4,9 @@
 // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK $(%run %t-unique UNIQUE)
 // Verify that we can disable symbolization if needed:
 // RUN: %env_ubsan_opts=symbolize=0 %run %t 2>&1 | FileCheck %s --check-prefix=NOSYM $(%run %t-unique NOSYM-UNIQUE)
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 // Unsupported function flag
-// UNSUPPORTED: openbsd
+// UNSUPPORTED: target={{.*openbsd.*}}
 
 #ifdef DETERMINE_UNIQUE
 

diff  --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/PR33221.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/PR33221.cpp
index 6088338a3dee4..5237d19c85eba 100644
--- a/compiler-rt/test/ubsan/TestCases/TypeCheck/PR33221.cpp
+++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/PR33221.cpp
@@ -2,7 +2,7 @@
 // RUN: %run %t 2>&1 | FileCheck %s
 
 // REQUIRES: cxxabi
-// UNSUPPORTED: windows-msvc
+// UNSUPPORTED: target={{.*windows-msvc.*}}
 
 #include <string.h>
 

diff  --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
index eff3ce6c27e9e..3cb8cb80feb06 100644
--- a/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
+++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
@@ -12,7 +12,7 @@
 // RUN: not %run %t s1 2>&1 | FileCheck %s --check-prefix=CHECK-STORE
 // RUN: not %run %t w1 2>&1 | FileCheck %s --check-prefix=CHECK-WILD
 // Compilation error make the test fails.
-// XFAIL: openbsd
+// XFAIL: target={{.*openbsd.*}}
 
 #include <new>
 

diff  --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-corrupted-vtable-itanium.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-corrupted-vtable-itanium.cpp
index ef8f22e311e5a..9c47b69dbb6aa 100644
--- a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-corrupted-vtable-itanium.cpp
+++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-corrupted-vtable-itanium.cpp
@@ -1,7 +1,7 @@
 // RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -g %s -O3 -o %t
 // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-CORRUPTED-VTABLE --strict-whitespace
 
-// UNSUPPORTED: windows-msvc
+// UNSUPPORTED: target={{.*windows-msvc.*}}
 // REQUIRES: stable-runtime, cxxabi
 
 #include <typeinfo>

diff  --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp
index f24d074a58016..6686415a222cf 100644
--- a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp
+++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-non-unique-typeinfo.cpp
@@ -3,7 +3,7 @@
 // RUN: %run %t
 //
 // REQUIRES: cxxabi
-// UNSUPPORTED: windows-msvc
+// UNSUPPORTED: target={{.*windows-msvc.*}}
 
 struct X {
   virtual ~X() {}

diff  --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base-construction.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base-construction.cpp
index 75a5d7670fb99..37055ba1f70eb 100644
--- a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base-construction.cpp
+++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base-construction.cpp
@@ -2,7 +2,7 @@
 // RUN: %run %t
 
 // REQUIRES: cxxabi
-// UNSUPPORTED: windows-msvc
+// UNSUPPORTED: target={{.*windows-msvc.*}}
 
 int volatile n;
 

diff  --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp
index fa0c6a73881b6..80a96cb042ae2 100644
--- a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp
+++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp
@@ -3,9 +3,9 @@
 
 // REQUIRES: shared_cxxabi
 // REQUIRES: cxxabi
-// UNSUPPORTED: windows-msvc
+// UNSUPPORTED: target={{.*windows-msvc.*}}
 // Nested crash reported
-// UNSUPPORTED: freebsd
+// UNSUPPORTED: target={{.*freebsd.*}}
 
 struct S { virtual int f() { return 0; } };
 struct T : virtual S {};

diff  --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp
index 9e3514faa30bf..70c93440a0e04 100644
--- a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp
+++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp
@@ -37,13 +37,13 @@
 // RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.loc-supp"' not %run %t x- 2>&1 | FileCheck %s --check-prefix=CHECK-LOC-SUPPRESS
 
 // REQUIRES: stable-runtime, cxxabi
-// UNSUPPORTED: windows-msvc
+// UNSUPPORTED: target={{.*windows-msvc.*}}
 // Suppressions file not pushed to the device.
 // UNSUPPORTED: android
 // Compilation error
-// UNSUPPORTED: openbsd
+// UNSUPPORTED: target={{.*openbsd.*}}
 // Compilation error
-// UNSUPPORTED: freebsd
+// UNSUPPORTED: target={{.*freebsd.*}}
 #include <new>
 #include <typeinfo>
 #include <assert.h>


        


More information about the llvm-commits mailing list