[compiler-rt] 38e9660 - [asan] Convert more tests to check 'target=...'

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 10:36:57 PST 2022


Author: Paul Robinson
Date: 2022-12-16T10:36:48-08:00
New Revision: 38e9660eaa3478b003cbc48cb4ed0adcf22e053a

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

LOG: [asan] Convert more 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/odr-violation.cpp
    compiler-rt/test/asan/TestCases/Linux/odr-vtable.cpp
    compiler-rt/test/asan/TestCases/Linux/ptrace.cpp
    compiler-rt/test/asan/TestCases/Posix/mmap_limit_mb.cpp
    compiler-rt/test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.cpp
    compiler-rt/test/asan/TestCases/atoll_strict.c
    compiler-rt/test/asan/TestCases/global-location.cpp
    compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
    compiler-rt/test/asan/TestCases/initialization-bug.cpp
    compiler-rt/test/asan/TestCases/intercept-rethrow-exception.cpp
    compiler-rt/test/asan/TestCases/interception_failure_test.cpp
    compiler-rt/test/asan/TestCases/log-path_test.cpp
    compiler-rt/test/asan/TestCases/pass-object-byval.cpp
    compiler-rt/test/asan/TestCases/printf-2.c
    compiler-rt/test/asan/TestCases/printf-3.c
    compiler-rt/test/asan/TestCases/printf-5.c
    compiler-rt/test/asan/TestCases/strcasestr-1.c
    compiler-rt/test/asan/TestCases/strcasestr-2.c
    compiler-rt/test/asan/TestCases/strcasestr_strict.c
    compiler-rt/test/asan/TestCases/strncasecmp_strict.c
    compiler-rt/test/asan/TestCases/strtoll_strict.c
    compiler-rt/test/asan/TestCases/time_interceptor.cpp
    compiler-rt/test/asan/TestCases/verbose-log-path_test.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/Linux/odr-violation.cpp b/compiler-rt/test/asan/TestCases/Linux/odr-violation.cpp
index a86e032ecef6..017aa4e12ce4 100644
--- a/compiler-rt/test/asan/TestCases/Linux/odr-violation.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/odr-violation.cpp
@@ -1,7 +1,7 @@
 // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
 // XFAIL: android
 // Fails with debug checks: https://bugs.llvm.org/show_bug.cgi?id=46862
-// XFAIL: !compiler-rt-optimized && !riscv64
+// XFAIL: !compiler-rt-optimized && !target=riscv64{{.*}}
 //
 // We use fast_unwind_on_malloc=0 to have full unwinding even w/o frame
 // pointers. This setting is not on by default because it's too expensive.

diff  --git a/compiler-rt/test/asan/TestCases/Linux/odr-vtable.cpp b/compiler-rt/test/asan/TestCases/Linux/odr-vtable.cpp
index aabecf29cc81..aee5d2aacfc5 100644
--- a/compiler-rt/test/asan/TestCases/Linux/odr-vtable.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/odr-vtable.cpp
@@ -1,5 +1,5 @@
 // Fails with debug checks: https://bugs.llvm.org/show_bug.cgi?id=46862
-// XFAIL: !compiler-rt-optimized && !riscv64
+// XFAIL: !compiler-rt-optimized && !target=riscv64{{.*}}
 
 // REQUIRES: shared_cxxabi
 

diff  --git a/compiler-rt/test/asan/TestCases/Linux/ptrace.cpp b/compiler-rt/test/asan/TestCases/Linux/ptrace.cpp
index cae1493fd487..e01021ff344c 100644
--- a/compiler-rt/test/asan/TestCases/Linux/ptrace.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/ptrace.cpp
@@ -1,6 +1,6 @@
 // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
 // XFAIL: android
-// XFAIL: mips
+// XFAIL: target=mips{{.*}}
 //
 // RUN: %clangxx_asan -O0 %s -o %t && %run %t
 // RUN: %clangxx_asan -DPOSITIVE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s

diff  --git a/compiler-rt/test/asan/TestCases/Posix/mmap_limit_mb.cpp b/compiler-rt/test/asan/TestCases/Posix/mmap_limit_mb.cpp
index cb613f53577a..87ac5b2925ed 100644
--- a/compiler-rt/test/asan/TestCases/Posix/mmap_limit_mb.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/mmap_limit_mb.cpp
@@ -9,7 +9,7 @@
 // RUN: %env_asan_opts=mmap_limit_mb=300 not %run %t 500 1000000 2>&1 | FileCheck %s
 //
 // FIXME: Windows doesn't implement mmap_limit_mb.
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #include <assert.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.cpp b/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.cpp
index e7f774674e26..ec91b6597fbe 100644
--- a/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.cpp
@@ -2,7 +2,7 @@
 // inside the class.
 // RUN: %clangxx_asan  %s -o %t && %run %t
 //
-// XFAIL: arm
+// XFAIL: target=arm{{.*}}
 
 // UNSUPPORTED: ios
 

diff  --git a/compiler-rt/test/asan/TestCases/atoll_strict.c b/compiler-rt/test/asan/TestCases/atoll_strict.c
index 0cb568969250..f0cf0c648c84 100644
--- a/compiler-rt/test/asan/TestCases/atoll_strict.c
+++ b/compiler-rt/test/asan/TestCases/atoll_strict.c
@@ -11,7 +11,7 @@
 // RUN: %env_asan_opts=strict_string_checks=true not %run %t test3 2>&1 | FileCheck %s --check-prefix=CHECK3
 
 // FIXME: Needs Windows interceptor.
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #include <assert.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/asan/TestCases/global-location.cpp b/compiler-rt/test/asan/TestCases/global-location.cpp
index c5fe34b6332c..b0e996a282cd 100644
--- a/compiler-rt/test/asan/TestCases/global-location.cpp
+++ b/compiler-rt/test/asan/TestCases/global-location.cpp
@@ -5,7 +5,7 @@
 // RUN: not %run %t l 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=LITERAL
 
 // COFF doesn't support debuginfo for globals. For the non-debuginfo tests, see global-location-nodebug.cpp.
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 // atos doesn't show source line numbers for global variables.
 // UNSUPPORTED: darwin

diff  --git a/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp b/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
index 68eab14a916a..f1bd0f07c123 100644
--- a/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
+++ b/compiler-rt/test/asan/TestCases/heavy_uar_test.cpp
@@ -2,7 +2,7 @@
 // RUN: %clangxx_asan -O2 %s -o %t && %env_asan_opts=detect_stack_use_after_return=1 not %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O0 %s -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O2 %s -o %t -fsanitize-address-use-after-return=always && not %run %t 2>&1 | FileCheck %s
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 // FIXME: Fix this test under GCC.
 // REQUIRES: Clang

diff  --git a/compiler-rt/test/asan/TestCases/initialization-bug.cpp b/compiler-rt/test/asan/TestCases/initialization-bug.cpp
index b27da0e5f8c3..2775f6ce356d 100644
--- a/compiler-rt/test/asan/TestCases/initialization-bug.cpp
+++ b/compiler-rt/test/asan/TestCases/initialization-bug.cpp
@@ -6,7 +6,7 @@
 // Do not test with optimization -- the error may be optimized away.
 
 // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=186
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #include <cstdio>
 

diff  --git a/compiler-rt/test/asan/TestCases/intercept-rethrow-exception.cpp b/compiler-rt/test/asan/TestCases/intercept-rethrow-exception.cpp
index a07d7a213b6b..bf51eed41fdd 100644
--- a/compiler-rt/test/asan/TestCases/intercept-rethrow-exception.cpp
+++ b/compiler-rt/test/asan/TestCases/intercept-rethrow-exception.cpp
@@ -8,9 +8,9 @@
 
 // The current implementation of this functionality requires special
 // combination of libraries that are not used by default on NetBSD
-// XFAIL: netbsd
+// XFAIL: target={{.*netbsd.*}}
 // FIXME: Bug 42703
-// XFAIL: solaris
+// XFAIL: target={{.*solaris.*}}
 
 // https://reviews.llvm.org/D111703 made compiler incompatible with released NDK.
 // UNSUPPORTED: android && arm-target-arch

diff  --git a/compiler-rt/test/asan/TestCases/interception_failure_test.cpp b/compiler-rt/test/asan/TestCases/interception_failure_test.cpp
index 4f6698e3a537..7e2413ec2a23 100644
--- a/compiler-rt/test/asan/TestCases/interception_failure_test.cpp
+++ b/compiler-rt/test/asan/TestCases/interception_failure_test.cpp
@@ -5,7 +5,7 @@
 // RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s
-// XFAIL: freebsd
+// XFAIL: target={{.*freebsd.*}}
 
 // On Windows, defining strtoll in a static build results in linker errors, but
 // it works with the dynamic runtime.
@@ -13,7 +13,7 @@
 
 // On NetBSD, defining strtol in a static build results in linker errors, but
 // it works with the dynamic runtime.
-// XFAIL: netbsd && !asan-dynamic-runtime
+// XFAIL: target={{.*netbsd.*}} && !asan-dynamic-runtime
 
 #include <stdlib.h>
 #include <stdio.h>

diff  --git a/compiler-rt/test/asan/TestCases/log-path_test.cpp b/compiler-rt/test/asan/TestCases/log-path_test.cpp
index 4cf041659ef3..3c5ca114cfd7 100644
--- a/compiler-rt/test/asan/TestCases/log-path_test.cpp
+++ b/compiler-rt/test/asan/TestCases/log-path_test.cpp
@@ -35,7 +35,7 @@
 // RUN: not cat %t.log.*
 
 // FIXME: log_path is not supported on Windows yet.
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #include <stdlib.h>
 #include <string.h>

diff  --git a/compiler-rt/test/asan/TestCases/pass-object-byval.cpp b/compiler-rt/test/asan/TestCases/pass-object-byval.cpp
index f9191c53d708..78f4f8d64ea2 100644
--- a/compiler-rt/test/asan/TestCases/pass-object-byval.cpp
+++ b/compiler-rt/test/asan/TestCases/pass-object-byval.cpp
@@ -5,7 +5,7 @@
 // RUN:     Assertion{{.*}}failed
 
 // ASan instrumentation can't insert red-zones around inalloca parameters.
-// XFAIL: windows-msvc && asan-32-bits
+// XFAIL: target={{.*windows-msvc.*}} && asan-32-bits
 
 #include <cassert>
 

diff  --git a/compiler-rt/test/asan/TestCases/printf-2.c b/compiler-rt/test/asan/TestCases/printf-2.c
index 7127347f883b..7fcf43054bb4 100644
--- a/compiler-rt/test/asan/TestCases/printf-2.c
+++ b/compiler-rt/test/asan/TestCases/printf-2.c
@@ -6,7 +6,7 @@
 // RUN: %env_asan_opts=replace_str=0:intercept_strlen=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
 
 // FIXME: printf is not intercepted on Windows yet.
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #include <stdio.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/asan/TestCases/printf-3.c b/compiler-rt/test/asan/TestCases/printf-3.c
index 4f54ff956e3d..805210c660b6 100644
--- a/compiler-rt/test/asan/TestCases/printf-3.c
+++ b/compiler-rt/test/asan/TestCases/printf-3.c
@@ -4,7 +4,7 @@
 // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
 
 // FIXME: printf is not intercepted on Windows yet.
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 // New Bionic rejects %n
 // https://android.googlesource.com/platform/bionic/+/41398d03b7e8e0dfb951660ae713e682e9fc0336

diff  --git a/compiler-rt/test/asan/TestCases/printf-5.c b/compiler-rt/test/asan/TestCases/printf-5.c
index 89d3a333ba1d..564de39f0976 100644
--- a/compiler-rt/test/asan/TestCases/printf-5.c
+++ b/compiler-rt/test/asan/TestCases/printf-5.c
@@ -5,7 +5,7 @@
 // RUN: %env_asan_opts=replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
 
 // FIXME: printf is not intercepted on Windows yet.
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #include <stdio.h>
 #include <string.h>

diff  --git a/compiler-rt/test/asan/TestCases/strcasestr-1.c b/compiler-rt/test/asan/TestCases/strcasestr-1.c
index bb0863de77d2..8be4b75070f0 100644
--- a/compiler-rt/test/asan/TestCases/strcasestr-1.c
+++ b/compiler-rt/test/asan/TestCases/strcasestr-1.c
@@ -6,7 +6,7 @@
 // RUN: %env_asan_opts=intercept_strstr=false:replace_str=false %run %t 2>&1
 
 // There's no interceptor for strcasestr on Windows
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #define _GNU_SOURCE
 #include <assert.h>

diff  --git a/compiler-rt/test/asan/TestCases/strcasestr-2.c b/compiler-rt/test/asan/TestCases/strcasestr-2.c
index 35d05c277eae..eabe4020f090 100644
--- a/compiler-rt/test/asan/TestCases/strcasestr-2.c
+++ b/compiler-rt/test/asan/TestCases/strcasestr-2.c
@@ -6,7 +6,7 @@
 // RUN: %env_asan_opts=intercept_strstr=false:replace_str=false:intercept_strlen=false %run %t 2>&1
 
 // There's no interceptor for strcasestr on Windows
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #define _GNU_SOURCE
 #include <assert.h>

diff  --git a/compiler-rt/test/asan/TestCases/strcasestr_strict.c b/compiler-rt/test/asan/TestCases/strcasestr_strict.c
index 16adae184b53..a6d1087410f8 100644
--- a/compiler-rt/test/asan/TestCases/strcasestr_strict.c
+++ b/compiler-rt/test/asan/TestCases/strcasestr_strict.c
@@ -4,7 +4,7 @@
 // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
 
 // There's no interceptor for strcasestr on Windows
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #define _GNU_SOURCE
 #include <assert.h>

diff  --git a/compiler-rt/test/asan/TestCases/strncasecmp_strict.c b/compiler-rt/test/asan/TestCases/strncasecmp_strict.c
index 8a99783ecba9..24261beaaaca 100644
--- a/compiler-rt/test/asan/TestCases/strncasecmp_strict.c
+++ b/compiler-rt/test/asan/TestCases/strncasecmp_strict.c
@@ -14,7 +14,7 @@
 // RUN: %env_asan_opts=strict_string_checks=false %run %t i 2>&1
 // RUN: %env_asan_opts=strict_string_checks=true not %run %t i 2>&1 | FileCheck %s
 
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #include <assert.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/asan/TestCases/strtoll_strict.c b/compiler-rt/test/asan/TestCases/strtoll_strict.c
index 3fa800ca4136..88e6651b6ed1 100644
--- a/compiler-rt/test/asan/TestCases/strtoll_strict.c
+++ b/compiler-rt/test/asan/TestCases/strtoll_strict.c
@@ -24,7 +24,7 @@
 
 // FIXME: Enable strtoll interceptor.
 // REQUIRES: shadow-scale-3
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #include <assert.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/asan/TestCases/time_interceptor.cpp b/compiler-rt/test/asan/TestCases/time_interceptor.cpp
index 91e056bfc5e1..47acdd520b56 100644
--- a/compiler-rt/test/asan/TestCases/time_interceptor.cpp
+++ b/compiler-rt/test/asan/TestCases/time_interceptor.cpp
@@ -3,7 +3,7 @@
 // Test the time() interceptor.
 
 // There's no interceptor for time() on Windows yet.
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
 
 #include <stdio.h>
 #include <stdlib.h>

diff  --git a/compiler-rt/test/asan/TestCases/verbose-log-path_test.cpp b/compiler-rt/test/asan/TestCases/verbose-log-path_test.cpp
index 5407d15d6f6e..37c1dab6db8e 100644
--- a/compiler-rt/test/asan/TestCases/verbose-log-path_test.cpp
+++ b/compiler-rt/test/asan/TestCases/verbose-log-path_test.cpp
@@ -10,7 +10,7 @@
 // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t-dir/asan.log.verbose-log-path_test-binary.*
 
 // FIXME: only FreeBSD, NetBSD and Linux have verbose log paths now.
-// XFAIL: windows-msvc,android
+// XFAIL: target={{.*windows-msvc.*}},android
 // UNSUPPORTED: ios
 
 #include <stdlib.h>


        


More information about the llvm-commits mailing list