From patchwork Sun Jan 22 21:55:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 63572 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B29963858281 for ; Sun, 22 Jan 2023 21:57:29 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from qproxy6-pub.mail.unifiedlayer.com (qproxy6-pub.mail.unifiedlayer.com [69.89.23.12]) by sourceware.org (Postfix) with ESMTPS id 2ECFC3858020 for ; Sun, 22 Jan 2023 21:57:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2ECFC3858020 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from outbound-ss-761.bluehost.com (outbound-ss-761.bluehost.com [74.220.211.250]) by qproxy6.mail.unifiedlayer.com (Postfix) with ESMTP id 840AB8028CA7 for ; Sun, 22 Jan 2023 21:57:11 +0000 (UTC) Received: from cmgw10.mail.unifiedlayer.com (unknown [10.0.90.125]) by progateway8.mail.pro1.eigbox.com (Postfix) with ESMTP id 78D4610043B48 for ; Sun, 22 Jan 2023 21:56:11 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id JiJvpUmBLnkPJJiJvpUdmE; Sun, 22 Jan 2023 21:56:11 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=f86NuM+M c=1 sm=1 tr=0 ts=63cdb0fb a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=RvmDmJFTN0MA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=mDV3o1hIAAAA:8 a=TkTTPzHaAAAA:8 a=aUB2nrkN8bXoTEF5V4gA:9 a=_FVE-zBwftR9WsbkzFJk:22 a=Qz3p68GZ3z-NqTySStDO:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Y3sTSGPwGlJWKbi4pCBJYINOiYgbLsHr/pwIsYcPX+A=; b=QrcCXxf440l1ORlIBLPfY5Izc6 Qi5xOMVxkHWE9q2ezAmmocvKmCOCzs3XP1fZzKaFHM5X/ciyvXlwDF3V3b4kBVfUaBk3z6cWtd8Ju AgV7RrZXsh1iVehJupnRFDTtU; Received: from 97-122-76-186.hlrn.qwest.net ([97.122.76.186]:55760 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pJiJv-003faM-7b; Sun, 22 Jan 2023 14:56:11 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 6/8] Introduce and use is_any_target Date: Sun, 22 Jan 2023 14:55:56 -0700 Message-Id: <20230122215558.1931803-7-tom@tromey.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230122215558.1931803-1-tom@tromey.com> References: <20230122215558.1931803-1-tom@tromey.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.76.186 X-Source-L: No X-Exim-ID: 1pJiJv-003faM-7b X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-76-186.hlrn.qwest.net (localhost.localdomain) [97.122.76.186]:55760 X-Source-Auth: tom+tromey.com X-Email-Count: 10 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3027.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" A few tests work on two different targets that can't be detected with a single call to istarget -- that proc only accepts globs, not regular expressions. This patch introduces a new is_any_target proc and then converts these tests to use it in a 'require'. --- gdb/testsuite/gdb.arch/amd64-i386-address.exp | 7 ++----- gdb/testsuite/gdb.arch/arm-neon.exp | 5 +---- gdb/testsuite/gdb.arch/i386-avx.exp | 5 +---- gdb/testsuite/gdb.arch/i386-avx512.exp | 5 +---- gdb/testsuite/gdb.arch/i386-biarch-core.exp | 5 +---- gdb/testsuite/gdb.arch/i386-bp_permanent.exp | 5 +---- gdb/testsuite/gdb.arch/i386-byte.exp | 5 +---- gdb/testsuite/gdb.arch/i386-dr3-watch.exp | 4 +--- gdb/testsuite/gdb.arch/i386-float.exp | 5 +---- gdb/testsuite/gdb.arch/i386-mpx-call.exp | 5 +---- gdb/testsuite/gdb.arch/i386-mpx-map.exp | 5 +---- gdb/testsuite/gdb.arch/i386-mpx-sigsegv.exp | 5 +---- gdb/testsuite/gdb.arch/i386-mpx-simple_segv.exp | 5 +---- gdb/testsuite/gdb.arch/i386-mpx.exp | 10 ++-------- gdb/testsuite/gdb.arch/i386-permbkpt.exp | 5 +---- gdb/testsuite/gdb.arch/i386-pkru.exp | 5 +---- .../gdb.arch/i386-prologue-skip-cf-protection.exp | 5 +---- gdb/testsuite/gdb.arch/i386-signal.exp | 5 +---- gdb/testsuite/gdb.arch/i386-sse.exp | 5 +---- gdb/testsuite/gdb.arch/i386-word.exp | 5 +---- gdb/testsuite/gdb.arch/powerpc-prologue.exp | 2 +- gdb/testsuite/gdb.arch/powerpc64-prologue.exp | 2 +- gdb/testsuite/gdb.arch/s390-tdbregs.exp | 6 +----- gdb/testsuite/gdb.arch/s390-vregs.exp | 5 +---- gdb/testsuite/gdb.base/auxv.exp | 6 +----- gdb/testsuite/gdb.base/catch-fork-static.exp | 4 +--- gdb/testsuite/gdb.base/jit-reader.exp | 4 +--- gdb/testsuite/gdb.base/overlays.exp | 2 +- gdb/testsuite/gdb.server/extended-remote-restart.exp | 4 +--- gdb/testsuite/gdb.trace/stap-trace.exp | 4 +--- gdb/testsuite/lib/gdb.exp | 10 ++++++++++ 31 files changed, 42 insertions(+), 113 deletions(-) diff --git a/gdb/testsuite/gdb.arch/amd64-i386-address.exp b/gdb/testsuite/gdb.arch/amd64-i386-address.exp index 7f7863a1d57..8224d8d8218 100644 --- a/gdb/testsuite/gdb.arch/amd64-i386-address.exp +++ b/gdb/testsuite/gdb.arch/amd64-i386-address.exp @@ -18,11 +18,8 @@ # Test UNsigned extension of the 32-bit inferior address on a 64-bit host. # On native 32-bit host the test always PASSed. -if { (![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]) || ![is_lp64_target] - || [istarget "*-*-openbsd*"] } then { - verbose "Skipping amd64->i386 address test." - return -} +require {is_any_target "x86_64-*-*" "i?86-*-*"} is_lp64_target +require {!istarget "*-*-openbsd*"} if [prepare_for_testing "failed to prepare" amd64-i386-address amd64-i386-address.S [list debug "additional_flags=-m32 -nostdlib"]] { return -1 diff --git a/gdb/testsuite/gdb.arch/arm-neon.exp b/gdb/testsuite/gdb.arch/arm-neon.exp index 54720e891e3..a34dbc3b051 100644 --- a/gdb/testsuite/gdb.arch/arm-neon.exp +++ b/gdb/testsuite/gdb.arch/arm-neon.exp @@ -15,10 +15,7 @@ # This file is part of the gdb testsuite. -if {![istarget "aarch64*-*-*"] && ![istarget "arm*-*-*"]} { - verbose "Skipping ${gdb_test_file_name}." - return -} +require {is_any_target "aarch64*-*-*" "arm*-*-*"} require allow_float_test diff --git a/gdb/testsuite/gdb.arch/i386-avx.exp b/gdb/testsuite/gdb.arch/i386-avx.exp index 72523c5d47b..ad2cb5852d1 100644 --- a/gdb/testsuite/gdb.arch/i386-avx.exp +++ b/gdb/testsuite/gdb.arch/i386-avx.exp @@ -19,10 +19,7 @@ # This file is part of the gdb testsuite. -if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { - verbose "Skipping x86 AVX tests." - return -} +require {is_any_target i?86-*-* x86_64-*-*} require have_avx diff --git a/gdb/testsuite/gdb.arch/i386-avx512.exp b/gdb/testsuite/gdb.arch/i386-avx512.exp index b62cb9cf6bb..0c50591dcbe 100644 --- a/gdb/testsuite/gdb.arch/i386-avx512.exp +++ b/gdb/testsuite/gdb.arch/i386-avx512.exp @@ -19,10 +19,7 @@ # This file is part of the gdb testsuite. -if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { - verbose "Skipping x86 AVX512 tests." - return -} +require {is_any_target i?86-*-* x86_64-*-*} standard_testfile diff --git a/gdb/testsuite/gdb.arch/i386-biarch-core.exp b/gdb/testsuite/gdb.arch/i386-biarch-core.exp index a36153cfe27..f70b0922212 100644 --- a/gdb/testsuite/gdb.arch/i386-biarch-core.exp +++ b/gdb/testsuite/gdb.arch/i386-biarch-core.exp @@ -21,10 +21,7 @@ # #define EM_X86_64 62 /* AMD x86-64 architecture */ # patch @0x12: 0x3E -> 0x03 -if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} { - verbose "Skipping i386 biarch core test." - return -} +require {is_any_target "i?86-*-*" "x86_64-*-*"} standard_testfile diff --git a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp index 9f8b8e63409..d75ea648148 100644 --- a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp +++ b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp @@ -18,10 +18,7 @@ # Test stepping over permanent breakpoints on i386. -if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} { - verbose "Skipping skip over permanent breakpoint on i386 tests." - return -} +require {is_any_target "i?86-*-*" "x86_64-*-*"} standard_testfile diff --git a/gdb/testsuite/gdb.arch/i386-byte.exp b/gdb/testsuite/gdb.arch/i386-byte.exp index 02a2380cd3f..07f292c3313 100644 --- a/gdb/testsuite/gdb.arch/i386-byte.exp +++ b/gdb/testsuite/gdb.arch/i386-byte.exp @@ -19,10 +19,7 @@ # This file is part of the gdb testsuite. -if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"])} { - verbose "Skipping i386 byte register tests." - return -} +require {is_any_target "x86_64-*-*" "i?86-*-*"} standard_testfile i386-pseudo.c diff --git a/gdb/testsuite/gdb.arch/i386-dr3-watch.exp b/gdb/testsuite/gdb.arch/i386-dr3-watch.exp index 2356c3c3e78..b5c43f2db35 100644 --- a/gdb/testsuite/gdb.arch/i386-dr3-watch.exp +++ b/gdb/testsuite/gdb.arch/i386-dr3-watch.exp @@ -19,9 +19,7 @@ # This test relies on being able to set 4 hardware watchpoints. Since # that is not a valid assumption across most targets, and we're # testing a x86 specific bug, skip everywhere else. -if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} { - return 0 -} +require {is_any_target "i?86-*-*" "x86_64-*-*"} standard_testfile diff --git a/gdb/testsuite/gdb.arch/i386-float.exp b/gdb/testsuite/gdb.arch/i386-float.exp index dd613444fdc..3ae6f849f34 100644 --- a/gdb/testsuite/gdb.arch/i386-float.exp +++ b/gdb/testsuite/gdb.arch/i386-float.exp @@ -18,10 +18,7 @@ # Test the x87 floating point information printout. -if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} { - verbose "Skipping i386 tests for x87 floating point support." - return -} +require {is_any_target "i?86-*-*" "x86_64-*-*"} standard_testfile .S diff --git a/gdb/testsuite/gdb.arch/i386-mpx-call.exp b/gdb/testsuite/gdb.arch/i386-mpx-call.exp index 8371546a8f9..95b68cd30df 100644 --- a/gdb/testsuite/gdb.arch/i386-mpx-call.exp +++ b/gdb/testsuite/gdb.arch/i386-mpx-call.exp @@ -14,10 +14,7 @@ # along with this program. If not, see . -if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { - untested "skipping x86 MPX tests." - return -} +require {is_any_target "i?86-*-*" "x86_64-*-*"} standard_testfile diff --git a/gdb/testsuite/gdb.arch/i386-mpx-map.exp b/gdb/testsuite/gdb.arch/i386-mpx-map.exp index d95adef7d8b..6d95fd89171 100644 --- a/gdb/testsuite/gdb.arch/i386-mpx-map.exp +++ b/gdb/testsuite/gdb.arch/i386-mpx-map.exp @@ -16,10 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { - verbose "Skipping x86 MPX tests." - return -} +require {is_any_target i?86-*-* x86_64-*-*} standard_testfile diff --git a/gdb/testsuite/gdb.arch/i386-mpx-sigsegv.exp b/gdb/testsuite/gdb.arch/i386-mpx-sigsegv.exp index eaac31edbd3..84c04763257 100644 --- a/gdb/testsuite/gdb.arch/i386-mpx-sigsegv.exp +++ b/gdb/testsuite/gdb.arch/i386-mpx-sigsegv.exp @@ -16,10 +16,7 @@ # along with this program. If not, see . -if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { - verbose "Skipping x86 MPX tests." - return -} +require {is_any_target "i?86-*-*" "x86_64-*-*"} standard_testfile diff --git a/gdb/testsuite/gdb.arch/i386-mpx-simple_segv.exp b/gdb/testsuite/gdb.arch/i386-mpx-simple_segv.exp index a33c4f526f7..5f9568357b4 100644 --- a/gdb/testsuite/gdb.arch/i386-mpx-simple_segv.exp +++ b/gdb/testsuite/gdb.arch/i386-mpx-simple_segv.exp @@ -22,10 +22,7 @@ # # Caveat: Setting the handle to nopass, ends up in a endless loop. -if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { - verbose "Skipping x86 MPX tests." - return -} +require {is_any_target i?86-*-* x86_64-*-*} standard_testfile diff --git a/gdb/testsuite/gdb.arch/i386-mpx.exp b/gdb/testsuite/gdb.arch/i386-mpx.exp index 5534ec9aa81..156c3ae7831 100644 --- a/gdb/testsuite/gdb.arch/i386-mpx.exp +++ b/gdb/testsuite/gdb.arch/i386-mpx.exp @@ -15,17 +15,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { - verbose "Skipping x86 MPX tests." - return -} +require {is_any_target i?86-*-* x86_64-*-*} standard_testfile -if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { - verbose "Skipping x86 MPX tests." - return -} +require {is_any_target i?86-*-* x86_64-*-*} require supports_mpx_check_pointer_bounds have_mpx diff --git a/gdb/testsuite/gdb.arch/i386-permbkpt.exp b/gdb/testsuite/gdb.arch/i386-permbkpt.exp index f2a39666903..42171093ba7 100644 --- a/gdb/testsuite/gdb.arch/i386-permbkpt.exp +++ b/gdb/testsuite/gdb.arch/i386-permbkpt.exp @@ -18,10 +18,7 @@ # Test inserting breakpoints over permanent breakpoints on i386 and amd64. -if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} { - verbose "Skipping i386 test for multi break at permanent breakpoint location." - return -} +require {is_any_target "i?86-*-*" "x86_64-*-*"} standard_testfile .S diff --git a/gdb/testsuite/gdb.arch/i386-pkru.exp b/gdb/testsuite/gdb.arch/i386-pkru.exp index 5d2b1a24a15..90d8c1d9d4c 100644 --- a/gdb/testsuite/gdb.arch/i386-pkru.exp +++ b/gdb/testsuite/gdb.arch/i386-pkru.exp @@ -15,10 +15,7 @@ standard_testfile -if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { - unsupported "skipping x86 PKEYS tests." - return -} +require {is_any_target i?86-*-* x86_64-*-*} set default_pkru_re 0x0 if { [istarget *-*-linux*] } { diff --git a/gdb/testsuite/gdb.arch/i386-prologue-skip-cf-protection.exp b/gdb/testsuite/gdb.arch/i386-prologue-skip-cf-protection.exp index 06cb2b1b818..256f6fde9e5 100644 --- a/gdb/testsuite/gdb.arch/i386-prologue-skip-cf-protection.exp +++ b/gdb/testsuite/gdb.arch/i386-prologue-skip-cf-protection.exp @@ -22,10 +22,7 @@ standard_testfile .c set binfile ${binfile} -if { ![istarget x86_64-*-*] && ![istarget i?86-*-*] } { - verbose "Skipping ${testfile}." - return -} +require {is_any_target x86_64-*-* i?86-*-*} require supports_fcf_protection diff --git a/gdb/testsuite/gdb.arch/i386-signal.exp b/gdb/testsuite/gdb.arch/i386-signal.exp index 9806970b245..17c6467076c 100644 --- a/gdb/testsuite/gdb.arch/i386-signal.exp +++ b/gdb/testsuite/gdb.arch/i386-signal.exp @@ -15,10 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} { - verbose "Skipping i386 unwinder tests." - return -} +require {is_any_target "i?86-*-*" "x86_64-*-*"} standard_testfile diff --git a/gdb/testsuite/gdb.arch/i386-sse.exp b/gdb/testsuite/gdb.arch/i386-sse.exp index a178247e066..6df98ec1219 100644 --- a/gdb/testsuite/gdb.arch/i386-sse.exp +++ b/gdb/testsuite/gdb.arch/i386-sse.exp @@ -19,10 +19,7 @@ # This file is part of the gdb testsuite. -if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { - verbose "Skipping x86 SSE tests." - return -} +require {is_any_target i?86-*-* x86_64-*-*} standard_testfile .c diff --git a/gdb/testsuite/gdb.arch/i386-word.exp b/gdb/testsuite/gdb.arch/i386-word.exp index 4e1e634bb12..42d4446c4d0 100644 --- a/gdb/testsuite/gdb.arch/i386-word.exp +++ b/gdb/testsuite/gdb.arch/i386-word.exp @@ -19,10 +19,7 @@ # This file is part of the gdb testsuite. -if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"])} { - verbose "Skipping i386 word register tests." - return -} +require {is_any_target "x86_64-*-*" "i?86-*-*"} standard_testfile i386-pseudo.c diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-prologue.exp index 6ec113cb844..edc7116754a 100644 --- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp +++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp @@ -17,7 +17,7 @@ # Do not run on AIX (where we won't be able to build the tests without # some surgery) or on PowerPC64 (ditto, dot symbols). -require !{istarget *-*-aix*} {istarget "powerpc-*-*"} +require {!istarget *-*-aix*} {istarget "powerpc-*-*"} set testfile "powerpc-prologue" set srcfile ${testfile}.c diff --git a/gdb/testsuite/gdb.arch/powerpc64-prologue.exp b/gdb/testsuite/gdb.arch/powerpc64-prologue.exp index b5336e460e2..3034ac168bb 100644 --- a/gdb/testsuite/gdb.arch/powerpc64-prologue.exp +++ b/gdb/testsuite/gdb.arch/powerpc64-prologue.exp @@ -17,7 +17,7 @@ # Do not run on AIX (where we won't be able to build the tests without # some surgery) or on PowerPC64 (ditto, dot symbols). -require !{istarget *-*-aix*} {istarget "powerpc*-*-*"} +require {!istarget *-*-aix*} {istarget "powerpc*-*-*"} standard_testfile .c diff --git a/gdb/testsuite/gdb.arch/s390-tdbregs.exp b/gdb/testsuite/gdb.arch/s390-tdbregs.exp index 4908fff5619..7d1ea0bdedd 100644 --- a/gdb/testsuite/gdb.arch/s390-tdbregs.exp +++ b/gdb/testsuite/gdb.arch/s390-tdbregs.exp @@ -18,11 +18,7 @@ # This file is part of the gdb testsuite. - -if { ![istarget s390-*-*] && ![istarget s390x-*-* ] } { - verbose "Skipping s390 TDB register tests." - return -} +require {is_any_target s390-*-* s390x-*-*} standard_testfile .c diff --git a/gdb/testsuite/gdb.arch/s390-vregs.exp b/gdb/testsuite/gdb.arch/s390-vregs.exp index b1f8eed6701..21f468f8472 100644 --- a/gdb/testsuite/gdb.arch/s390-vregs.exp +++ b/gdb/testsuite/gdb.arch/s390-vregs.exp @@ -15,10 +15,7 @@ # Test vector register access for s390 platforms. -if { ![istarget s390-*-*] && ![istarget s390x-*-* ] } { - verbose "Skipping s390 vector register tests." - return -} +require {is_any_target s390-*-* s390x-*-*} standard_testfile .S diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp index 3529d55261d..89242b6f432 100644 --- a/gdb/testsuite/gdb.base/auxv.exp +++ b/gdb/testsuite/gdb.base/auxv.exp @@ -18,11 +18,7 @@ # This file is based on corefile.exp which was written by Fred # Fish. (fnf@cygnus.com) -if { ! [istarget "*-*-linux*"] && ! [istarget "*-*-solaris*"] } { - verbose "Skipping auxv.exp because of lack of support." - return -} - +require {is_any_target "*-*-linux*" "*-*-solaris*"} standard_testfile .c diff --git a/gdb/testsuite/gdb.base/catch-fork-static.exp b/gdb/testsuite/gdb.base/catch-fork-static.exp index a59c6808f85..2844843638f 100644 --- a/gdb/testsuite/gdb.base/catch-fork-static.exp +++ b/gdb/testsuite/gdb.base/catch-fork-static.exp @@ -23,9 +23,7 @@ # Until "catch fork" is implemented on other targets... # -if {![istarget "*-*-linux*"] && ![istarget "*-*-openbsd*"]} { - return -} +require {is_any_target "*-*-linux*" "*-*-openbsd*"} # Reusing foll-fork.c since it's a simple forking program. standard_testfile foll-fork.c diff --git a/gdb/testsuite/gdb.base/jit-reader.exp b/gdb/testsuite/gdb.base/jit-reader.exp index 399cb67dcce..d603ad975ff 100644 --- a/gdb/testsuite/gdb.base/jit-reader.exp +++ b/gdb/testsuite/gdb.base/jit-reader.exp @@ -18,9 +18,7 @@ load_lib gdb-python.exp standard_testfile jit-reader-host.c -if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) || ![is_lp64_target] } { - return -1; -} +require {is_any_target "i?86-*-*" "x86_64-*-*"} is_lp64_target require allow_shlib_tests isnative diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp index 1e626a895f9..3278c530913 100644 --- a/gdb/testsuite/gdb.base/overlays.exp +++ b/gdb/testsuite/gdb.base/overlays.exp @@ -22,7 +22,7 @@ set data_overlays 1 -require {istarget "m32r-*-*"} !{istarget "*-*-linux*"} +require {istarget "m32r-*-*"} {!istarget "*-*-linux*"} standard_testfile overlays.c ovlymgr.c foo.c bar.c baz.c grbx.c diff --git a/gdb/testsuite/gdb.server/extended-remote-restart.exp b/gdb/testsuite/gdb.server/extended-remote-restart.exp index 6622b526125..8d3b384f348 100644 --- a/gdb/testsuite/gdb.server/extended-remote-restart.exp +++ b/gdb/testsuite/gdb.server/extended-remote-restart.exp @@ -35,9 +35,7 @@ if {[target_info gdb_protocol] != "extended-remote"} { # This test also makes use of 'detach-on-fork' which is not supported # on all platforms. -if {![istarget "*-*-linux*"] && ![istarget "*-*-openbsd*"]} { - return -} +require {is_any_target "*-*-linux*" "*-*-openbsd*"} # And we need to be able to reconnect to gdbserver. set gdbserver_reconnect_p 1 diff --git a/gdb/testsuite/gdb.trace/stap-trace.exp b/gdb/testsuite/gdb.trace/stap-trace.exp index b40c7bc9e0d..34122737d20 100644 --- a/gdb/testsuite/gdb.trace/stap-trace.exp +++ b/gdb/testsuite/gdb.trace/stap-trace.exp @@ -23,9 +23,7 @@ set cr "\[\r\n\]+" # Only x86 and x86_64 targets are supported for now. -if { ![istarget "x86_64-*"] && ![istarget "i?86-*"] } { - return -} +require {is_any_target "x86_64-*" "i?86-*"} proc compile_stap_bin {exec_name {arg ""}} { global srcfile diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 4b8337dbc1c..d30340e1df1 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4201,6 +4201,16 @@ proc gdb_is_target_native { } { return [gdb_is_target_1 "native" ".*native \\(Native process\\).*" "$gdb_prompt $"] } +# Like istarget, but checks a list of targets. +proc is_any_target {args} { + foreach targ $args { + if {[istarget $targ]} { + return 1 + } + } + return 0 +} + # Return the effective value of use_gdb_stub. # # If the use_gdb_stub global has been set (it is set when the gdb process is