// 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.
// 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
// 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
// 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>
// inside the class.
// RUN: %clangxx_asan %s -o %t && %run %t
//
-// XFAIL: arm
+// XFAIL: target=arm{{.*}}
// UNSUPPORTED: ios
// 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>
// 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
// 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
// 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>
// 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
// 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.
// 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>
// 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>
// 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>
// 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>
// 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
// 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>
// 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>
// 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>
// 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>
// 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>
// FIXME: Enable strtoll interceptor.
// REQUIRES: shadow-scale-3
-// XFAIL: windows-msvc
+// XFAIL: target={{.*windows-msvc.*}}
#include <assert.h>
#include <stdlib.h>
// 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>
// 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>