From 016785d9316d8c5abc5fdf3cdb86479095bbb677 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Wed, 21 Dec 2022 05:17:56 -0800 Subject: [PATCH] [clang/xray] Convert tests to check 'target=...' Part of the project to eliminate special handling for triples in lit expressions. --- clang/test/Driver/XRay/lit.local.cfg | 4 +--- clang/test/Driver/XRay/xray-instrument-cpu.c | 3 ++- clang/test/Driver/XRay/xray-instrument-os.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/clang/test/Driver/XRay/lit.local.cfg b/clang/test/Driver/XRay/lit.local.cfg index 70f9792..1755d9a 100644 --- a/clang/test/Driver/XRay/lit.local.cfg +++ b/clang/test/Driver/XRay/lit.local.cfg @@ -1,6 +1,4 @@ import platform -target_triple_components = config.target_triple.split('-') -config.available_features.update(target_triple_components) # Only run the tests in platforms where XRay instrumentation is supported. supported_targets = [ @@ -13,7 +11,7 @@ supported_oses = [ 'Linux', 'FreeBSD', 'Darwin' ] -triple_set = set(target_triple_components) +triple_set = set(config.target_triple.split('-')) if len(triple_set.intersection(supported_targets)) == 0: config.unsupported = True diff --git a/clang/test/Driver/XRay/xray-instrument-cpu.c b/clang/test/Driver/XRay/xray-instrument-cpu.c index ee0e098..a8bc2a6 100644 --- a/clang/test/Driver/XRay/xray-instrument-cpu.c +++ b/clang/test/Driver/XRay/xray-instrument-cpu.c @@ -1,4 +1,5 @@ // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s -// XFAIL: amd64-, x86_64-, x86_64h-, arm, aarch64, arm64, powerpc64le-, mips, mipsel, mips64, mips64el +// XFAIL: target={{(amd64|x86_64|x86_64h|powerpc64le)-.*}} +// XFAIL: target={{(arm|aarch64|arm64|mips|mipsel|mips64|mips64el)-.*}} // REQUIRES: linux typedef int a; diff --git a/clang/test/Driver/XRay/xray-instrument-os.c b/clang/test/Driver/XRay/xray-instrument-os.c index 3a03972..7a4f1c1 100644 --- a/clang/test/Driver/XRay/xray-instrument-os.c +++ b/clang/test/Driver/XRay/xray-instrument-os.c @@ -1,4 +1,4 @@ // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s -// XFAIL: -linux-, -freebsd, x86_64-apple-darwin, x86_64-apple-macos -// REQUIRES: amd64 || x86_64 || x86_64h || arm || aarch64 || arm64 +// XFAIL: target={{.*-(linux|freebsd).*}}, target=x86_64-apple-{{(darwin|macos).*}} +// REQUIRES: target={{(amd64|x86_64|x86_64h|arm|aarch64|arm64)-.*}} typedef int a; -- 2.7.4