public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/46] Rewrite "require" test procedure and use it more often
@ 2022-12-17  0:07 Tom Tromey
  2022-12-17  0:07 ` [PATCH 01/46] Don't use ensure_gdb_index with require Tom Tromey
                   ` (47 more replies)
  0 siblings, 48 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches

A recent patch by Enze Li made me revisit the "require" procedure.
For his patch, see:

https://sourceware.org/pipermail/gdb-patches/2022-December/194586.html

This series rewrites "require" to be a bit more 'static' and then
changes a lot of the test suite to use it when possible.  I looked at
a large number of tests, but not every single one, so it's possible
some more work here could be done.

The new 'require' just invokes simple predicates and decides what to
do based on them.  It will issue an "unsupported" message if the
requirements are not satisfied.  See patch #3.

Currently the requirements should only be invoked when gdb is not
running.  At least, that's what I've done, I don't think there's a
real barrier to doing this, other than the fact that the resulting
code might be overly subtle.

More changes here could be done, for example allowing uses like:

    require {is_remote host}

or the like.  I haven't tried this.

The main benefit of this entire approach is that it removes
boilerplate and decisions about whether to use verbose, unsupport,
untested, or even no output at all.

Regression tested on x86-64 Fedora 36, though TBH that's hardly
sufficient.

Let me know what you think.

Tom



^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 01/46] Don't use ensure_gdb_index with require
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 02/46] Change 'require' to accept a list of predicates Tom Tromey
                   ` (46 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This series changes 'require' to take a list of simple predicates.
This patch backs out the one use of 'require' that doesn't conform to
this -- calling ensure_gdb_index.
---
 gdb/testsuite/gdb.base/with-mf.exp                    | 5 ++++-
 gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp    | 5 ++++-
 gdb/testsuite/gdb.dwarf2/gdb-add-index.exp            | 5 ++++-
 gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp   | 5 ++++-
 gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp | 5 ++++-
 gdb/testsuite/gdb.rust/dwindex.exp                    | 5 ++++-
 6 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.base/with-mf.exp b/gdb/testsuite/gdb.base/with-mf.exp
index 589b0ee2a20..023e5338b37 100644
--- a/gdb/testsuite/gdb.base/with-mf.exp
+++ b/gdb/testsuite/gdb.base/with-mf.exp
@@ -24,7 +24,10 @@ if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \
     return -1
 }
 
-require {ensure_gdb_index $binfile} != -1
+if { [ensure_gdb_index $binfile] == -1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 clean_restart $binfile
 
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
index a578b9d5a40..9050482ad3e 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
@@ -29,7 +29,10 @@ with_test_prefix non-symlink {
 	return -1
     }
 
-    require {ensure_gdb_index $binfile} != -1
+    if { [ensure_gdb_index $binfile] == -1 } {
+	untested "error adding gdb index"
+	return -1
+    }
 }
 
 # Regenerate exec without index.
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
index e3c55ccc94d..013eca7c50b 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
@@ -27,7 +27,10 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \
     return -1
 }
 
-require {ensure_gdb_index $binfile} != -1
+if { [ensure_gdb_index $binfile] == -1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 # Ok, we have a copy of $binfile with an index.
 # Restart gdb and verify the index was used.
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp b/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp
index 27cadc523cd..e546da7b95c 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp
@@ -24,7 +24,10 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-require {ensure_gdb_index $binfile} == 1
+if { [ensure_gdb_index $binfile] != 1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 clean_restart ${binfile}
 
diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
index 65c32c77370..02450aac074 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
@@ -74,7 +74,10 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-require {ensure_gdb_index $binfile} != -1
+if { [ensure_gdb_index $binfile] == -1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 clean_restart ${binfile}
 
diff --git a/gdb/testsuite/gdb.rust/dwindex.exp b/gdb/testsuite/gdb.rust/dwindex.exp
index 5f8ea1a298c..09001cbba0f 100644
--- a/gdb/testsuite/gdb.rust/dwindex.exp
+++ b/gdb/testsuite/gdb.rust/dwindex.exp
@@ -26,7 +26,10 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
     return -1
 }
 
-require {ensure_gdb_index $binfile -dwarf-5} != -1
+if {[ensure_gdb_index $binfile -dwarf-5] == -1} {
+    untested "error adding gdb index"
+    return -1
+}
 
 gdb_exit
 gdb_start
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 02/46] Change 'require' to accept a list of predicates
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
  2022-12-17  0:07 ` [PATCH 01/46] Don't use ensure_gdb_index with require Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 03/46] Use unsupported in 'require' Tom Tromey
                   ` (45 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes 'require' to accept a list of simple predicates.  For
now, each predicate is just the name of a proc, optionally prefixed
with "!" to indicate that the result should be inverted.

It's possible to make this fancier, but so far I haven't done so.  One
idea I had is to allow a predicate to have associated text to display
on failure.  Another is to convert the predicates that need a running
gdb (e.g., skip_python_tests) to start their own gdb, and then
'require' could enforce the rule that gdb not be running when it is
called.
---
 gdb/testsuite/gdb.base/valgrind-bt.exp        |  2 +-
 gdb/testsuite/gdb.base/valgrind-disp-step.exp |  2 +-
 gdb/testsuite/gdb.base/valgrind-infcall-2.exp |  2 +-
 gdb/testsuite/gdb.base/valgrind-infcall.exp   |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-lines.exp        |  2 +-
 .../gdb.dwarf2/dw2-symtab-includes-lookup.exp |  2 +-
 .../frame-inlined-in-outer-frame.exp          |  2 +-
 gdb/testsuite/gdb.mi/mi-async.exp             |  2 +-
 gdb/testsuite/gdb.reverse/insn-reverse.exp    |  2 +-
 gdb/testsuite/gdb.tui/tui-missing-src.exp     |  2 +-
 gdb/testsuite/lib/gdb.exp                     | 51 ++++++++-----------
 11 files changed, 30 insertions(+), 41 deletions(-)

diff --git a/gdb/testsuite/gdb.base/valgrind-bt.exp b/gdb/testsuite/gdb.base/valgrind-bt.exp
index 5dba34e2348..e3399dfc767 100644
--- a/gdb/testsuite/gdb.base/valgrind-bt.exp
+++ b/gdb/testsuite/gdb.base/valgrind-bt.exp
@@ -14,7 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Valgrind gdbserver requires gdb with xml support.
-require gdb_skip_xml_test 0
+require !gdb_skip_xml_test
 
 load_lib valgrind.exp
 
diff --git a/gdb/testsuite/gdb.base/valgrind-disp-step.exp b/gdb/testsuite/gdb.base/valgrind-disp-step.exp
index ee0ed660565..896ea2875b9 100644
--- a/gdb/testsuite/gdb.base/valgrind-disp-step.exp
+++ b/gdb/testsuite/gdb.base/valgrind-disp-step.exp
@@ -19,7 +19,7 @@
 # automatically instead of getting stuck or crashing.
 
 # Valgrind gdbserver requires gdb with xml support.
-require gdb_skip_xml_test 0
+require !gdb_skip_xml_test
 
 load_lib valgrind.exp
 
diff --git a/gdb/testsuite/gdb.base/valgrind-infcall-2.exp b/gdb/testsuite/gdb.base/valgrind-infcall-2.exp
index a001561aed3..b59d8b14c01 100644
--- a/gdb/testsuite/gdb.base/valgrind-infcall-2.exp
+++ b/gdb/testsuite/gdb.base/valgrind-infcall-2.exp
@@ -30,7 +30,7 @@
 # Aborted (core dumped)
 
 # Valgrind gdbserver requires gdb with xml support.
-require gdb_skip_xml_test 0
+require !gdb_skip_xml_test
 
 load_lib valgrind.exp
 
diff --git a/gdb/testsuite/gdb.base/valgrind-infcall.exp b/gdb/testsuite/gdb.base/valgrind-infcall.exp
index 87d7c6b8a50..389cdaa9bc0 100644
--- a/gdb/testsuite/gdb.base/valgrind-infcall.exp
+++ b/gdb/testsuite/gdb.base/valgrind-infcall.exp
@@ -14,7 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Valgrind gdbserver requires gdb with xml support.
-require gdb_skip_xml_test 0
+require !gdb_skip_xml_test
 
 load_lib valgrind.exp
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp
index b24eec0c8d2..b3e0aff446e 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp
@@ -18,7 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support 1
+require dwarf2_support
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes-lookup.exp b/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes-lookup.exp
index 0390d36f74e..c8df4b46477 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes-lookup.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes-lookup.exp
@@ -40,7 +40,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support 1
+require dwarf2_support
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
index 02f9d13af77..cb208c430db 100644
--- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
+++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
@@ -26,7 +26,7 @@
 # directives.
 
 # Check if starti command is supported.
-require use_gdb_stub 0
+require !use_gdb_stub
 
 load_lib dwarf.exp
 
diff --git a/gdb/testsuite/gdb.mi/mi-async.exp b/gdb/testsuite/gdb.mi/mi-async.exp
index 756ca112820..5687c9ac335 100644
--- a/gdb/testsuite/gdb.mi/mi-async.exp
+++ b/gdb/testsuite/gdb.mi/mi-async.exp
@@ -26,7 +26,7 @@ if {!([isnative] && [istarget *-linux*])} {
 }
 
 # Check if start command is supported.
-require use_gdb_stub 0
+require !use_gdb_stub
 
 # The plan is for async mode to become the default but toggle for now.
 set saved_gdbflags $GDBFLAGS
diff --git a/gdb/testsuite/gdb.reverse/insn-reverse.exp b/gdb/testsuite/gdb.reverse/insn-reverse.exp
index 82ae39f9cd9..e16866e1433 100644
--- a/gdb/testsuite/gdb.reverse/insn-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/insn-reverse.exp
@@ -18,7 +18,7 @@ if ![supports_reverse] {
 }
 
 # Check if start command is supported.
-require use_gdb_stub 0
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.tui/tui-missing-src.exp b/gdb/testsuite/gdb.tui/tui-missing-src.exp
index d1fac0b5811..1cb1bb1fbad 100644
--- a/gdb/testsuite/gdb.tui/tui-missing-src.exp
+++ b/gdb/testsuite/gdb.tui/tui-missing-src.exp
@@ -26,7 +26,7 @@
 # 7. Going back to main() shall result in no contents again.
 
 # Check if start command is supported.
-require use_gdb_stub 0
+require !use_gdb_stub
 
 tuiterm_env
 
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 132d538957c..62e519a3cb7 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -9022,41 +9022,30 @@ gdb_caching_proc have_avx {
     return $status
 }
 
-# Called as either:
-# - require EXPR VAL
-# - require EXPR OP VAL
-# In the first case, OP is ==.
-#
-# Require EXPR OP VAL, where EXPR is evaluated in caller context.  If not,
-# return in the caller's context.
-
-proc require { fn arg1 {arg2 ""} } {
-    if { $arg2 == "" } {
-	set op ==
-	set val $arg1
-    } else {
-	set op $arg1
-	set val $arg2
-    }
-    set res [uplevel 1 $fn]
-    if { [expr $res $op $val] } {
-	return
-    }
+# Called as
+# - require ARG...
+#
+# ARG can either be a name, or of the form !NAME.
+#
+# Each name is a proc to evaluate in the caller's context.  It returns
+# a boolean, and a "!" means to invert the result.  If this is
+# nonzero, all is well.  If it is zero, an "untested" is emitted and
+# this proc causes the caller to return.
 
-    switch "$fn $op $val" {
-	"gdb_skip_xml_test == 0" { set msg "missing xml support" }
-	"ensure_gdb_index $binfile != -1" -
-	"ensure_gdb_index $binfile -dwarf-5 != -1" {
-	    set msg "Couldn't ensure index in binfile"
+proc require { args } {
+    foreach arg $args {
+	if {[string index $arg 0] == "!"} {
+	    set ok 0
+	    set fn [string range $arg 1 end]
+	} else {
+	    set ok 1
+	    set fn $arg
 	}
-	"use_gdb_stub == 0" {
-	    set msg "Remote stub used"
+	if {$ok != !![uplevel 1 $fn]} {
+	    untested "require failed: $arg"
+	    return -code return 0
 	}
-	default { set msg "$fn != $val" }
     }
-
-    untested $msg
-    return -code return 0
 }
 
 # Wait up to ::TIMEOUT seconds for file PATH to exist on the target system.
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 03/46] Use unsupported in 'require'
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
  2022-12-17  0:07 ` [PATCH 01/46] Don't use ensure_gdb_index with require Tom Tromey
  2022-12-17  0:07 ` [PATCH 02/46] Change 'require' to accept a list of predicates Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-23 12:39   ` Aktemur, Tankut Baris
  2022-12-17  0:07 ` [PATCH 04/46] Use require supports_reverse Tom Tromey
                   ` (44 subsequent siblings)
  47 siblings, 1 reply; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes 'require' to use 'untested' rather than 'unsupported'.
The latter doesn't really seem to be correct according to the DejaGNU
documentation:

    Declares a test was not run.  `untested' writes in the log file a
    message beginning with _UNTESTED_, appending the `message' argument.
    For example, you might use this in a dummy test whose only role is to
    record that a test does not yet exist for some feature.

The example there, and some text elsewhere, is what makes me think
this isn't a great fit.  On the other hand, 'unsupported' says:

    Declares that a test case depends on some facility that does not exist
    in the testing environment.
---
 gdb/testsuite/lib/gdb.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 62e519a3cb7..3509ff0a51d 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -9042,7 +9042,7 @@ proc require { args } {
 	    set fn $arg
 	}
 	if {$ok != !![uplevel 1 $fn]} {
-	    untested "require failed: $arg"
+	    unsupported "require failed: $arg"
 	    return -code return 0
 	}
     }
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 04/46] Use require supports_reverse
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (2 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 03/46] Use unsupported in 'require' Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 05/46] Use require supports_process_record Tom Tromey
                   ` (43 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require supports_reverse".
---
 gdb/testsuite/gdb.mi/mi-reverse.exp                     | 4 +---
 gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp    | 4 +---
 gdb/testsuite/gdb.reverse/break-reverse.exp             | 4 +---
 gdb/testsuite/gdb.reverse/consecutive-reverse.exp       | 4 +---
 gdb/testsuite/gdb.reverse/finish-precsave.exp           | 4 +---
 gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp       | 4 +---
 gdb/testsuite/gdb.reverse/finish-reverse.exp            | 4 +---
 gdb/testsuite/gdb.reverse/fstatat-reverse.exp           | 4 +---
 gdb/testsuite/gdb.reverse/getrandom.exp                 | 4 +---
 gdb/testsuite/gdb.reverse/getresuid-reverse.exp         | 4 +---
 gdb/testsuite/gdb.reverse/i386-reverse.exp              | 5 +----
 gdb/testsuite/gdb.reverse/i386-sse-reverse.exp          | 5 +----
 gdb/testsuite/gdb.reverse/insn-reverse.exp              | 7 +------
 gdb/testsuite/gdb.reverse/machinestate.exp              | 4 +---
 gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp | 4 +---
 gdb/testsuite/gdb.reverse/pipe-reverse.exp              | 4 +---
 gdb/testsuite/gdb.reverse/readv-reverse.exp             | 4 +---
 gdb/testsuite/gdb.reverse/recvmsg-reverse.exp           | 4 +---
 gdb/testsuite/gdb.reverse/rerun-prec.exp                | 4 +---
 gdb/testsuite/gdb.reverse/s390-mvcle.exp                | 4 +---
 gdb/testsuite/gdb.reverse/sigall-precsave.exp           | 5 +----
 gdb/testsuite/gdb.reverse/sigall-reverse.exp            | 5 +----
 gdb/testsuite/gdb.reverse/singlejmp-reverse.exp         | 4 +---
 gdb/testsuite/gdb.reverse/solib-reverse.exp             | 7 +------
 gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp  | 5 +----
 gdb/testsuite/gdb.reverse/step-reverse.exp              | 4 +---
 gdb/testsuite/gdb.reverse/time-reverse.exp              | 4 +---
 gdb/testsuite/gdb.reverse/until-reverse.exp             | 4 +---
 gdb/testsuite/gdb.reverse/waitpid-reverse.exp           | 4 +---
 gdb/testsuite/gdb.reverse/watch-reverse.exp             | 4 +---
 30 files changed, 30 insertions(+), 101 deletions(-)

diff --git a/gdb/testsuite/gdb.mi/mi-reverse.exp b/gdb/testsuite/gdb.mi/mi-reverse.exp
index 9913206eba9..99704dda75e 100644
--- a/gdb/testsuite/gdb.mi/mi-reverse.exp
+++ b/gdb/testsuite/gdb.mi/mi-reverse.exp
@@ -27,9 +27,7 @@
 # but to verify the correct output response to MI operations.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp b/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp
index 7bb797d90d3..129b08db400 100644
--- a/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 set opts {}
 standard_testfile .S
diff --git a/gdb/testsuite/gdb.reverse/break-reverse.exp b/gdb/testsuite/gdb.reverse/break-reverse.exp
index 29861cd2eba..13459b08f1f 100644
--- a/gdb/testsuite/gdb.reverse/break-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/break-reverse.exp
@@ -16,9 +16,7 @@
 # This file is part of the GDB testsuite.  It tests reverse debugging
 # with breakpoints.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
index 99d83328feb..38d8c2f1cfa 100644
--- a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
@@ -16,9 +16,7 @@
 # This file is part of the GDB testsuite.  It tests stepping over
 # consecutive instructions in reverse.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/finish-precsave.exp b/gdb/testsuite/gdb.reverse/finish-precsave.exp
index 0bf2a7b1ba3..7d31aae5bd2 100644
--- a/gdb/testsuite/gdb.reverse/finish-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/finish-precsave.exp
@@ -16,9 +16,7 @@
 # This file is part of the GDB testsuite.  It tests 'finish' with
 # reverse debugging.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile finish-reverse.c
 set precsave [standard_output_file finish.precsave]
diff --git a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
index 3d98178a4c3..f74154a1044 100644
--- a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
+++ b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
@@ -40,9 +40,7 @@
 # addition to non-PowerPC systems.  On non-PowerPC systems, the GEP and LEP
 # are the same.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/finish-reverse.exp b/gdb/testsuite/gdb.reverse/finish-reverse.exp
index 703423f176e..8655403bcd6 100644
--- a/gdb/testsuite/gdb.reverse/finish-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/finish-reverse.exp
@@ -16,9 +16,7 @@
 # This file is part of the GDB testsuite.  It tests 'finish' with
 # reverse debugging.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
index 10d7024f3cb..abfb3838c91 100644
--- a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
@@ -19,9 +19,7 @@
 # This test tests fstatat syscall for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/getrandom.exp b/gdb/testsuite/gdb.reverse/getrandom.exp
index b1c7d9dad80..a13eff75116 100644
--- a/gdb/testsuite/gdb.reverse/getrandom.exp
+++ b/gdb/testsuite/gdb.reverse/getrandom.exp
@@ -19,9 +19,7 @@
 # This test tests getrandom syscall for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
index a44f2705a3d..fbff31a590a 100644
--- a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
@@ -19,9 +19,7 @@
 # This test tests getresuid/getresgid syscalls for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/i386-reverse.exp b/gdb/testsuite/gdb.reverse/i386-reverse.exp
index 6f6458c776e..85b6eaefccc 100644
--- a/gdb/testsuite/gdb.reverse/i386-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-reverse.exp
@@ -19,10 +19,7 @@
 # This test tests some i386 general instructions for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
-
+require supports_reverse
 
 if {![is_x86_like_target]} {
     verbose "Skipping i386 reverse tests."
diff --git a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
index ac56cd4e50d..84b1b5ea615 100644
--- a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
@@ -19,10 +19,7 @@
 # This test tests some i386 general instructions for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
-
+require supports_reverse
 
 if {![istarget "*86*-*linux*"]} {
     verbose "Skipping i386 reverse tests."
diff --git a/gdb/testsuite/gdb.reverse/insn-reverse.exp b/gdb/testsuite/gdb.reverse/insn-reverse.exp
index e16866e1433..f74f6922719 100644
--- a/gdb/testsuite/gdb.reverse/insn-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/insn-reverse.exp
@@ -13,12 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if ![supports_reverse] {
-    return
-}
-
-# Check if start command is supported.
-require !use_gdb_stub
+require supports_reverse !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/machinestate.exp b/gdb/testsuite/gdb.reverse/machinestate.exp
index e33be3dbfed..deef00d0428 100644
--- a/gdb/testsuite/gdb.reverse/machinestate.exp
+++ b/gdb/testsuite/gdb.reverse/machinestate.exp
@@ -35,9 +35,7 @@
 #   Test forward replay
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile .c ms1.c
 
diff --git a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
index b8364e237b4..60f53f8f46d 100644
--- a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
+++ b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
@@ -40,9 +40,7 @@
 # addition to non-PowerPC systems.  On non-PowerPC systems, the GEP and LEP
 # are the same.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/pipe-reverse.exp b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
index a3dafc0347a..45b249b4064 100644
--- a/gdb/testsuite/gdb.reverse/pipe-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
@@ -19,9 +19,7 @@
 # This test tests pipe syscall for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.exp b/gdb/testsuite/gdb.reverse/readv-reverse.exp
index 370a63cbe73..f921e5c67ff 100644
--- a/gdb/testsuite/gdb.reverse/readv-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/readv-reverse.exp
@@ -19,9 +19,7 @@
 # This test tests readv syscall for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
index 57a30569288..247d58e9f3e 100644
--- a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
@@ -19,9 +19,7 @@
 # This test tests socketpair and recvmsg syscalls for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/rerun-prec.exp b/gdb/testsuite/gdb.reverse/rerun-prec.exp
index 16fc6f28c76..1c3ab52e7a1 100644
--- a/gdb/testsuite/gdb.reverse/rerun-prec.exp
+++ b/gdb/testsuite/gdb.reverse/rerun-prec.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-if {![supports_reverse] || ![supports_process_record]} {
-    return
-}
+require supports_reverse supports_process_record
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/s390-mvcle.exp b/gdb/testsuite/gdb.reverse/s390-mvcle.exp
index 4b8a8adc8de..c8d235c057a 100644
--- a/gdb/testsuite/gdb.reverse/s390-mvcle.exp
+++ b/gdb/testsuite/gdb.reverse/s390-mvcle.exp
@@ -17,9 +17,7 @@
 # This test tests s390 MVCLE opcode for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 if { ! [istarget "s390*-*-*"] } {
     verbose "Skipping s390 MVCLE instruction recording tests."
diff --git a/gdb/testsuite/gdb.reverse/sigall-precsave.exp b/gdb/testsuite/gdb.reverse/sigall-precsave.exp
index d8761753971..6df5cd2b660 100644
--- a/gdb/testsuite/gdb.reverse/sigall-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/sigall-precsave.exp
@@ -18,10 +18,7 @@ if [target_info exists gdb,nosignals] {
     return
 }
 
-if ![supports_reverse] {
-    return
-}
-
+require supports_reverse
 
 gdb_exit
 gdb_start
diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.exp b/gdb/testsuite/gdb.reverse/sigall-reverse.exp
index 7078067a71e..818bbec4fb6 100644
--- a/gdb/testsuite/gdb.reverse/sigall-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/sigall-reverse.exp
@@ -18,10 +18,7 @@ if [target_info exists gdb,nosignals] {
     return
 }
 
-if ![supports_reverse] {
-    return
-}
-
+require supports_reverse
 
 gdb_exit
 gdb_start
diff --git a/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp b/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
index d6934ffcd19..ce9972e8be5 100644
--- a/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/singlejmp-reverse.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile ".S" "${gdb_test_file_name}-nodebug.S"
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.reverse/solib-reverse.exp b/gdb/testsuite/gdb.reverse/solib-reverse.exp
index 3bcf2dfcb24..b7f76f53265 100644
--- a/gdb/testsuite/gdb.reverse/solib-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/solib-reverse.exp
@@ -16,12 +16,7 @@
 # This file is part of the GDB testsuite.  It tests reverse debugging
 # with shared libraries.
 
-if ![supports_reverse] {
-    return
-}
-if {[skip_shlib_tests]} {
-    return
-}
+require supports_reverse !skip_shlib_tests
 
 standard_testfile
 set lib1file "shr1"
diff --git a/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp b/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
index 3f1f5381f09..058482cbb47 100644
--- a/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
+++ b/gdb/testsuite/gdb.reverse/step-indirect-call-thunk.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { ![supports_reverse] } {
-    untested "target does not support record"
-    return -1
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/step-reverse.exp b/gdb/testsuite/gdb.reverse/step-reverse.exp
index d2975cffb5c..b272d427f15 100644
--- a/gdb/testsuite/gdb.reverse/step-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/step-reverse.exp
@@ -20,9 +20,7 @@
 # Test step and next in reverse
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/time-reverse.exp b/gdb/testsuite/gdb.reverse/time-reverse.exp
index 94acea8eed5..ec756390c4d 100644
--- a/gdb/testsuite/gdb.reverse/time-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/time-reverse.exp
@@ -19,9 +19,7 @@
 # This test tests time syscall for reverse execution.
 #
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/until-reverse.exp b/gdb/testsuite/gdb.reverse/until-reverse.exp
index 0afd0e05f50..3357d6c1783 100644
--- a/gdb/testsuite/gdb.reverse/until-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/until-reverse.exp
@@ -16,9 +16,7 @@
 # This file is part of the GDB testsuite.  It tests 'until' and 
 # 'advance' in reverse debugging.
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile .c ur1.c
 
diff --git a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
index ddaa71a987c..fe6fbc7cb8a 100644
--- a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
@@ -21,9 +21,7 @@
 # Also serves as regression test for gdb/19187 (recording across a
 # fork).
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/watch-reverse.exp b/gdb/testsuite/gdb.reverse/watch-reverse.exp
index 056e381cd85..55fa86158b6 100644
--- a/gdb/testsuite/gdb.reverse/watch-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/watch-reverse.exp
@@ -18,9 +18,7 @@
 # with watchpoints.
 
 
-if ![supports_reverse] {
-    return
-}
+require supports_reverse
 
 standard_testfile
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 05/46] Use require supports_process_record
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (3 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 04/46] Use require supports_reverse Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 06/46] Use require dwarf2_support Tom Tromey
                   ` (42 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require supports_process_record".
---
 gdb/testsuite/gdb.mi/mi-record-changed.exp          |  4 +---
 gdb/testsuite/gdb.python/py-record-full.exp         |  5 +----
 gdb/testsuite/gdb.reverse/break-precsave.exp        | 10 +++-------
 gdb/testsuite/gdb.reverse/consecutive-precsave.exp  | 10 +++-------
 gdb/testsuite/gdb.reverse/i386-precsave.exp         | 10 +++-------
 gdb/testsuite/gdb.reverse/machinestate-precsave.exp | 10 +++-------
 gdb/testsuite/gdb.reverse/solib-precsave.exp        | 13 +++----------
 gdb/testsuite/gdb.reverse/step-precsave.exp         | 10 +++-------
 gdb/testsuite/gdb.reverse/until-precsave.exp        | 10 +++-------
 gdb/testsuite/gdb.reverse/watch-precsave.exp        | 10 +++-------
 10 files changed, 26 insertions(+), 66 deletions(-)

diff --git a/gdb/testsuite/gdb.mi/mi-record-changed.exp b/gdb/testsuite/gdb.mi/mi-record-changed.exp
index b49bc12eaed..1d7dfbd5f58 100644
--- a/gdb/testsuite/gdb.mi/mi-record-changed.exp
+++ b/gdb/testsuite/gdb.mi/mi-record-changed.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile basics.c
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
diff --git a/gdb/testsuite/gdb.python/py-record-full.exp b/gdb/testsuite/gdb.python/py-record-full.exp
index 52d6dd3da0b..c8efd9c5889 100644
--- a/gdb/testsuite/gdb.python/py-record-full.exp
+++ b/gdb/testsuite/gdb.python/py-record-full.exp
@@ -17,10 +17,7 @@
 
 # Skip this test if target does not support recording.
 
-if { ![supports_process_record] } {
-    untested "skipping recording tests"
-    return -1
-}
+require supports_process_record
 
 load_lib gdb-python.exp
 
diff --git a/gdb/testsuite/gdb.reverse/break-precsave.exp b/gdb/testsuite/gdb.reverse/break-precsave.exp
index 937bf060134..52251a94022 100644
--- a/gdb/testsuite/gdb.reverse/break-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/break-precsave.exp
@@ -17,9 +17,7 @@
 # with breakpoints in a process record logfile.
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile break-reverse.c
 set precsave [standard_output_file break.precsave]
@@ -39,10 +37,8 @@ proc precsave_tests {} {
 
     runto_main
 
-    if [supports_process_record] {
-	# Activate process record/replay
-	gdb_test_no_output "record" "turn on process record"
-    }
+    # Activate process record/replay
+    gdb_test_no_output "record" "turn on process record"
 
     gdb_test "break $end_location" \
 	"Breakpoint $decimal at .*$srcfile, line $end_location\." \
diff --git a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
index d1d1aa2b061..e57730a12c3 100644
--- a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
@@ -17,9 +17,7 @@
 # consecutive instructions in a process record logfile.
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile consecutive-reverse.c
 set precsave [standard_output_file consecutive.precsave]
@@ -30,10 +28,8 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 set is_stmt [is_stmt_addresses $srcfile]
 
diff --git a/gdb/testsuite/gdb.reverse/i386-precsave.exp b/gdb/testsuite/gdb.reverse/i386-precsave.exp
index fbf80b89c05..c2467b56c27 100644
--- a/gdb/testsuite/gdb.reverse/i386-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/i386-precsave.exp
@@ -20,9 +20,7 @@
 #
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 
 if {![is_x86_like_target]} {
@@ -46,10 +44,8 @@ set end_of_inc_dec_tests [gdb_get_line_number " end inc_dec_tests "]
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 global hex
 global decimal
diff --git a/gdb/testsuite/gdb.reverse/machinestate-precsave.exp b/gdb/testsuite/gdb.reverse/machinestate-precsave.exp
index bafea4a30f6..c58ad08c2d4 100644
--- a/gdb/testsuite/gdb.reverse/machinestate-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/machinestate-precsave.exp
@@ -36,9 +36,7 @@
 #
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile machinestate.c ms1.c
 set precsave [standard_output_file machinestate.precsave]
@@ -57,10 +55,8 @@ set endmain   [gdb_get_line_number " end main "   $srcfile]
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 gdb_test "break $endmain" \
     "Breakpoint $decimal at .*$srcfile, line $endmain\." \
diff --git a/gdb/testsuite/gdb.reverse/solib-precsave.exp b/gdb/testsuite/gdb.reverse/solib-precsave.exp
index 67bb52addeb..1a6af90986e 100644
--- a/gdb/testsuite/gdb.reverse/solib-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/solib-precsave.exp
@@ -17,12 +17,7 @@
 # with shared libraries and a logfile.
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
-if {[skip_shlib_tests]} {
-    return
-}
+require supports_process_record !skip_shlib_tests
 
 standard_testfile solib-reverse.c
 set precsave [standard_output_file solib.precsave]
@@ -77,10 +72,8 @@ gdb_load_shlib $library2
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 set end_of_main [gdb_get_line_number "end of main" ]
 gdb_test "break $end_of_main" \
diff --git a/gdb/testsuite/gdb.reverse/step-precsave.exp b/gdb/testsuite/gdb.reverse/step-precsave.exp
index 3279b6ce879..33c5051c7f8 100644
--- a/gdb/testsuite/gdb.reverse/step-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/step-precsave.exp
@@ -21,9 +21,7 @@
 #
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile step-reverse.c
 set precsave [standard_output_file step.precsave]
@@ -34,10 +32,8 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 set end_of_main [gdb_get_line_number "end of main" ]
 gdb_test "break $end_of_main" \
diff --git a/gdb/testsuite/gdb.reverse/until-precsave.exp b/gdb/testsuite/gdb.reverse/until-precsave.exp
index 98a5188837f..68878bc8f73 100644
--- a/gdb/testsuite/gdb.reverse/until-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/until-precsave.exp
@@ -17,9 +17,7 @@
 # 'advance' in precord logfile.
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile until-reverse.c ur1.c
 set precsave [standard_output_file until.precsave]
@@ -38,10 +36,8 @@ set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 set end_of_main [gdb_get_line_number "set breakpoint 10a here" ]
 gdb_test "break $end_of_main" \
diff --git a/gdb/testsuite/gdb.reverse/watch-precsave.exp b/gdb/testsuite/gdb.reverse/watch-precsave.exp
index ceac823bd6c..181157c837d 100644
--- a/gdb/testsuite/gdb.reverse/watch-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/watch-precsave.exp
@@ -18,9 +18,7 @@
 # debugging with watchpoints.
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile watch-reverse.c
 set precsave [standard_output_file watch.precsave]
@@ -31,10 +29,8 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 set end_location  [gdb_get_line_number "end of main"  ]
 gdb_test "break $end_location" \
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 06/46] Use require dwarf2_support
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (4 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 05/46] Use require supports_process_record Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 07/46] Use require is_x86_like_target Tom Tromey
                   ` (41 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require dwarf2_support".
---
 gdb/testsuite/gdb.base/until-trailing-insns.exp            | 5 +----
 gdb/testsuite/gdb.compile/compile-ops.exp                  | 4 +---
 gdb/testsuite/gdb.cp/incomplete-type-overload.exp          | 2 +-
 gdb/testsuite/gdb.cp/namelessclass.exp                     | 4 +---
 gdb/testsuite/gdb.cp/nsalias.exp                           | 4 +---
 gdb/testsuite/gdb.dlang/circular.exp                       | 7 +------
 gdb/testsuite/gdb.dlang/watch-loc.exp                      | 7 +------
 gdb/testsuite/gdb.dwarf2/ada-cold-name.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/ada-thick-pointer.exp             | 4 +---
 gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/arr-stride.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/arr-subrange.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/atomic-type.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/bad-regnum.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp | 4 +---
 gdb/testsuite/gdb.dwarf2/callframecfa.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/calling-convention.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/clang-cli-macro.exp               | 4 +---
 gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/clang-debug-names.exp             | 4 +---
 gdb/testsuite/gdb.dwarf2/clztest.exp                       | 4 +---
 gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp                | 4 +---
 gdb/testsuite/gdb.dwarf2/corrupt.exp                       | 4 +---
 gdb/testsuite/gdb.dwarf2/count.exp                         | 4 +---
 gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/cu-no-addrs.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/data-loc.exp                      | 4 +---
 .../gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp  | 5 +----
 gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp      | 4 +---
 gdb/testsuite/gdb.dwarf2/debug-names-duplicate-cu.exp      | 4 +---
 gdb/testsuite/gdb.dwarf2/debug-names-missing-cu.exp        | 4 +---
 gdb/testsuite/gdb.dwarf2/debug-names-non-ascending-cu.exp  | 4 +---
 gdb/testsuite/gdb.dwarf2/debug-names.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/dup-psym.exp                      | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-align.exp                     | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp     | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp        | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-basic.exp                     | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-bfloat16.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp          | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-common-block.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-compressed.exp                | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-const.exp                     | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp     | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp             | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp      | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-dos-drive.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.exp       | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-dup-frame.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-entry-value.exp               | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-error.exp                     | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-filename.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp               | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp                | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-icycle.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp               | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp        | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-intercu.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-intermix.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp        | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp          | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp        | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp       | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp   | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-noloc.exp                     | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-op-call.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-op-out-param.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp             | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp   | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-param-error.exp               | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-producer.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp               | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp               | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp            | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-ranges-psym-warning.exp       | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp               | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-ranges.exp                    | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp             | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.exp             | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-restrict.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp            | 4 +---
 .../gdb.dwarf2/dw2-single-line-discriminators.exp          | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp             | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp            | 4 +---
 .../gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp        | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-strp.exp                      | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-symtab-includes.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp        | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp                | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp          | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp       | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.exp             | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp    | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-weird-type-len.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp                | 5 +----
 gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dwz.exp                           | 4 +---
 gdb/testsuite/gdb.dwarf2/dwzbuildid.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/dwznolink.exp                     | 4 +---
 gdb/testsuite/gdb.dwarf2/dyn-type-unallocated.exp          | 4 +---
 gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/enum-type.exp                     | 4 +---
 gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp          | 4 +---
 gdb/testsuite/gdb.dwarf2/fission-base.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp          | 4 +---
 gdb/testsuite/gdb.dwarf2/fission-loclists.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/fission-mix.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp          | 4 +---
 gdb/testsuite/gdb.dwarf2/fission-reread.exp                | 4 +---
 gdb/testsuite/gdb.dwarf2/formdata16.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/fortran-var-string.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp  | 4 +---
 gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/gdb-add-index.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/gdb-index.exp                     | 4 +---
 gdb/testsuite/gdb.dwarf2/implptr-64bit.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/implptr.exp                       | 4 +---
 gdb/testsuite/gdb.dwarf2/implptrconst.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/implptrpiece.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/implref-array.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/implref-const.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/implref-global.exp                | 4 +---
 gdb/testsuite/gdb.dwarf2/implref-struct.exp                | 4 +---
 .../gdb.dwarf2/imported-unit-abstract-const-value.exp      | 4 +---
 gdb/testsuite/gdb.dwarf2/imported-unit-c.exp               | 4 +---
 gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp      | 4 +---
 gdb/testsuite/gdb.dwarf2/imported-unit.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp     | 4 +---
 .../gdb.dwarf2/inlined_subroutine-inheritance.exp          | 4 +---
 gdb/testsuite/gdb.dwarf2/intbits.exp                       | 4 +---
 gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp                | 4 +---
 gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp  | 4 +---
 gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/loclists-start-end.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/mac-fileno.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/macro-source-path.exp             | 4 +---
 gdb/testsuite/gdb.dwarf2/main-subprogram.exp               | 4 +---
 gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/method-ptr.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/missing-sig-type.exp              | 4 +---
 .../gdb.dwarf2/missing-type-name-for-templates.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/missing-type-name.exp             | 4 +---
 gdb/testsuite/gdb.dwarf2/multidictionary.exp               | 4 +---
 gdb/testsuite/gdb.dwarf2/negative-data-member-location.exp | 4 +---
 gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp              | 4 +---
 gdb/testsuite/gdb.dwarf2/nonvar-access.exp                 | 2 +-
 gdb/testsuite/gdb.dwarf2/nostaticblock.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp            | 4 +---
 gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp          | 4 +---
 gdb/testsuite/gdb.dwarf2/pieces.exp                        | 4 +---
 gdb/testsuite/gdb.dwarf2/pr11465.exp                       | 4 +---
 gdb/testsuite/gdb.dwarf2/pr13961.exp                       | 4 +---
 gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/shortpiece.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/staticvirtual.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/struct-decl.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/struct-with-sig.exp               | 4 +---
 gdb/testsuite/gdb.dwarf2/subrange-enum.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/subrange.exp                      | 4 +---
 gdb/testsuite/gdb.dwarf2/symbol_needs_eval_fail.exp        | 4 +---
 gdb/testsuite/gdb.dwarf2/symbol_needs_eval_timeout.exp     | 4 +---
 gdb/testsuite/gdb.dwarf2/symtab-producer.exp               | 4 +---
 .../gdb.dwarf2/template-specification-full-name.exp        | 4 +---
 gdb/testsuite/gdb.dwarf2/trace-crash.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/typeddwarf.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/utf-rust.exp                      | 4 +---
 gdb/testsuite/gdb.dwarf2/valop.exp                         | 4 +---
 gdb/testsuite/gdb.dwarf2/var-access.exp                    | 4 +---
 gdb/testsuite/gdb.dwarf2/variant.exp                       | 4 +---
 gdb/testsuite/gdb.dwarf2/varval.exp                        | 4 +---
 gdb/testsuite/gdb.dwarf2/void-type.exp                     | 4 +---
 gdb/testsuite/gdb.dwarf2/watch-notconst.exp                | 4 +---
 gdb/testsuite/gdb.linespec/break-asm-file.exp              | 4 +---
 gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp             | 4 +---
 gdb/testsuite/gdb.mi/mi-reg-undefined.exp                  | 4 +---
 gdb/testsuite/gdb.trace/entry-values.exp                   | 4 +---
 gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp        | 4 +---
 215 files changed, 215 insertions(+), 661 deletions(-)

diff --git a/gdb/testsuite/gdb.base/until-trailing-insns.exp b/gdb/testsuite/gdb.base/until-trailing-insns.exp
index 56f6cf038e2..983b8290b47 100644
--- a/gdb/testsuite/gdb.base/until-trailing-insns.exp
+++ b/gdb/testsuite/gdb.base/until-trailing-insns.exp
@@ -79,10 +79,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    unsupported "dwarf2 support required for this test"
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.compile/compile-ops.exp b/gdb/testsuite/gdb.compile/compile-ops.exp
index e18f92eaa39..bbd710391aa 100644
--- a/gdb/testsuite/gdb.compile/compile-ops.exp
+++ b/gdb/testsuite/gdb.compile/compile-ops.exp
@@ -20,9 +20,7 @@ load_lib compile-support.exp
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dbg.S
 
diff --git a/gdb/testsuite/gdb.cp/incomplete-type-overload.exp b/gdb/testsuite/gdb.cp/incomplete-type-overload.exp
index 024014d68ba..fdff30f3850 100644
--- a/gdb/testsuite/gdb.cp/incomplete-type-overload.exp
+++ b/gdb/testsuite/gdb.cp/incomplete-type-overload.exp
@@ -22,7 +22,7 @@ load_lib dwarf.exp
 
 if { [skip_cplus_tests] } { return }
 
-if { ![dwarf2_support] } { return }
+require dwarf2_support
 
 standard_testfile .cc .S
 set asm_file [standard_output_file ${srcfile2}]
diff --git a/gdb/testsuite/gdb.cp/namelessclass.exp b/gdb/testsuite/gdb.cp/namelessclass.exp
index b9f5822995c..86d4a382444 100644
--- a/gdb/testsuite/gdb.cp/namelessclass.exp
+++ b/gdb/testsuite/gdb.cp/namelessclass.exp
@@ -24,9 +24,7 @@ if {[skip_cplus_tests]} {
 }
 
 # This test can only be run on x86-like targets which support DWARF.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 if {![istarget "x86_64-*-*"] || ![is_lp64_target]} {
     return 0
diff --git a/gdb/testsuite/gdb.cp/nsalias.exp b/gdb/testsuite/gdb.cp/nsalias.exp
index 4daba1988c9..2ebf432dc8e 100644
--- a/gdb/testsuite/gdb.cp/nsalias.exp
+++ b/gdb/testsuite/gdb.cp/nsalias.exp
@@ -18,9 +18,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 if {[skip_cplus_tests]} {
     return
diff --git a/gdb/testsuite/gdb.dlang/circular.exp b/gdb/testsuite/gdb.dlang/circular.exp
index 7506e3bb5a4..de1b4d3c99e 100644
--- a/gdb/testsuite/gdb.dlang/circular.exp
+++ b/gdb/testsuite/gdb.dlang/circular.exp
@@ -18,12 +18,7 @@
 load_lib "d-support.exp"
 load_lib "dwarf.exp"
 
-if { [skip_d_tests] } { continue }
-
-# This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require !skip_d_tests dwarf2_support
 
 standard_testfile circular.c circular-dw.S
 
diff --git a/gdb/testsuite/gdb.dlang/watch-loc.exp b/gdb/testsuite/gdb.dlang/watch-loc.exp
index 6c786314063..4bf1caa3c5f 100644
--- a/gdb/testsuite/gdb.dlang/watch-loc.exp
+++ b/gdb/testsuite/gdb.dlang/watch-loc.exp
@@ -18,12 +18,7 @@
 load_lib "d-support.exp"
 load_lib "dwarf.exp"
 
-if { [skip_d_tests] } { return -1 }
-
-# This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require !skip_d_tests dwarf2_support
 
 standard_testfile watch-loc.c watch-loc-dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/ada-cold-name.exp b/gdb/testsuite/gdb.dwarf2/ada-cold-name.exp
index 807bf86a5df..37fd74a2d58 100644
--- a/gdb/testsuite/gdb.dwarf2/ada-cold-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/ada-cold-name.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile ada-linkage-name.c -debug.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp b/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp
index cad7d7a1d8a..e86d0afb172 100644
--- a/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp
@@ -19,9 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -debug.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/ada-thick-pointer.exp b/gdb/testsuite/gdb.dwarf2/ada-thick-pointer.exp
index 781efd6a580..25e17477f7e 100644
--- a/gdb/testsuite/gdb.dwarf2/ada-thick-pointer.exp
+++ b/gdb/testsuite/gdb.dwarf2/ada-thick-pointer.exp
@@ -19,9 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -debug.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp
index 0da03669f7d..5ecbf6c78b7 100644
--- a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp
+++ b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/arr-stride.exp b/gdb/testsuite/gdb.dwarf2/arr-stride.exp
index a16abdff743..3fed02b3928 100644
--- a/gdb/testsuite/gdb.dwarf2/arr-stride.exp
+++ b/gdb/testsuite/gdb.dwarf2/arr-stride.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/arr-subrange.exp b/gdb/testsuite/gdb.dwarf2/arr-subrange.exp
index fa2e89a4a4f..5c9b8a34951 100644
--- a/gdb/testsuite/gdb.dwarf2/arr-subrange.exp
+++ b/gdb/testsuite/gdb.dwarf2/arr-subrange.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/atomic-type.exp b/gdb/testsuite/gdb.dwarf2/atomic-type.exp
index b1cf848f794..adb90fcbab1 100644
--- a/gdb/testsuite/gdb.dwarf2/atomic-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/atomic-type.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/bad-regnum.exp b/gdb/testsuite/gdb.dwarf2/bad-regnum.exp
index 884bbb5b3ee..74c4deab4a5 100644
--- a/gdb/testsuite/gdb.dwarf2/bad-regnum.exp
+++ b/gdb/testsuite/gdb.dwarf2/bad-regnum.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp
index 455ed1b4d19..6f37cf46903 100644
--- a/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp
+++ b/gdb/testsuite/gdb.dwarf2/bitfield-parent-optimized-out.exp
@@ -19,9 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c .S
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.dwarf2/callframecfa.exp b/gdb/testsuite/gdb.dwarf2/callframecfa.exp
index c5c376bf889..bd2d0a75bc7 100644
--- a/gdb/testsuite/gdb.dwarf2/callframecfa.exp
+++ b/gdb/testsuite/gdb.dwarf2/callframecfa.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Test DW_OP_call_frame_cfa.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 # This test can only be run on x86 targets.
 if {![is_x86_like_target]} {
     return 0  
diff --git a/gdb/testsuite/gdb.dwarf2/calling-convention.exp b/gdb/testsuite/gdb.dwarf2/calling-convention.exp
index 8c87a69ebdf..172a667d542 100644
--- a/gdb/testsuite/gdb.dwarf2/calling-convention.exp
+++ b/gdb/testsuite/gdb.dwarf2/calling-convention.exp
@@ -27,9 +27,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/clang-cli-macro.exp b/gdb/testsuite/gdb.dwarf2/clang-cli-macro.exp
index 3160532dfc3..2052cf30ce3 100644
--- a/gdb/testsuite/gdb.dwarf2/clang-cli-macro.exp
+++ b/gdb/testsuite/gdb.dwarf2/clang-cli-macro.exp
@@ -23,9 +23,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
index b1d7670ca87..26f8c50e272 100644
--- a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -debug.S -foo.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
index 22fdd740c6f..54c055172ce 100644
--- a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
+++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -debug.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/clztest.exp b/gdb/testsuite/gdb.dwarf2/clztest.exp
index 584a07138b6..2d40b1d3621 100644
--- a/gdb/testsuite/gdb.dwarf2/clztest.exp
+++ b/gdb/testsuite/gdb.dwarf2/clztest.exp
@@ -19,9 +19,7 @@ standard_testfile .S
 set test "clztest"
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0  
-}
+require dwarf2_support
 
 # This test can only be run on x86-64 targets.
 if {![istarget x86_64-*] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp b/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
index 357c22b8238..426735e09cc 100644
--- a/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
+++ b/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
@@ -21,9 +21,7 @@ load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use
 # gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/corrupt.exp b/gdb/testsuite/gdb.dwarf2/corrupt.exp
index 3b8100eb8e1..91d69cec74e 100644
--- a/gdb/testsuite/gdb.dwarf2/corrupt.exp
+++ b/gdb/testsuite/gdb.dwarf2/corrupt.exp
@@ -18,9 +18,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/count.exp b/gdb/testsuite/gdb.dwarf2/count.exp
index f930062cd7f..86895a6a68a 100644
--- a/gdb/testsuite/gdb.dwarf2/count.exp
+++ b/gdb/testsuite/gdb.dwarf2/count.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # Only run on targets which support dwarf and gas.
-if { ![dwarf2_support] } {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp b/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp
index 59cfb3aa9c9..8dd2a9c096b 100644
--- a/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp
@@ -21,9 +21,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -debug.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/cu-no-addrs.exp b/gdb/testsuite/gdb.dwarf2/cu-no-addrs.exp
index 0c7b80d5f4f..04981e8b22c 100644
--- a/gdb/testsuite/gdb.dwarf2/cu-no-addrs.exp
+++ b/gdb/testsuite/gdb.dwarf2/cu-no-addrs.exp
@@ -19,9 +19,7 @@
 load_lib "dwarf.exp"
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c cu-no-addrs.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/data-loc.exp b/gdb/testsuite/gdb.dwarf2/data-loc.exp
index bbf5b9378b6..f16aa395db4 100644
--- a/gdb/testsuite/gdb.dwarf2/data-loc.exp
+++ b/gdb/testsuite/gdb.dwarf2/data-loc.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp b/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp
index 0e0e0cb893b..13efea12f63 100644
--- a/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp
+++ b/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp
@@ -17,10 +17,7 @@ load_lib dwarf.exp
 # Test with two aranges entries referring to the same CU.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp b/gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp
index 23dd4daf28f..1508f171a83 100644
--- a/gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp
+++ b/gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile _start.c debug-names.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/debug-names-duplicate-cu.exp b/gdb/testsuite/gdb.dwarf2/debug-names-duplicate-cu.exp
index a79a60a6b5d..3e9bc665856 100644
--- a/gdb/testsuite/gdb.dwarf2/debug-names-duplicate-cu.exp
+++ b/gdb/testsuite/gdb.dwarf2/debug-names-duplicate-cu.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile _start.c debug-names.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/debug-names-missing-cu.exp b/gdb/testsuite/gdb.dwarf2/debug-names-missing-cu.exp
index f70debd35ad..0a90813ae23 100644
--- a/gdb/testsuite/gdb.dwarf2/debug-names-missing-cu.exp
+++ b/gdb/testsuite/gdb.dwarf2/debug-names-missing-cu.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile _start.c debug-names.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/debug-names-non-ascending-cu.exp b/gdb/testsuite/gdb.dwarf2/debug-names-non-ascending-cu.exp
index 53523eec46e..632261bc89e 100644
--- a/gdb/testsuite/gdb.dwarf2/debug-names-non-ascending-cu.exp
+++ b/gdb/testsuite/gdb.dwarf2/debug-names-non-ascending-cu.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile _start.c debug-names.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/debug-names.exp b/gdb/testsuite/gdb.dwarf2/debug-names.exp
index e625c1fbb7a..4bce6cd7868 100644
--- a/gdb/testsuite/gdb.dwarf2/debug-names.exp
+++ b/gdb/testsuite/gdb.dwarf2/debug-names.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile _start.c debug-names.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dup-psym.exp b/gdb/testsuite/gdb.dwarf2/dup-psym.exp
index 930f35126b9..e6c690b8546 100644
--- a/gdb/testsuite/gdb.dwarf2/dup-psym.exp
+++ b/gdb/testsuite/gdb.dwarf2/dup-psym.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Minimal DWARF-2 unit test
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp
index af9d12a9aeb..c1b63460846 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp b/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp
index b30f6e51df5..052f711d2fd 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-align.exp b/gdb/testsuite/gdb.dwarf2/dw2-align.exp
index 8e144ebc104..7a533708703 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-align.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-align.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp
index a72be921610..91fa7f919ea 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 if {[skip_cplus_tests]} { continue }
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp
index 4bdc55f58d4..a7f5748087d 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Minimal DWARF-2 unit test
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .S
 set dwarf_srcfile "file1.txt"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
index 7b71ed1155e..17a5b59a27e 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
@@ -30,9 +30,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -other.S -dwarf.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp
index b6e1cc07368..8e6e18e83e1 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp
index bb538a68411..4fbbd4590bb 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp
index 6f0449bb7e9..6534a7afde5 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .c -2.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-basic.exp b/gdb/testsuite/gdb.dwarf2/dw2-basic.exp
index 8c58eaf8ae1..3718c5766e0 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-basic.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-basic.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Minimal DWARF-2 unit test
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set dwarf_srcfile "file1.txt"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bfloat16.exp b/gdb/testsuite/gdb.dwarf2/dw2-bfloat16.exp
index 0f6202e6431..5a24774592c 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-bfloat16.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bfloat16.exp
@@ -19,9 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.exp
index b75f03cb7a6..bd6499619ba 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags_asm]
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp
index 4032e8be679..cdccee61e14 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .c -debug.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp b/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp
index 5e04cf9160e..d07890580a9 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0  
-}
+require dwarf2_support
 
 # This test can only be run on x86-64 targets.
 if {![istarget x86_64-*] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.exp b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.exp
index 0766b9688ae..a3b363a5c2c 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags_asm]
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp b/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp
index 32a984971a0..6406224ba9a 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-compressed.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Minimal DWARF-2 unit test
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set dwarf_srcfile "file1.txt"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-const.exp b/gdb/testsuite/gdb.dwarf2/dw2-const.exp
index b88645da17a..68d9aed8688 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-const.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-const.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
index 92f0e1350ec..6c503b182b3 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
@@ -21,9 +21,7 @@ if { [skip_cplus_tests] } { continue }
 
 load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S -main.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp
index 4ecfb5facf2..42084421418 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp
@@ -20,9 +20,7 @@ load_lib dwarf.exp
 # in the length of the CU.  */
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp
index d9d34440b16..6a7194af379 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 # This test has hard-wired assumptions that host and build filenames are
 # the same, and assumes POSIX pathname syntax.
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp b/gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp
index 11cc347570a..14b72898015 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp
@@ -25,9 +25,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.exp b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.exp
index c7f385b5600..910079993cf 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.exp
@@ -14,9 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.exp
index 1f73271859b..01d3c27719a 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.exp
@@ -18,9 +18,7 @@ load_lib dwarf.exp
 # introduced by GCC PR debug/40659.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.exp b/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.exp
index bae266d013f..a4d76c97027 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .S
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dup-frame.exp b/gdb/testsuite/gdb.dwarf2/dw2-dup-frame.exp
index 33509c10500..ba9044e47bb 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-dup-frame.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-dup-frame.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # This test can only be run on x86_64 targets.
 if {![istarget "x86_64-*-*"] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.exp b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.exp
index efe9da37882..53f8d1d4a3f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Test G++ 4.1 producing DW_TAG_namespace with DW_AT_name "::".
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.exp b/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.exp
index 37ade8e099e..c37211d2e0e 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-value.exp b/gdb/testsuite/gdb.dwarf2/dw2-entry-value.exp
index 2eb145c6923..23be91df447 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-entry-value.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-value.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 if { [prepare_for_testing "failed to prepare" "dw2-entry-value" {dw2-entry-value-main.c dw2-entry-value.S} {nodebug}] } {
     return -1
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-error.exp b/gdb/testsuite/gdb.dwarf2/dw2-error.exp
index ae92fa58363..c7b3a4f28a8 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-error.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-error.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-filename.exp b/gdb/testsuite/gdb.dwarf2/dw2-filename.exp
index 1a5ab7031cd..44b7541b8d4 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-filename.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-filename.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Note: Inspired from dw2-basic.exp.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .S
 set dwarf_srcfile "file1.txt"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp b/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp
index 956804f30b9..a4b7bc86f9b 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile dw2-fixed-point.c dw2-fixed-point-dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp
index e22d4439a09..ea29db5a0e1 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.exp
@@ -19,9 +19,7 @@ load_lib dwarf.exp
 # This is GDB PR symtab/13277.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .S
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-icycle.exp b/gdb/testsuite/gdb.dwarf2/dw2-icycle.exp
index d3caf249060..dfff47dd11f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-icycle.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-icycle.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .S main.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
index 7bf7d2bb85b..8b59850c2ac 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp
index adb3660ee53..334874c148f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp
@@ -18,9 +18,7 @@ load_lib dwarf.exp
 # introduced by GCC PR debug/40659.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp
index 96fb9f331bc..177b324c5eb 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp
@@ -19,9 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0
-}
+require dwarf2_support
 
 # This test can only be run on x86_64 targets.
 if {![istarget "x86_64-*-*"] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
index de33da9d8d4..aa7807e2427 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
@@ -53,9 +53,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
index 25d77263c0a..537d61dc88d 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
@@ -48,9 +48,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
index fc4b228d5b6..96596d1f5f5 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
@@ -37,9 +37,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp
index e4f6b278aea..f77236a6b40 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp
@@ -26,9 +26,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
index c0675141012..97affa928ef 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S -main.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
index a61f1625499..40f4233b5bc 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
@@ -27,9 +27,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp
index b5e8957f107..65bc1fe23dc 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp
@@ -26,9 +26,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp
index 61fd5d4fed8..e3d7a9c87e3 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp
@@ -20,9 +20,7 @@ load_lib dwarf.exp
 
 # This test can only be run on targets that support DWARF-2 and use
 # gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp b/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp
index c813db6605e..c5e37442fbf 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-intercu.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Minimal DWARF-2 unit test
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set dwarf_srcfile "file1.txt"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp b/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp
index b55409b93c7..e3f5488093f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-intermix.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Intermixed 32-bit and 64-bit DWARF format tests.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set dwarf_srcfile "file1.txt"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp
index 5176bd34b20..f8d3c1f68a6 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp
@@ -26,9 +26,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
index 48dae27fa75..4d269a2d0f4 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
@@ -26,9 +26,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp b/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp
index 8e11fa7ec71..7dc7586bd40 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
index 4af702ecc4a..26d6998d34d 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
@@ -15,10 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp
index 288c5a00176..38133ab6e22 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp
@@ -21,9 +21,7 @@ if { [skip_cplus_tests] } { continue }
 
 load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp b/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp
index 75d85d2a582..0e4432845d9 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp
@@ -19,10 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp
index 3e16e45adcc..7a002d4b412 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 # This testfile has reproducibility only with cc-with-index.sh.
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp b/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp
index 3d2890a56b2..1d52595fbbc 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-missing-cu-tag.exp
@@ -21,9 +21,7 @@ load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use
 # gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.exp
index c4e83e68ad5..3a04505b687 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp b/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp
index 2cd11a00cee..e67de6e1134 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp b/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
index f9de2cffd20..26dd18d326a 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 if { [prepare_for_testing "failed to prepare" "dw2-noloc" {dw2-noloc-main.c dw2-noloc.S} {nodebug}] } {
     return -1
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp
index 2257dd22819..c58b2346964 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-call.exp b/gdb/testsuite/gdb.dwarf2/dw2-op-call.exp
index 128b0fc2e54..04d12a4da32 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-op-call.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-op-call.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Test DW_OP_call2 and DW_OP_call4, PR gdb/10640.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0   
-}
+require dwarf2_support
 
 standard_testfile .S main.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-out-param.exp b/gdb/testsuite/gdb.dwarf2/dw2-op-out-param.exp
index 3879c73552a..76ee7fbd370 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-op-out-param.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-op-out-param.exp
@@ -18,9 +18,7 @@ load_lib dwarf.exp
 set test "dw2-op-out-param"
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0
-}
+require dwarf2_support
 
 # This test can only be run on x86-64 targets.
 if {![istarget x86_64-*] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp
index 9a3d0d6e1ab..b3d7d857d38 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0   
-}
+require dwarf2_support
 
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags_asm]
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
index 8f1a6fcb346..31afb3317f6 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
@@ -24,9 +24,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp b/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
index 170500b6045..d03f6716d18 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
@@ -19,10 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp b/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp
index da264c9916e..e7682cf27a6 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S -main.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-producer.exp b/gdb/testsuite/gdb.dwarf2/dw2-producer.exp
index b074e23990d..5bc19d77606 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-producer.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-producer.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set dwarf_srcfile "file1.txt"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp b/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp
index 9ce97fc1f26..bea039686be 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp
@@ -19,9 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
index 78962d56290..dec7d6a9b37 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
@@ -18,10 +18,7 @@ load_lib dwarf.exp
 # DW_AT_high_pc but with DW_AT_ranges instead.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp
index 11f19f141a1..07ac5a9e52d 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp
@@ -17,10 +17,7 @@ load_lib dwarf.exp
 # Test DW_AT_ranges in the context of a subprogram scope.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    unsupported "dwarf2 support required for this test"
-    return 0
-}
+require dwarf2_support
 
 if ![is_c_compiler_gcc] {
     unsupported "gcc required for this test"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp
index 830258d3154..b528c3d73ce 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp
@@ -22,10 +22,7 @@ load_lib dwarf.exp
 # instead.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym-warning.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym-warning.exp
index 101a58e1394..d82f95c2785 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym-warning.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym-warning.exp
@@ -18,10 +18,7 @@ load_lib dwarf.exp
 # Check psymtabs addrmaps generated from DW_AT_ranges of functions.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    unsupported "dwarf2 support required for this test"
-    return 0
-}
+require dwarf2_support
 
 standard_testfile -main.c .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
index 824d7ba8085..770d2977a43 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
@@ -18,10 +18,7 @@ load_lib dwarf.exp
 # Test that psymbols are made when DW_AT_ranges is used.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    unsupported "dwarf2 support required for this test"
-    return 0
-}
+require dwarf2_support
 
 if ![is_c_compiler_gcc] {
     unsupported "gcc required for this test"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
index b7b3223b587..d80d604edff 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
@@ -18,10 +18,7 @@ load_lib dwarf.exp
 # DW_AT_high_pc but with DW_AT_ranges instead.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    verbose "Skipping $gdb_test_file_name."
-    return 0  
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
index e8448812e5b..f90defd480a 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S -func.c -main.c
 lassign [function_range func_nofb \
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp b/gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp
index 5f1fbe728cf..470015f6bbb 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # This test can only be run on x86_64 targets.
 if {![istarget "x86_64-*-*"] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.exp b/gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.exp
index 3b4e07a8e78..448b1e447f0 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-regno-invalid.exp
@@ -18,9 +18,7 @@ load_lib dwarf.exp
 # in DWARF.  clang-3.5.0-9.fc22.x86_64 produced it inside DW_AT_location.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-restrict.exp b/gdb/testsuite/gdb.dwarf2/dw2-restrict.exp
index fd524d3f95d..974eb05f57b 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-restrict.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-restrict.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # This test can only be run on x86-64 targets.
 if {![istarget x86_64-*] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp b/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp
index 86304b45c5a..7e77708eafa 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-single-line-discriminators.exp b/gdb/testsuite/gdb.dwarf2/dw2-single-line-discriminators.exp
index 5824d8b3426..f0846e7bd01 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-single-line-discriminators.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-single-line-discriminators.exp
@@ -19,9 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0  
-}
+require dwarf2_support
 
 # This test can only be run on x86-64 targets.
 if {![istarget x86_64-*] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp
index b8ff89eb4c2..d9a4014148e 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp
@@ -32,9 +32,7 @@ load_lib dwarf.exp
 # end of main                                         func_end
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp
index e10f37ad665..a05c02664de 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp b/gdb/testsuite/gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp
index b2d5763c539..cf9c77741a2 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp
@@ -28,10 +28,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-strp.exp b/gdb/testsuite/gdb.dwarf2/dw2-strp.exp
index c89d71eb7d8..bd8c6781e49 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-strp.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-strp.exp
@@ -18,9 +18,7 @@ load_lib dwarf.exp
 # are unreferenced in code, and whose contents appear in .debug_str.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes.exp b/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes.exp
index 6c6d5fe46b4..99dd4ec8073 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-symtab-includes.exp
@@ -19,9 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp b/gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp
index 014797e108b..74105ce76d6 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 standard_testfile .S
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0
-}
+require dwarf2_support
 
 # This test can only be run on x86-64 targets.
 if {![istarget x86_64-*] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp
index 535f212e7f8..9ba8c45ae63 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags_asm]
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp
index 20c31dc5740..cc945fdb8b3 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -foo.c dwz.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp b/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp
index 6c716308d8e..ccc0757ba46 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp
@@ -30,9 +30,7 @@ load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use
 # gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c .S
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp
index 4d1c49044d5..385bacf0035 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-using-debug-str.exp
@@ -20,9 +20,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.exp b/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.exp
index 7eb985262a4..ba72d8e234f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S main.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
index 24299d45459..035d4902ab4 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
@@ -15,10 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require dwarf2_support
 
 # The .c files use __attribute__.
 if ![is_c_compiler_gcc] {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-weird-type-len.exp b/gdb/testsuite/gdb.dwarf2/dw2-weird-type-len.exp
index 11a36583c7d..291396b9c97 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-weird-type-len.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-weird-type-len.exp
@@ -23,9 +23,7 @@ if {![istarget x86_64-*] || ![is_lp64_target]} {
 }
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp b/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp
index 97c1ed83278..5248da6e491 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp
@@ -19,10 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require dwarf2_support
 
 if {[skip_shlib_tests]} {
     return 0
diff --git a/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.exp b/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.exp
index 979e78464f2..25334c55f54 100644
--- a/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.dwarf2/dwz.exp b/gdb/testsuite/gdb.dwarf2/dwz.exp
index 578a1f549b2..6d171bc71d8 100644
--- a/gdb/testsuite/gdb.dwarf2/dwz.exp
+++ b/gdb/testsuite/gdb.dwarf2/dwz.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c dwz.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp
index c4faea649d2..9177a87d264 100644
--- a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp
+++ b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # No remote host testing either.
 if {[is_remote host]} {
diff --git a/gdb/testsuite/gdb.dwarf2/dwznolink.exp b/gdb/testsuite/gdb.dwarf2/dwznolink.exp
index fe3e1e6835a..3ff7fd07458 100644
--- a/gdb/testsuite/gdb.dwarf2/dwznolink.exp
+++ b/gdb/testsuite/gdb.dwarf2/dwznolink.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # No remote host testing either.
 if {[is_remote host]} {
diff --git a/gdb/testsuite/gdb.dwarf2/dyn-type-unallocated.exp b/gdb/testsuite/gdb.dwarf2/dyn-type-unallocated.exp
index 3192ea7820c..8ad8b63d5de 100644
--- a/gdb/testsuite/gdb.dwarf2/dyn-type-unallocated.exp
+++ b/gdb/testsuite/gdb.dwarf2/dyn-type-unallocated.exp
@@ -34,9 +34,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp b/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp
index 83a5fccd831..e5c3a93f74d 100644
--- a/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
index 69ac417f38c..588d28902ec 100644
--- a/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
+++ b/gdb/testsuite/gdb.dwarf2/enqueued-cu-base-addr.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-};
+require dwarf2_support;
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/enum-type.exp b/gdb/testsuite/gdb.dwarf2/enum-type.exp
index 983b415bfdb..b7705c84c33 100644
--- a/gdb/testsuite/gdb.dwarf2/enum-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/enum-type.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp b/gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp
index 53150237408..6ba587b612f 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp
@@ -21,9 +21,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/fission-base.exp b/gdb/testsuite/gdb.dwarf2/fission-base.exp
index 1bdfc4c94bb..576f3dbb0ba 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-base.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-base.exp
@@ -21,9 +21,7 @@ if [is_remote host] {
 }
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0  
-}
+require dwarf2_support
 
 # This test can only be run on x86-64 targets.
 if {![istarget x86_64-*] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp b/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp
index f21f9bbcd36..08d230da443 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp
@@ -26,9 +26,7 @@ if [is_remote host] {
 }
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0  
-}
+require dwarf2_support
 
 # This test can only be run on x86-64 targets.
 if {![istarget x86_64-*] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/fission-loclists.exp b/gdb/testsuite/gdb.dwarf2/fission-loclists.exp
index 1df0fa7714f..9c953139fcf 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-loclists.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-loclists.exp
@@ -21,9 +21,7 @@ if [is_remote host] {
 }
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0  
-}
+require dwarf2_support
 
 # This test can only be run on x86-64 targets.
 if {![istarget x86_64-*] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/fission-mix.exp b/gdb/testsuite/gdb.dwarf2/fission-mix.exp
index 99887075c03..f7327e8329a 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-mix.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-mix.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2.
-if ![dwarf2_support] {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .c -2.c
 set objfile [standard_output_file ${testfile}.o]
diff --git a/gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp b/gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp
index 62bffdf709d..577840334d7 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp
@@ -24,9 +24,7 @@ if [is_remote host] {
 }
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0
-}
+require dwarf2_support
 
 # We place the entire source code for the test into a single .c file,
 # but we generate the DWARF in two separate .S files.  Each .S is
diff --git a/gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp b/gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp
index 3b548c4e8b5..bee99956078 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-relative-dwo.exp
@@ -19,9 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/fission-reread.exp b/gdb/testsuite/gdb.dwarf2/fission-reread.exp
index 4d6d9ed20a6..ab7253fa8ac 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-reread.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-reread.exp
@@ -21,9 +21,7 @@ if [is_remote host] {
 }
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0  
-}
+require dwarf2_support
 
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags_asm]
diff --git a/gdb/testsuite/gdb.dwarf2/formdata16.exp b/gdb/testsuite/gdb.dwarf2/formdata16.exp
index 9ef9a6ee3f1..be4aaa7423d 100644
--- a/gdb/testsuite/gdb.dwarf2/formdata16.exp
+++ b/gdb/testsuite/gdb.dwarf2/formdata16.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/fortran-var-string.exp b/gdb/testsuite/gdb.dwarf2/fortran-var-string.exp
index 793c4418fd6..9f92358511f 100644
--- a/gdb/testsuite/gdb.dwarf2/fortran-var-string.exp
+++ b/gdb/testsuite/gdb.dwarf2/fortran-var-string.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
index cb208c430db..ee657d74ec4 100644
--- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
+++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
@@ -30,9 +30,7 @@ require !use_gdb_stub
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
index 9050482ad3e..eab5ae5ccbd 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
index 013eca7c50b..540cb5bc35e 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-index.exp
index 5badcaccb1b..31105c1f93f 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-index.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-index.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp b/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp
index 74bd017a1f3..f5fc1c0b972 100644
--- a/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp
+++ b/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile main.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp
index 881af105a50..fd3712b0574 100644
--- a/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp
+++ b/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile main.c .S
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.dwarf2/implptr.exp b/gdb/testsuite/gdb.dwarf2/implptr.exp
index db3b1e50620..a40c6be5e1d 100644
--- a/gdb/testsuite/gdb.dwarf2/implptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/implptr.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Test DW_OP_GNU_implicit_pointer.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set csrcfile ${testfile}.c
diff --git a/gdb/testsuite/gdb.dwarf2/implptrconst.exp b/gdb/testsuite/gdb.dwarf2/implptrconst.exp
index 8a725d81354..3c1cc7c4371 100644
--- a/gdb/testsuite/gdb.dwarf2/implptrconst.exp
+++ b/gdb/testsuite/gdb.dwarf2/implptrconst.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 if { [skip_cplus_tests] } { continue }
 
diff --git a/gdb/testsuite/gdb.dwarf2/implptrpiece.exp b/gdb/testsuite/gdb.dwarf2/implptrpiece.exp
index e184cb3212c..8441f3fbb96 100644
--- a/gdb/testsuite/gdb.dwarf2/implptrpiece.exp
+++ b/gdb/testsuite/gdb.dwarf2/implptrpiece.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 if { [skip_cplus_tests] } { continue }
 
diff --git a/gdb/testsuite/gdb.dwarf2/implref-array.exp b/gdb/testsuite/gdb.dwarf2/implref-array.exp
index d9ddf602bb7..e149b7caeb7 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-array.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-array.exp
@@ -23,9 +23,7 @@ if [skip_cplus_tests] {
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0
-}
+require dwarf2_support
 
 # We'll place the output of Dwarf::assemble in implref-array.S.
 standard_testfile .c .S
diff --git a/gdb/testsuite/gdb.dwarf2/implref-const.exp b/gdb/testsuite/gdb.dwarf2/implref-const.exp
index c25fc7e9bf3..8e2483bf542 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-const.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-const.exp
@@ -23,9 +23,7 @@ if [skip_cplus_tests] {
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0
-}
+require dwarf2_support
 
 # We'll place the output of Dwarf::assemble in implref-const.S.
 standard_testfile main.c .S
diff --git a/gdb/testsuite/gdb.dwarf2/implref-global.exp b/gdb/testsuite/gdb.dwarf2/implref-global.exp
index b4f3035cc36..9dd2bd343a0 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-global.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-global.exp
@@ -23,9 +23,7 @@ if [skip_cplus_tests] {
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0
-}
+require dwarf2_support
 
 # We'll place the output of Dwarf::assemble in implref-global.S.
 standard_testfile .c .S
diff --git a/gdb/testsuite/gdb.dwarf2/implref-struct.exp b/gdb/testsuite/gdb.dwarf2/implref-struct.exp
index 10358df68b7..2e4456a902c 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-struct.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-struct.exp
@@ -23,9 +23,7 @@ if [skip_cplus_tests] {
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0
-}
+require dwarf2_support
 
 # We'll place the output of Dwarf::assemble in implref-struct.S.
 standard_testfile .c .S
diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-abstract-const-value.exp b/gdb/testsuite/gdb.dwarf2/imported-unit-abstract-const-value.exp
index e0b0baf36c4..fe25330573d 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit-abstract-const-value.exp
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit-abstract-const-value.exp
@@ -19,9 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-};
+require dwarf2_support;
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-c.exp b/gdb/testsuite/gdb.dwarf2/imported-unit-c.exp
index 14047ab8eb9..83e4fc0643e 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit-c.exp
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit-c.exp
@@ -1,9 +1,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-};
+require dwarf2_support;
 
 standard_testfile main-foo.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
index 02450aac074..57f63b75cdb 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-};
+require dwarf2_support;
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit.exp b/gdb/testsuite/gdb.dwarf2/imported-unit.exp
index ecaa0e13af8..7c81c2a0a4e 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit.exp
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit.exp
@@ -29,9 +29,7 @@ if [skip_cplus_tests] {
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-};
+require dwarf2_support;
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
index b41b10410c5..cdb69fc2079 100644
--- a/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
+++ b/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/inlined_subroutine-inheritance.exp b/gdb/testsuite/gdb.dwarf2/inlined_subroutine-inheritance.exp
index d92a90840ae..2193eb9b7d9 100644
--- a/gdb/testsuite/gdb.dwarf2/inlined_subroutine-inheritance.exp
+++ b/gdb/testsuite/gdb.dwarf2/inlined_subroutine-inheritance.exp
@@ -21,9 +21,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/intbits.exp b/gdb/testsuite/gdb.dwarf2/intbits.exp
index 19752d333dc..790062e58a3 100644
--- a/gdb/testsuite/gdb.dwarf2/intbits.exp
+++ b/gdb/testsuite/gdb.dwarf2/intbits.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp b/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp
index 89605cb5f00..48d304a39d7 100644
--- a/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp
+++ b/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp
@@ -18,9 +18,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # Test with 32-bit and 64-bit DWARF.
 foreach_with_prefix is_64 {false true} {
diff --git a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
index 368f63c1a63..270a03b7568 100644
--- a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
+++ b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
@@ -56,9 +56,7 @@ if [skip_shlib_tests] {
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0
-}
+require dwarf2_support
 
 # gdb_test_file_name is the name of this file without the .exp
 # extension.  Use it to form basenames for the main program
diff --git a/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp b/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp
index 00bdeaf0ef4..f08d4ad036d 100644
--- a/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp
+++ b/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp
@@ -26,9 +26,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # Test with 32-bit and 64-bit DWARF.
 foreach_with_prefix is_64 {false true} {
diff --git a/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp b/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp
index f48eaa10863..7cacf7c5eea 100644
--- a/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp
+++ b/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp
@@ -18,9 +18,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # Test with 32-bit and 64-bit DWARF.
 foreach_with_prefix is_64 {false true} {
diff --git a/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp b/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp
index 5af79e4ec1e..574ab43c7fb 100644
--- a/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp
+++ b/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp
@@ -17,9 +17,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # Test with 32-bit and 64-bit DWARF.
 foreach_with_prefix is_64 {false true} {
diff --git a/gdb/testsuite/gdb.dwarf2/mac-fileno.exp b/gdb/testsuite/gdb.dwarf2/mac-fileno.exp
index 9f75fd9c90c..5bae5f99cee 100644
--- a/gdb/testsuite/gdb.dwarf2/mac-fileno.exp
+++ b/gdb/testsuite/gdb.dwarf2/mac-fileno.exp
@@ -18,9 +18,7 @@ load_lib dwarf.exp
 # bogus file numbers.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 set dwarf_srcfile "file1.txt"
diff --git a/gdb/testsuite/gdb.dwarf2/macro-source-path.exp b/gdb/testsuite/gdb.dwarf2/macro-source-path.exp
index 8743eddd612..cba5fc4768a 100644
--- a/gdb/testsuite/gdb.dwarf2/macro-source-path.exp
+++ b/gdb/testsuite/gdb.dwarf2/macro-source-path.exp
@@ -20,9 +20,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
index 14adf66fba9..ad714d2f29b 100644
--- a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
+++ b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-4 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 if { [use_gdb_stub] } {
     unsupported "test requires running"
diff --git a/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp b/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp
index f7cbd71a4b6..5f6b1c81c96 100644
--- a/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp
+++ b/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 if { [skip_cplus_tests] } { continue }
 
diff --git a/gdb/testsuite/gdb.dwarf2/method-ptr.exp b/gdb/testsuite/gdb.dwarf2/method-ptr.exp
index 2577791b70d..3998b61aa68 100644
--- a/gdb/testsuite/gdb.dwarf2/method-ptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/method-ptr.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 if { [skip_cplus_tests] } { continue }
 
diff --git a/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp b/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp
index 34c653f4fec..e4cefd061b8 100644
--- a/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 if { [skip_cplus_tests] } { continue }
 
diff --git a/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp b/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp
index 14339c86ded..29b8cfa5021 100644
--- a/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp
+++ b/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp
@@ -21,9 +21,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .cc .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/missing-type-name.exp b/gdb/testsuite/gdb.dwarf2/missing-type-name.exp
index 6fff1e0667b..b8e94b17558 100644
--- a/gdb/testsuite/gdb.dwarf2/missing-type-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/missing-type-name.exp
@@ -33,9 +33,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile void-type.c void-type.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/multidictionary.exp b/gdb/testsuite/gdb.dwarf2/multidictionary.exp
index df7dcb9266a..0d5ebfdfbbb 100644
--- a/gdb/testsuite/gdb.dwarf2/multidictionary.exp
+++ b/gdb/testsuite/gdb.dwarf2/multidictionary.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/negative-data-member-location.exp b/gdb/testsuite/gdb.dwarf2/negative-data-member-location.exp
index 57030d77134..65080174b60 100644
--- a/gdb/testsuite/gdb.dwarf2/negative-data-member-location.exp
+++ b/gdb/testsuite/gdb.dwarf2/negative-data-member-location.exp
@@ -22,9 +22,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if { ![dwarf2_support] } {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp b/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp
index 73f7233192e..bf754e166f7 100644
--- a/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp
+++ b/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # No remote host testing either.
 if {[is_remote host]} {
diff --git a/gdb/testsuite/gdb.dwarf2/nonvar-access.exp b/gdb/testsuite/gdb.dwarf2/nonvar-access.exp
index 714d33155e3..08e63032e42 100644
--- a/gdb/testsuite/gdb.dwarf2/nonvar-access.exp
+++ b/gdb/testsuite/gdb.dwarf2/nonvar-access.exp
@@ -19,7 +19,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} { return 0 }
+require dwarf2_support
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/nostaticblock.exp b/gdb/testsuite/gdb.dwarf2/nostaticblock.exp
index 49aa78b6c75..36f82191ca3 100644
--- a/gdb/testsuite/gdb.dwarf2/nostaticblock.exp
+++ b/gdb/testsuite/gdb.dwarf2/nostaticblock.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 if { [skip_cplus_tests] } { continue }
 
diff --git a/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp b/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp
index c5601df8e46..c66977996c4 100644
--- a/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp
+++ b/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -1.S -2.c
 
diff --git a/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp
index 5066bae736a..2f3514e6882 100644
--- a/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp
+++ b/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp
@@ -16,9 +16,7 @@ load_lib dwarf.exp
 # Test some DWARF piece operators.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 # This test can only be run on x86 targets.
 if {![is_x86_like_target]} {
     return 0  
diff --git a/gdb/testsuite/gdb.dwarf2/pieces.exp b/gdb/testsuite/gdb.dwarf2/pieces.exp
index 118c00c7ecb..e464a4fb6f4 100644
--- a/gdb/testsuite/gdb.dwarf2/pieces.exp
+++ b/gdb/testsuite/gdb.dwarf2/pieces.exp
@@ -16,9 +16,7 @@ load_lib dwarf.exp
 # Test some DWARF piece operators.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 # This test can only be run on x86 targets.
 if {![is_x86_like_target]} {
     return 0  
diff --git a/gdb/testsuite/gdb.dwarf2/pr11465.exp b/gdb/testsuite/gdb.dwarf2/pr11465.exp
index 7aca65f6eeb..bc28bf30d64 100644
--- a/gdb/testsuite/gdb.dwarf2/pr11465.exp
+++ b/gdb/testsuite/gdb.dwarf2/pr11465.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/pr13961.exp b/gdb/testsuite/gdb.dwarf2/pr13961.exp
index 2c92c87642d..1f6808a3f4f 100644
--- a/gdb/testsuite/gdb.dwarf2/pr13961.exp
+++ b/gdb/testsuite/gdb.dwarf2/pr13961.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags_asm]
diff --git a/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp b/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp
index 0625eb93b1f..8e61efd706c 100644
--- a/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp
+++ b/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp
@@ -26,9 +26,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # Test with 32-bit and 64-bit DWARF.
 foreach_with_prefix is_64 {false true} {
diff --git a/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp b/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp
index 33552823847..9efafcd6769 100644
--- a/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp
+++ b/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp
@@ -18,9 +18,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 foreach_with_prefix is_64 {false true} {
     if { $is_64 } {
diff --git a/gdb/testsuite/gdb.dwarf2/shortpiece.exp b/gdb/testsuite/gdb.dwarf2/shortpiece.exp
index f5a933e521b..27dd24fffec 100644
--- a/gdb/testsuite/gdb.dwarf2/shortpiece.exp
+++ b/gdb/testsuite/gdb.dwarf2/shortpiece.exp
@@ -16,9 +16,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/staticvirtual.exp b/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
index 01b43bc93f1..02723cb574d 100644
--- a/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
+++ b/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 if { [skip_cplus_tests] } { continue }
 
diff --git a/gdb/testsuite/gdb.dwarf2/struct-decl.exp b/gdb/testsuite/gdb.dwarf2/struct-decl.exp
index 739eaaabb2b..09c4e9ac10e 100644
--- a/gdb/testsuite/gdb.dwarf2/struct-decl.exp
+++ b/gdb/testsuite/gdb.dwarf2/struct-decl.exp
@@ -19,9 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -debug.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/struct-with-sig.exp b/gdb/testsuite/gdb.dwarf2/struct-with-sig.exp
index 66021b70fb2..34be5e60d96 100644
--- a/gdb/testsuite/gdb.dwarf2/struct-with-sig.exp
+++ b/gdb/testsuite/gdb.dwarf2/struct-with-sig.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main-foo.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/subrange-enum.exp b/gdb/testsuite/gdb.dwarf2/subrange-enum.exp
index b9f7cb68233..d835fb9a791 100644
--- a/gdb/testsuite/gdb.dwarf2/subrange-enum.exp
+++ b/gdb/testsuite/gdb.dwarf2/subrange-enum.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/subrange.exp b/gdb/testsuite/gdb.dwarf2/subrange.exp
index bf3b3f711fe..6b6e047ef01 100644
--- a/gdb/testsuite/gdb.dwarf2/subrange.exp
+++ b/gdb/testsuite/gdb.dwarf2/subrange.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 if { [skip_cplus_tests] } { continue }
 
diff --git a/gdb/testsuite/gdb.dwarf2/symbol_needs_eval_fail.exp b/gdb/testsuite/gdb.dwarf2/symbol_needs_eval_fail.exp
index 427cc5ebc76..3c1da88c5f9 100644
--- a/gdb/testsuite/gdb.dwarf2/symbol_needs_eval_fail.exp
+++ b/gdb/testsuite/gdb.dwarf2/symbol_needs_eval_fail.exp
@@ -23,9 +23,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # Choose suitable integer registers for the test.
 
diff --git a/gdb/testsuite/gdb.dwarf2/symbol_needs_eval_timeout.exp b/gdb/testsuite/gdb.dwarf2/symbol_needs_eval_timeout.exp
index 312865ad8f7..adf56d46f35 100644
--- a/gdb/testsuite/gdb.dwarf2/symbol_needs_eval_timeout.exp
+++ b/gdb/testsuite/gdb.dwarf2/symbol_needs_eval_timeout.exp
@@ -23,9 +23,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # Choose suitable integer registers for the test.
 
diff --git a/gdb/testsuite/gdb.dwarf2/symtab-producer.exp b/gdb/testsuite/gdb.dwarf2/symtab-producer.exp
index b37bafaba07..bff53ddfc24 100644
--- a/gdb/testsuite/gdb.dwarf2/symtab-producer.exp
+++ b/gdb/testsuite/gdb.dwarf2/symtab-producer.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 load_lib gdb-python.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # This test can also only be run when we have python support in gdb,
 # but that test can only be done after gdb has started, below.
diff --git a/gdb/testsuite/gdb.dwarf2/template-specification-full-name.exp b/gdb/testsuite/gdb.dwarf2/template-specification-full-name.exp
index e99d4d03166..a2a1dc6d856 100644
--- a/gdb/testsuite/gdb.dwarf2/template-specification-full-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/template-specification-full-name.exp
@@ -22,9 +22,7 @@
 
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/trace-crash.exp b/gdb/testsuite/gdb.dwarf2/trace-crash.exp
index 33a0517c22f..83d690fed0d 100644
--- a/gdb/testsuite/gdb.dwarf2/trace-crash.exp
+++ b/gdb/testsuite/gdb.dwarf2/trace-crash.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 load_lib trace-support.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 
 # This test can only be run on x86-64 targets.
 if {![istarget x86_64-*] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.dwarf2/typeddwarf.exp b/gdb/testsuite/gdb.dwarf2/typeddwarf.exp
index 5abd575bc5b..06b8a4e2dc1 100644
--- a/gdb/testsuite/gdb.dwarf2/typeddwarf.exp
+++ b/gdb/testsuite/gdb.dwarf2/typeddwarf.exp
@@ -18,9 +18,7 @@ load_lib dwarf.exp
 set test "typeddwarf"
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0  
-}
+require dwarf2_support
 
 # This test can only be run on x86 and amd64 targets (and not x32).
 if { [is_x86_like_target] } {
diff --git a/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp b/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp
index ade9e5d0a75..86871ce6267 100644
--- a/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp
+++ b/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp
@@ -20,9 +20,7 @@ load_lib dwarf.exp
 load_lib gdb-python.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile void-type.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/utf-rust.exp b/gdb/testsuite/gdb.dwarf2/utf-rust.exp
index 93b58693060..8a3e5f0e4aa 100644
--- a/gdb/testsuite/gdb.dwarf2/utf-rust.exp
+++ b/gdb/testsuite/gdb.dwarf2/utf-rust.exp
@@ -19,9 +19,7 @@ load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use
 # gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/valop.exp b/gdb/testsuite/gdb.dwarf2/valop.exp
index 4853d59ae41..9e6eccdbdd4 100644
--- a/gdb/testsuite/gdb.dwarf2/valop.exp
+++ b/gdb/testsuite/gdb.dwarf2/valop.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 # Test DW_OP_stack_value and DW_OP_implicit_value.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0  
-}
+require dwarf2_support
 # This test can only be run on x86 targets.
 if {![is_x86_like_target]} {
     return 0  
diff --git a/gdb/testsuite/gdb.dwarf2/var-access.exp b/gdb/testsuite/gdb.dwarf2/var-access.exp
index 4b8a2d779c2..5eb8f5aa6a3 100644
--- a/gdb/testsuite/gdb.dwarf2/var-access.exp
+++ b/gdb/testsuite/gdb.dwarf2/var-access.exp
@@ -20,9 +20,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # Choose suitable integer registers for the test.
 
diff --git a/gdb/testsuite/gdb.dwarf2/variant.exp b/gdb/testsuite/gdb.dwarf2/variant.exp
index e6221c8f499..b36c8133588 100644
--- a/gdb/testsuite/gdb.dwarf2/variant.exp
+++ b/gdb/testsuite/gdb.dwarf2/variant.exp
@@ -19,9 +19,7 @@ load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use
 # gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/varval.exp b/gdb/testsuite/gdb.dwarf2/varval.exp
index cb02bc34537..ad84a4454ac 100644
--- a/gdb/testsuite/gdb.dwarf2/varval.exp
+++ b/gdb/testsuite/gdb.dwarf2/varval.exp
@@ -18,9 +18,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0
-}
+require dwarf2_support
 
 # We'll place the output of Dwarf::assemble in varval.S.
 standard_testfile .c .S
diff --git a/gdb/testsuite/gdb.dwarf2/void-type.exp b/gdb/testsuite/gdb.dwarf2/void-type.exp
index cafed8cdd5a..ebe3a61f437 100644
--- a/gdb/testsuite/gdb.dwarf2/void-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/void-type.exp
@@ -27,9 +27,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/watch-notconst.exp b/gdb/testsuite/gdb.dwarf2/watch-notconst.exp
index 498648bd768..c4768324653 100644
--- a/gdb/testsuite/gdb.dwarf2/watch-notconst.exp
+++ b/gdb/testsuite/gdb.dwarf2/watch-notconst.exp
@@ -17,9 +17,7 @@ load_lib dwarf.exp
 set test "watch-notconst"
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if ![dwarf2_support] {
-    return 0  
-}
+require dwarf2_support
 
 # This test can only be run on x86 targets.
 if { ![is_x86_like_target] } {
diff --git a/gdb/testsuite/gdb.linespec/break-asm-file.exp b/gdb/testsuite/gdb.linespec/break-asm-file.exp
index 6660c9ef336..07515ec4d4f 100644
--- a/gdb/testsuite/gdb.linespec/break-asm-file.exp
+++ b/gdb/testsuite/gdb.linespec/break-asm-file.exp
@@ -24,9 +24,7 @@ set asm_file1 break-asm-file1.s
 set asm_file0 break-asm-file0.s
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
 	  object {debug nowarnings optimize=-O0}] != ""} {
diff --git a/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp b/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp
index 6c7f12d152f..4089a993764 100644
--- a/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp
+++ b/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp
@@ -18,9 +18,7 @@ load_lib dwarf.exp
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .S dw2-ref-missing-frame-func.c dw2-ref-missing-frame-main.c
 set objsfile [standard_output_file ${testfile}.o]
diff --git a/gdb/testsuite/gdb.mi/mi-reg-undefined.exp b/gdb/testsuite/gdb.mi/mi-reg-undefined.exp
index 59f3effc1b7..e610c358954 100644
--- a/gdb/testsuite/gdb.mi/mi-reg-undefined.exp
+++ b/gdb/testsuite/gdb.mi/mi-reg-undefined.exp
@@ -17,9 +17,7 @@ load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 # This test can only be run on x86_64 targets.
 if {![istarget "x86_64-*-*"] || ![is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb.trace/entry-values.exp
index 07f87aa5885..beff2dfe4c9 100644
--- a/gdb/testsuite/gdb.trace/entry-values.exp
+++ b/gdb/testsuite/gdb.trace/entry-values.exp
@@ -15,9 +15,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c entry-values-dw.S
 
diff --git a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
index d73b9f1e33f..c4c6f3373e8 100644
--- a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
+++ b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
@@ -16,9 +16,7 @@
 load_lib "trace-support.exp"
 load_lib dwarf.exp
 
-if {![dwarf2_support]} {
-    return 0
-}
+require dwarf2_support
 
 standard_testfile .c -dbg.S
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 07/46] Use require is_x86_like_target
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (5 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 06/46] Use require dwarf2_support Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 08/46] Use require skip_cplus_tests Tom Tromey
                   ` (40 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require is_x86_like_target".
---
 gdb/testsuite/gdb.arch/i386-cfi-notcurrent.exp     | 4 +---
 gdb/testsuite/gdb.arch/i386-disp-step.exp          | 5 +----
 gdb/testsuite/gdb.arch/i386-gnu-cfi.exp            | 5 +----
 gdb/testsuite/gdb.arch/i386-prologue.exp           | 5 +----
 gdb/testsuite/gdb.arch/i386-size-overlap.exp       | 5 +----
 gdb/testsuite/gdb.arch/i386-size.exp               | 5 +----
 gdb/testsuite/gdb.arch/i386-sse-stack-align.exp    | 5 +----
 gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.exp | 5 +----
 gdb/testsuite/gdb.arch/i386-unwind.exp             | 5 +----
 gdb/testsuite/gdb.dwarf2/callframecfa.exp          | 5 +----
 gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp  | 5 +----
 gdb/testsuite/gdb.dwarf2/pieces.exp                | 5 +----
 gdb/testsuite/gdb.dwarf2/valop.exp                 | 5 +----
 gdb/testsuite/gdb.dwarf2/watch-notconst.exp        | 6 +-----
 gdb/testsuite/gdb.reverse/i386-precsave.exp        | 8 +-------
 gdb/testsuite/gdb.reverse/i386-reverse.exp         | 7 +------
 gdb/testsuite/gdb.reverse/i387-env-reverse.exp     | 5 +----
 gdb/testsuite/gdb.reverse/i387-stack-reverse.exp   | 5 +----
 18 files changed, 18 insertions(+), 77 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.exp b/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.exp
index 07196be4692..f12cbf90ed6 100644
--- a/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.exp
+++ b/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.exp
@@ -16,9 +16,7 @@
 # [RFA] DWARF frame unwinder executes one too many rows
 # http://sourceware.org/ml/gdb-patches/2012-07/msg00650.html
 
-if { ![is_x86_like_target] } {
-    return 0
-}
+require is_x86_like_target
 
 set testfile "i386-cfi-notcurrent"
 set srcfile ${testfile}.S
diff --git a/gdb/testsuite/gdb.arch/i386-disp-step.exp b/gdb/testsuite/gdb.arch/i386-disp-step.exp
index dba61a67736..ddd945572af 100644
--- a/gdb/testsuite/gdb.arch/i386-disp-step.exp
+++ b/gdb/testsuite/gdb.arch/i386-disp-step.exp
@@ -18,10 +18,7 @@
 # Test i386 displaced stepping.
 
 
-if {![is_x86_like_target]} {
-    verbose "Skipping x86 displaced stepping tests."
-    return
-}
+require is_x86_like_target
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp b/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
index 04f80acf44a..eef34f8826e 100644
--- a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
+++ b/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
@@ -23,10 +23,7 @@
 # Test i386 unwinder.
 
 
-if {![is_x86_like_target]} {
-    verbose "Skipping i386 unwinder tests."
-    return
-}
+require is_x86_like_target
 
 set testfile "i386-gnu-cfi"
 set srcfilec ${testfile}.c
diff --git a/gdb/testsuite/gdb.arch/i386-prologue.exp b/gdb/testsuite/gdb.arch/i386-prologue.exp
index 1988e0b7b85..920edfd51f0 100644
--- a/gdb/testsuite/gdb.arch/i386-prologue.exp
+++ b/gdb/testsuite/gdb.arch/i386-prologue.exp
@@ -21,10 +21,7 @@
 # Test i386 prologue analyzer.
 
 
-if {![is_x86_like_target]} {
-    verbose "Skipping i386 prologue tests."
-    return
-}
+require is_x86_like_target
 
 set testfile "i386-prologue"
 set srcfile ${testfile}.c
diff --git a/gdb/testsuite/gdb.arch/i386-size-overlap.exp b/gdb/testsuite/gdb.arch/i386-size-overlap.exp
index ecdbb0a8e11..ff290aeb5be 100644
--- a/gdb/testsuite/gdb.arch/i386-size-overlap.exp
+++ b/gdb/testsuite/gdb.arch/i386-size-overlap.exp
@@ -17,10 +17,7 @@
 
 # Test that GDB can handle overlapping sizes of symbols.
 
-if {![is_x86_like_target]} {
-    verbose "Skipping i386 unwinder tests."
-    return
-}
+require is_x86_like_target
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.arch/i386-size.exp b/gdb/testsuite/gdb.arch/i386-size.exp
index 19c5552631a..cb0a4ee2e5a 100644
--- a/gdb/testsuite/gdb.arch/i386-size.exp
+++ b/gdb/testsuite/gdb.arch/i386-size.exp
@@ -20,10 +20,7 @@
 
 # Test that GDB can see the sizes of symbols.
 
-if {![is_x86_like_target]} {
-    verbose "Skipping i386 unwinder tests."
-    return
-}
+require is_x86_like_target
 
 set testfile "i386-size"
 set srcfile ${testfile}.c
diff --git a/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp b/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp
index e4699fe511b..146ca786d3c 100644
--- a/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp
+++ b/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if ![is_x86_like_target] {
-    verbose "Skipping x86 SSE stack alignment tests."
-    return
-}
+require is_x86_like_target
 
 set testfile "i386-sse-stack-align"
 set srcfile ${testfile}.S
diff --git a/gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.exp b/gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.exp
index 715303d08b1..ddec3e353ed 100644
--- a/gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.exp
+++ b/gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.exp
@@ -16,10 +16,7 @@
 standard_testfile ".S"
 
 # We can only test this if the target is i686 or x86_64 with -m32
-if { ![is_x86_like_target] } {
-    verbose "Skipping $testfile.exp"
-    return
-}
+require is_x86_like_target
 
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
diff --git a/gdb/testsuite/gdb.arch/i386-unwind.exp b/gdb/testsuite/gdb.arch/i386-unwind.exp
index f9f0307674f..e3d31ba8e49 100644
--- a/gdb/testsuite/gdb.arch/i386-unwind.exp
+++ b/gdb/testsuite/gdb.arch/i386-unwind.exp
@@ -21,10 +21,7 @@
 # Test i386 unwinder.
 
 
-if {![is_x86_like_target]} {
-    verbose "Skipping i386 unwinder tests."
-    return
-}
+require is_x86_like_target
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.dwarf2/callframecfa.exp b/gdb/testsuite/gdb.dwarf2/callframecfa.exp
index bd2d0a75bc7..57f5b8cc589 100644
--- a/gdb/testsuite/gdb.dwarf2/callframecfa.exp
+++ b/gdb/testsuite/gdb.dwarf2/callframecfa.exp
@@ -17,11 +17,8 @@ load_lib dwarf.exp
 # Test DW_OP_call_frame_cfa.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
 # This test can only be run on x86 targets.
-if {![is_x86_like_target]} {
-    return 0  
-}
+require dwarf2_support is_x86_like_target
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp
index 2f3514e6882..6f0c30be7f1 100644
--- a/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp
+++ b/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp
@@ -16,11 +16,8 @@ load_lib dwarf.exp
 # Test some DWARF piece operators.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
 # This test can only be run on x86 targets.
-if {![is_x86_like_target]} {
-    return 0  
-}
+require dwarf2_support is_x86_like_target
 
 standard_testfile .S
 set csrcfile ${testfile}.c
diff --git a/gdb/testsuite/gdb.dwarf2/pieces.exp b/gdb/testsuite/gdb.dwarf2/pieces.exp
index e464a4fb6f4..cb831735f8b 100644
--- a/gdb/testsuite/gdb.dwarf2/pieces.exp
+++ b/gdb/testsuite/gdb.dwarf2/pieces.exp
@@ -16,11 +16,8 @@ load_lib dwarf.exp
 # Test some DWARF piece operators.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
 # This test can only be run on x86 targets.
-if {![is_x86_like_target]} {
-    return 0  
-}
+require dwarf2_support is_x86_like_target
 
 standard_testfile .S
 set csrcfile ${testfile}.c
diff --git a/gdb/testsuite/gdb.dwarf2/valop.exp b/gdb/testsuite/gdb.dwarf2/valop.exp
index 9e6eccdbdd4..fe580df2521 100644
--- a/gdb/testsuite/gdb.dwarf2/valop.exp
+++ b/gdb/testsuite/gdb.dwarf2/valop.exp
@@ -17,11 +17,8 @@ load_lib dwarf.exp
 # Test DW_OP_stack_value and DW_OP_implicit_value.
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
 # This test can only be run on x86 targets.
-if {![is_x86_like_target]} {
-    return 0  
-}
+require dwarf2_support is_x86_like_target
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/watch-notconst.exp b/gdb/testsuite/gdb.dwarf2/watch-notconst.exp
index c4768324653..c93071d58f5 100644
--- a/gdb/testsuite/gdb.dwarf2/watch-notconst.exp
+++ b/gdb/testsuite/gdb.dwarf2/watch-notconst.exp
@@ -17,12 +17,8 @@ load_lib dwarf.exp
 set test "watch-notconst"
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
 # This test can only be run on x86 targets.
-if { ![is_x86_like_target] } {
-    return 0
-}
+require dwarf2_support is_x86_like_target
 
 if { [prepare_for_testing "failed to prepare" "${test}" \
       {watch-notconst.c watch-notconst2.S} {nodebug}] } {
diff --git a/gdb/testsuite/gdb.reverse/i386-precsave.exp b/gdb/testsuite/gdb.reverse/i386-precsave.exp
index c2467b56c27..2212ff79452 100644
--- a/gdb/testsuite/gdb.reverse/i386-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/i386-precsave.exp
@@ -20,13 +20,7 @@
 #
 
 # This test suitable only for process record-replay
-require supports_process_record
-
-
-if {![is_x86_like_target]} {
-    verbose "Skipping i386 reverse tests."
-    return
-}
+require supports_process_record is_x86_like_target
 
 standard_testfile i386-reverse.c
 set precsave [standard_output_file i386.precsave]
diff --git a/gdb/testsuite/gdb.reverse/i386-reverse.exp b/gdb/testsuite/gdb.reverse/i386-reverse.exp
index 85b6eaefccc..f9bc26dacb4 100644
--- a/gdb/testsuite/gdb.reverse/i386-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-reverse.exp
@@ -19,12 +19,7 @@
 # This test tests some i386 general instructions for reverse execution.
 #
 
-require supports_reverse
-
-if {![is_x86_like_target]} {
-    verbose "Skipping i386 reverse tests."
-    return
-}
+require supports_reverse is_x86_like_target
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp
index efc7c847d59..5f81e6310f4 100644
--- a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp
@@ -16,10 +16,7 @@
 # This file is part of the gdb testsuite.
 
 
-if {![is_x86_like_target]} {
-    verbose "Skipping i387 reverse float tests."
-    return
-}
+require is_x86_like_target
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp b/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp
index f88c1dc0b86..98501857130 100644
--- a/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp
@@ -16,10 +16,7 @@
 # This file is part of the gdb testsuite.
 
 
-if {![is_x86_like_target]} {
-    verbose "Skipping i387 reverse float tests."
-    return
-}
+require is_x86_like_target
 
 standard_testfile
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 08/46] Use require skip_cplus_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (6 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 07/46] Use require is_x86_like_target Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 09/46] Use require skip_shlib_tests Tom Tromey
                   ` (39 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_cplus_tests".
---
 gdb/testsuite/gdb.base/advance-until-multiple-locations.exp | 2 +-
 gdb/testsuite/gdb.base/align-c++.exp                        | 4 +---
 gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp     | 2 +-
 gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp       | 4 +---
 gdb/testsuite/gdb.base/info-types-c++.exp                   | 4 +---
 gdb/testsuite/gdb.base/max-depth-c++.exp                    | 4 +---
 gdb/testsuite/gdb.base/prologue.exp                         | 2 +-
 gdb/testsuite/gdb.base/psymtab.exp                          | 2 +-
 gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp       | 5 +----
 gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp     | 5 +----
 gdb/testsuite/gdb.compile/compile-cplus-inherit.exp         | 5 +----
 gdb/testsuite/gdb.compile/compile-cplus-member.exp          | 5 +----
 gdb/testsuite/gdb.compile/compile-cplus-method.exp          | 5 +----
 gdb/testsuite/gdb.compile/compile-cplus-namespace.exp       | 5 +----
 gdb/testsuite/gdb.compile/compile-cplus-nested.exp          | 5 +----
 gdb/testsuite/gdb.compile/compile-cplus-virtual.exp         | 5 +----
 gdb/testsuite/gdb.cp/align.exp                              | 2 +-
 gdb/testsuite/gdb.cp/ambiguous.exp                          | 2 +-
 gdb/testsuite/gdb.cp/annota2.exp                            | 2 +-
 gdb/testsuite/gdb.cp/annota3.exp                            | 2 +-
 gdb/testsuite/gdb.cp/anon-ns.exp                            | 2 +-
 gdb/testsuite/gdb.cp/anon-union.exp                         | 2 +-
 gdb/testsuite/gdb.cp/arg-reference.exp                      | 2 +-
 gdb/testsuite/gdb.cp/array-indices.exp                      | 2 +-
 gdb/testsuite/gdb.cp/array-repeat.exp                       | 2 +-
 gdb/testsuite/gdb.cp/bool.exp                               | 2 +-
 gdb/testsuite/gdb.cp/break-f-std-string.exp                 | 2 +-
 gdb/testsuite/gdb.cp/breakpoint-locs.exp                    | 2 +-
 gdb/testsuite/gdb.cp/breakpoint.exp                         | 2 +-
 gdb/testsuite/gdb.cp/call-c.exp                             | 2 +-
 gdb/testsuite/gdb.cp/call-method-register.exp               | 2 +-
 gdb/testsuite/gdb.cp/casts.exp                              | 2 +-
 gdb/testsuite/gdb.cp/chained-calls.exp                      | 2 +-
 gdb/testsuite/gdb.cp/class2.exp                             | 2 +-
 gdb/testsuite/gdb.cp/classes.exp                            | 2 +-
 gdb/testsuite/gdb.cp/cmpd-minsyms.exp                       | 2 +-
 gdb/testsuite/gdb.cp/constexpr-field.exp                    | 2 +-
 gdb/testsuite/gdb.cp/cp-relocate.exp                        | 2 +-
 gdb/testsuite/gdb.cp/cpcompletion.exp                       | 2 +-
 gdb/testsuite/gdb.cp/cplabel.exp                            | 2 +-
 gdb/testsuite/gdb.cp/cplusfuncs.exp                         | 2 +-
 gdb/testsuite/gdb.cp/cpsizeof.exp                           | 2 +-
 gdb/testsuite/gdb.cp/ctti.exp                               | 2 +-
 gdb/testsuite/gdb.cp/debug-expr.exp                         | 2 +-
 gdb/testsuite/gdb.cp/demangle.exp                           | 2 +-
 gdb/testsuite/gdb.cp/derivation.exp                         | 2 +-
 gdb/testsuite/gdb.cp/disasm-func-name.exp                   | 2 +-
 gdb/testsuite/gdb.cp/dispcxx.exp                            | 2 +-
 gdb/testsuite/gdb.cp/ena-dis-br-range.exp                   | 2 +-
 gdb/testsuite/gdb.cp/enum-class.exp                         | 2 +-
 gdb/testsuite/gdb.cp/exceptprint.exp                        | 4 +---
 gdb/testsuite/gdb.cp/expand-sals.exp                        | 2 +-
 gdb/testsuite/gdb.cp/extern-c.exp                           | 2 +-
 gdb/testsuite/gdb.cp/filename.exp                           | 2 +-
 gdb/testsuite/gdb.cp/formatted-ref.exp                      | 2 +-
 gdb/testsuite/gdb.cp/gdb1355.exp                            | 2 +-
 gdb/testsuite/gdb.cp/gdb2384.exp                            | 3 +--
 gdb/testsuite/gdb.cp/gdb2495.exp                            | 2 +-
 gdb/testsuite/gdb.cp/hang.exp                               | 2 +-
 gdb/testsuite/gdb.cp/impl-this.exp                          | 2 +-
 gdb/testsuite/gdb.cp/incomplete-type-overload.exp           | 4 +---
 gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp             | 4 +---
 gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp             | 4 +---
 gdb/testsuite/gdb.cp/inherit.exp                            | 2 +-
 gdb/testsuite/gdb.cp/iostream.exp                           | 2 +-
 gdb/testsuite/gdb.cp/local.exp                              | 2 +-
 gdb/testsuite/gdb.cp/m-data.exp                             | 2 +-
 gdb/testsuite/gdb.cp/m-static.exp                           | 2 +-
 gdb/testsuite/gdb.cp/many-args.exp                          | 2 +-
 gdb/testsuite/gdb.cp/mb-ctor.exp                            | 2 +-
 gdb/testsuite/gdb.cp/mb-inline.exp                          | 2 +-
 gdb/testsuite/gdb.cp/member-name.exp                        | 2 +-
 gdb/testsuite/gdb.cp/member-ptr.exp                         | 2 +-
 gdb/testsuite/gdb.cp/meth-typedefs.exp                      | 2 +-
 gdb/testsuite/gdb.cp/method.exp                             | 2 +-
 gdb/testsuite/gdb.cp/method2.exp                            | 2 +-
 gdb/testsuite/gdb.cp/misc.exp                               | 2 +-
 gdb/testsuite/gdb.cp/namelessclass.exp                      | 6 +-----
 gdb/testsuite/gdb.cp/namespace.exp                          | 2 +-
 gdb/testsuite/gdb.cp/nested-class-func-class.exp            | 2 +-
 gdb/testsuite/gdb.cp/nested-types.exp                       | 2 +-
 gdb/testsuite/gdb.cp/nextoverthrow.exp                      | 2 +-
 gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp                 | 4 +---
 gdb/testsuite/gdb.cp/non-trivial-retval.exp                 | 2 +-
 gdb/testsuite/gdb.cp/nsalias.exp                            | 6 +-----
 gdb/testsuite/gdb.cp/overload-const.exp                     | 2 +-
 gdb/testsuite/gdb.cp/overload.exp                           | 2 +-
 gdb/testsuite/gdb.cp/ovldbreak.exp                          | 2 +-
 gdb/testsuite/gdb.cp/ovsrch.exp                             | 2 +-
 gdb/testsuite/gdb.cp/pass-by-ref-2.exp                      | 5 +----
 gdb/testsuite/gdb.cp/pass-by-ref.exp                        | 5 +----
 gdb/testsuite/gdb.cp/pointer-to-member.exp                  | 2 +-
 gdb/testsuite/gdb.cp/pr-1023.exp                            | 2 +-
 gdb/testsuite/gdb.cp/pr-1210.exp                            | 2 +-
 gdb/testsuite/gdb.cp/pr-574.exp                             | 2 +-
 gdb/testsuite/gdb.cp/pr10728.exp                            | 2 +-
 gdb/testsuite/gdb.cp/pr17132.exp                            | 2 +-
 gdb/testsuite/gdb.cp/pr17494.exp                            | 2 +-
 gdb/testsuite/gdb.cp/pr9067.exp                             | 2 +-
 gdb/testsuite/gdb.cp/pr9631.exp                             | 2 +-
 gdb/testsuite/gdb.cp/print-demangle.exp                     | 2 +-
 gdb/testsuite/gdb.cp/print-method-args.exp                  | 2 +-
 gdb/testsuite/gdb.cp/printmethod.exp                        | 2 +-
 gdb/testsuite/gdb.cp/psmang.exp                             | 2 +-
 gdb/testsuite/gdb.cp/psymtab-parameter.exp                  | 2 +-
 gdb/testsuite/gdb.cp/ptype-cv-cp.exp                        | 2 +-
 gdb/testsuite/gdb.cp/ptype-flags.exp                        | 2 +-
 gdb/testsuite/gdb.cp/punctuator.exp                         | 2 +-
 gdb/testsuite/gdb.cp/re-set-overloaded.exp                  | 3 +--
 gdb/testsuite/gdb.cp/ref-params.exp                         | 2 +-
 gdb/testsuite/gdb.cp/ref-types.exp                          | 2 +-
 gdb/testsuite/gdb.cp/rtti.exp                               | 2 +-
 gdb/testsuite/gdb.cp/rvalue-ref-casts.exp                   | 2 +-
 gdb/testsuite/gdb.cp/rvalue-ref-overload.exp                | 2 +-
 gdb/testsuite/gdb.cp/rvalue-ref-params.exp                  | 2 +-
 gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp                  | 2 +-
 gdb/testsuite/gdb.cp/rvalue-ref-types.exp                   | 2 +-
 gdb/testsuite/gdb.cp/scope-err.exp                          | 4 +---
 gdb/testsuite/gdb.cp/static-method.exp                      | 2 +-
 gdb/testsuite/gdb.cp/static-print-quit.exp                  | 2 +-
 gdb/testsuite/gdb.cp/static-typedef-print.exp               | 2 +-
 gdb/testsuite/gdb.cp/stub-array-size.exp                    | 2 +-
 gdb/testsuite/gdb.cp/subtypes.exp                           | 2 +-
 gdb/testsuite/gdb.cp/temargs.exp                            | 4 +---
 gdb/testsuite/gdb.cp/templates.exp                          | 2 +-
 gdb/testsuite/gdb.cp/typed-enum.exp                         | 2 +-
 gdb/testsuite/gdb.cp/typedef-base.exp                       | 2 +-
 gdb/testsuite/gdb.cp/typedef-operator.exp                   | 2 +-
 gdb/testsuite/gdb.cp/typeid.exp                             | 4 +---
 gdb/testsuite/gdb.cp/var-tag.exp                            | 2 +-
 gdb/testsuite/gdb.cp/virtbase.exp                           | 2 +-
 gdb/testsuite/gdb.cp/virtbase2.exp                          | 2 +-
 gdb/testsuite/gdb.cp/virtfunc.exp                           | 2 +-
 gdb/testsuite/gdb.cp/virtfunc2.exp                          | 2 +-
 gdb/testsuite/gdb.cp/watch-cp.exp                           | 2 +-
 gdb/testsuite/gdb.dwarf2/anon-ns-fn.exp                     | 2 +-
 gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp                  | 2 +-
 gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp      | 2 +-
 gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp         | 2 +-
 gdb/testsuite/gdb.dwarf2/implptrconst.exp                   | 2 +-
 gdb/testsuite/gdb.dwarf2/implptrpiece.exp                   | 2 +-
 gdb/testsuite/gdb.dwarf2/implref-array.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/implref-const.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/implref-global.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/implref-struct.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/imported-unit.exp                  | 4 +---
 gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp          | 2 +-
 gdb/testsuite/gdb.dwarf2/method-ptr.exp                     | 2 +-
 gdb/testsuite/gdb.dwarf2/missing-sig-type.exp               | 2 +-
 gdb/testsuite/gdb.dwarf2/nostaticblock.exp                  | 2 +-
 gdb/testsuite/gdb.dwarf2/nullptr_t.exp                      | 2 +-
 gdb/testsuite/gdb.dwarf2/staticvirtual.exp                  | 2 +-
 gdb/testsuite/gdb.dwarf2/subrange.exp                       | 2 +-
 gdb/testsuite/gdb.guile/scm-value-cc.exp                    | 2 +-
 gdb/testsuite/gdb.linespec/break-ask.exp                    | 5 +----
 gdb/testsuite/gdb.linespec/cpexplicit.exp                   | 5 +----
 gdb/testsuite/gdb.linespec/linespec.exp                     | 5 +----
 gdb/testsuite/gdb.linespec/ls-dollar.exp                    | 5 +----
 gdb/testsuite/gdb.linespec/skip-two.exp                     | 5 +----
 gdb/testsuite/gdb.mi/gdb792.exp                             | 2 +-
 gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp            | 2 +-
 gdb/testsuite/gdb.mi/mi-inheritance-syntax-error.exp        | 2 +-
 gdb/testsuite/gdb.mi/mi-linespec-err-cp.exp                 | 4 +---
 gdb/testsuite/gdb.mi/mi-var-cp.exp                          | 2 +-
 gdb/testsuite/gdb.mi/mi-var-rtti.exp                        | 2 +-
 gdb/testsuite/gdb.python/py-explore-cc.exp                  | 2 +-
 gdb/testsuite/gdb.python/py-rvalue-ref-value-cc.exp         | 2 +-
 gdb/testsuite/gdb.python/py-template.exp                    | 2 +-
 gdb/testsuite/gdb.python/py-typeprint.exp                   | 2 +-
 gdb/testsuite/gdb.python/py-value-cc.exp                    | 2 +-
 gdb/testsuite/gdb.python/py-xmethods.exp                    | 5 +----
 171 files changed, 171 insertions(+), 265 deletions(-)

diff --git a/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp b/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp
index 3727669273b..bc7e42eed13 100644
--- a/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp
+++ b/gdb/testsuite/gdb.base/advance-until-multiple-locations.exp
@@ -18,7 +18,7 @@
 
 standard_testfile .cc
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
 	  {debug c++}] } {
diff --git a/gdb/testsuite/gdb.base/align-c++.exp b/gdb/testsuite/gdb.base/align-c++.exp
index bb72b1fe7ee..74b80fedb3e 100644
--- a/gdb/testsuite/gdb.base/align-c++.exp
+++ b/gdb/testsuite/gdb.base/align-c++.exp
@@ -19,9 +19,7 @@
 # compiler.
 
 # Only test C++ if we are able.
-if { [skip_cplus_tests] } {
-    return -1
-}
+require !skip_cplus_tests
 set lang c++
 
 source $srcdir/$subdir/align.exp.tcl
diff --git a/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp b/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
index 3435c8f19ff..4c15cde93d1 100644
--- a/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
+++ b/gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
@@ -23,7 +23,7 @@
 #
 # test running programs
 #
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp b/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
index 5415c7a7c10..90a00691e58 100644
--- a/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
+++ b/gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
@@ -16,9 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Only test C++ if we are able.
-if { [skip_cplus_tests] } {
-    return -1
-}
+require !skip_cplus_tests
 set lang c++
 
 source $srcdir/$subdir/infcall-nested-structs.exp.tcl
diff --git a/gdb/testsuite/gdb.base/info-types-c++.exp b/gdb/testsuite/gdb.base/info-types-c++.exp
index 2aca2e35004..ef89972cbba 100644
--- a/gdb/testsuite/gdb.base/info-types-c++.exp
+++ b/gdb/testsuite/gdb.base/info-types-c++.exp
@@ -14,9 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Only test C++ if we are able.
-if { [skip_cplus_tests] } {
-    return -1
-}
+require !skip_cplus_tests
 set lang c++
 
 source $srcdir/$subdir/info-types.exp.tcl
diff --git a/gdb/testsuite/gdb.base/max-depth-c++.exp b/gdb/testsuite/gdb.base/max-depth-c++.exp
index 9561176ba32..5ae5d449b01 100644
--- a/gdb/testsuite/gdb.base/max-depth-c++.exp
+++ b/gdb/testsuite/gdb.base/max-depth-c++.exp
@@ -14,9 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Only test C++ if we are able.
-if { [skip_cplus_tests] } {
-    return -1
-}
+require !skip_cplus_tests
 set lang c++
 
 source $srcdir/$subdir/max-depth.exp.tcl
diff --git a/gdb/testsuite/gdb.base/prologue.exp b/gdb/testsuite/gdb.base/prologue.exp
index 682ba7d5b0d..fc0bef0fb97 100644
--- a/gdb/testsuite/gdb.base/prologue.exp
+++ b/gdb/testsuite/gdb.base/prologue.exp
@@ -14,7 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } {  return }
+require !skip_cplus_tests
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.base/psymtab.exp b/gdb/testsuite/gdb.base/psymtab.exp
index e805218b076..b9d980c0bdb 100644
--- a/gdb/testsuite/gdb.base/psymtab.exp
+++ b/gdb/testsuite/gdb.base/psymtab.exp
@@ -24,7 +24,7 @@
 #
 
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile psymtab1.c psymtab2.c
 
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp b/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp
index c3ffeeb93fd..2f2dacaefde 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-anonymous.exp
@@ -19,10 +19,7 @@ load_lib compile-support.exp
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} {
-    untested "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing $testfile $testfile $srcfile \
 	 {debug nowarnings c++}]} {
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp b/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp
index 2892d2415be..9ca1b13079a 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-array-decay.exp
@@ -19,10 +19,7 @@ load_lib compile-support.exp
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} {
-    untested "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing $testfile $testfile $srcfile \
 	 {debug nowarnings c++ additional_flags=-std=c++11}]} {
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp b/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp
index 536a5a45fc2..8034a6af0f2 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-inherit.exp
@@ -19,10 +19,7 @@ load_lib compile-support.exp
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} {
-    untested "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing $testfile $testfile $srcfile \
 	 {debug nowarnings c++}]} {
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-member.exp b/gdb/testsuite/gdb.compile/compile-cplus-member.exp
index c18f965c9f3..f43e40bdf8f 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-member.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-member.exp
@@ -19,10 +19,7 @@ load_lib compile-support.exp
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} {
-    untested "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing $testfile $testfile $srcfile \
 	 {debug nowarnings c++}]} {
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-method.exp b/gdb/testsuite/gdb.compile/compile-cplus-method.exp
index 2f96f5fb147..da438630de0 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-method.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-method.exp
@@ -19,10 +19,7 @@ load_lib compile-support.exp
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} {
-    untested "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing $testfile $testfile $srcfile \
 	 {debug nowarnings c++}]} {
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp b/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp
index ec4d0099846..7f0bf70ad67 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-namespace.exp
@@ -19,10 +19,7 @@ load_lib compile-support.exp
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} {
-    untested "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing $testfile $testfile $srcfile \
 	 {debug nowarnings c++}]} {
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-nested.exp b/gdb/testsuite/gdb.compile/compile-cplus-nested.exp
index a5ad87e49f9..22956ca3a03 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-nested.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-nested.exp
@@ -19,10 +19,7 @@ load_lib compile-support.exp
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} {
-    untested "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing $testfile $testfile $srcfile \
 	 {debug nowarnings c++}]} {
diff --git a/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp b/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp
index 3ccd681ea46..71df79b8a20 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp
+++ b/gdb/testsuite/gdb.compile/compile-cplus-virtual.exp
@@ -19,10 +19,7 @@ load_lib compile-support.exp
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} {
-    untested "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing $testfile $testfile $srcfile \
 	 {debug nowarnings c++}]} {
diff --git a/gdb/testsuite/gdb.cp/align.exp b/gdb/testsuite/gdb.cp/align.exp
index 018a297cde9..fcf7bc0c02f 100644
--- a/gdb/testsuite/gdb.cp/align.exp
+++ b/gdb/testsuite/gdb.cp/align.exp
@@ -18,7 +18,7 @@
 # This tests that C++ alignof works in gdb, and that it agrees with
 # the compiler.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 # The types we're going to test.
 
diff --git a/gdb/testsuite/gdb.cp/ambiguous.exp b/gdb/testsuite/gdb.cp/ambiguous.exp
index 5d0d2f88b6e..68013768b92 100644
--- a/gdb/testsuite/gdb.cp/ambiguous.exp
+++ b/gdb/testsuite/gdb.cp/ambiguous.exp
@@ -19,7 +19,7 @@
 # about the field or baseclass being ambiguous is emitted at the right
 # times.
 
-if { [skip_cplus_tests] } {  return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/annota2.exp b/gdb/testsuite/gdb.cp/annota2.exp
index 681235bd32f..96ac2e7ffbd 100644
--- a/gdb/testsuite/gdb.cp/annota2.exp
+++ b/gdb/testsuite/gdb.cp/annota2.exp
@@ -20,7 +20,7 @@
 # test running programs
 #
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/annota3.exp b/gdb/testsuite/gdb.cp/annota3.exp
index 0914b7cbc57..f60bd469c7f 100644
--- a/gdb/testsuite/gdb.cp/annota3.exp
+++ b/gdb/testsuite/gdb.cp/annota3.exp
@@ -20,7 +20,7 @@
 # test running programs
 #
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/anon-ns.exp b/gdb/testsuite/gdb.cp/anon-ns.exp
index bab7717b978..f3b94e46b46 100644
--- a/gdb/testsuite/gdb.cp/anon-ns.exp
+++ b/gdb/testsuite/gdb.cp/anon-ns.exp
@@ -17,7 +17,7 @@
 
 # This file is part of the gdb testsuite.
 
-if {[skip_cplus_tests]} { return }
+require !skip_cplus_tests
 
 standard_testfile .cc anon-ns2.cc
 
diff --git a/gdb/testsuite/gdb.cp/anon-union.exp b/gdb/testsuite/gdb.cp/anon-union.exp
index fd51d790938..14f6ee819c4 100644
--- a/gdb/testsuite/gdb.cp/anon-union.exp
+++ b/gdb/testsuite/gdb.cp/anon-union.exp
@@ -23,7 +23,7 @@
 #
 
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/arg-reference.exp b/gdb/testsuite/gdb.cp/arg-reference.exp
index 9ed65de1a57..78cca5e79e5 100644
--- a/gdb/testsuite/gdb.cp/arg-reference.exp
+++ b/gdb/testsuite/gdb.cp/arg-reference.exp
@@ -21,7 +21,7 @@
 # Test G++ has compiled debuginfo without a C++ '&' reference where it should
 # not be.  GCC Bug 33537.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 
 standard_testfile .cc
diff --git a/gdb/testsuite/gdb.cp/array-indices.exp b/gdb/testsuite/gdb.cp/array-indices.exp
index 514f6b69407..12875892e9d 100644
--- a/gdb/testsuite/gdb.cp/array-indices.exp
+++ b/gdb/testsuite/gdb.cp/array-indices.exp
@@ -15,7 +15,7 @@
 
 # Test the printing of element indices in C++ arrays.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 set lang c++
 
diff --git a/gdb/testsuite/gdb.cp/array-repeat.exp b/gdb/testsuite/gdb.cp/array-repeat.exp
index d631bb47e4f..cda15722ac6 100644
--- a/gdb/testsuite/gdb.cp/array-repeat.exp
+++ b/gdb/testsuite/gdb.cp/array-repeat.exp
@@ -15,7 +15,7 @@
 
 # Test the detection and printing of repeated elements in C++ arrays.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 set lang c++
 
diff --git a/gdb/testsuite/gdb.cp/bool.exp b/gdb/testsuite/gdb.cp/bool.exp
index 0900512e99f..de0a8c3fd25 100644
--- a/gdb/testsuite/gdb.cp/bool.exp
+++ b/gdb/testsuite/gdb.cp/bool.exp
@@ -20,7 +20,7 @@
 
 # Test returning bool.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 
 standard_testfile .cc
diff --git a/gdb/testsuite/gdb.cp/break-f-std-string.exp b/gdb/testsuite/gdb.cp/break-f-std-string.exp
index e222bae8ab3..56f88d9bde1 100644
--- a/gdb/testsuite/gdb.cp/break-f-std-string.exp
+++ b/gdb/testsuite/gdb.cp/break-f-std-string.exp
@@ -58,7 +58,7 @@
 
 standard_testfile .cc
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 # CXX11_ABI specifies the value to define _GLIBCXX_USE_CXX11_ABI as.
 
diff --git a/gdb/testsuite/gdb.cp/breakpoint-locs.exp b/gdb/testsuite/gdb.cp/breakpoint-locs.exp
index bf240b854d4..5b91138ac3e 100644
--- a/gdb/testsuite/gdb.cp/breakpoint-locs.exp
+++ b/gdb/testsuite/gdb.cp/breakpoint-locs.exp
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc breakpoint-locs-2.cc
 
diff --git a/gdb/testsuite/gdb.cp/breakpoint.exp b/gdb/testsuite/gdb.cp/breakpoint.exp
index 31952b65cd6..d834c63d598 100644
--- a/gdb/testsuite/gdb.cp/breakpoint.exp
+++ b/gdb/testsuite/gdb.cp/breakpoint.exp
@@ -17,7 +17,7 @@
 
 # This contains tests for breakpoints in C++.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 #
 # test running programs
diff --git a/gdb/testsuite/gdb.cp/call-c.exp b/gdb/testsuite/gdb.cp/call-c.exp
index dffaaa1c9a7..e5e7c4e9b96 100644
--- a/gdb/testsuite/gdb.cp/call-c.exp
+++ b/gdb/testsuite/gdb.cp/call-c.exp
@@ -14,7 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc call-c-1.c
 set objfilec [standard_output_file ${testfile}-1.o]
diff --git a/gdb/testsuite/gdb.cp/call-method-register.exp b/gdb/testsuite/gdb.cp/call-method-register.exp
index 2c9a1d4ec2a..f6b76dd30bf 100644
--- a/gdb/testsuite/gdb.cp/call-method-register.exp
+++ b/gdb/testsuite/gdb.cp/call-method-register.exp
@@ -16,7 +16,7 @@
 # Test callling a method on a variable that has been put in a
 # register.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 load_lib dwarf.exp
diff --git a/gdb/testsuite/gdb.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp
index f98f844ef92..fcdedfe2059 100644
--- a/gdb/testsuite/gdb.cp/casts.exp
+++ b/gdb/testsuite/gdb.cp/casts.exp
@@ -25,7 +25,7 @@
 #
 
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc casts03.cc
 
diff --git a/gdb/testsuite/gdb.cp/chained-calls.exp b/gdb/testsuite/gdb.cp/chained-calls.exp
index d500052c73f..d4be00a1801 100644
--- a/gdb/testsuite/gdb.cp/chained-calls.exp
+++ b/gdb/testsuite/gdb.cp/chained-calls.exp
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp
index 69e9809820e..62f11ecae21 100644
--- a/gdb/testsuite/gdb.cp/class2.exp
+++ b/gdb/testsuite/gdb.cp/class2.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 
 standard_testfile .cc
diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp
index c6d9c05354e..9c1bafbd711 100644
--- a/gdb/testsuite/gdb.cp/classes.exp
+++ b/gdb/testsuite/gdb.cp/classes.exp
@@ -18,7 +18,7 @@
 
 set nl "\[\r\n\]+"
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/cmpd-minsyms.exp b/gdb/testsuite/gdb.cp/cmpd-minsyms.exp
index fff1d7e0205..4b598e1282e 100644
--- a/gdb/testsuite/gdb.cp/cmpd-minsyms.exp
+++ b/gdb/testsuite/gdb.cp/cmpd-minsyms.exp
@@ -17,7 +17,7 @@
 
 # This file is part of the gdb testsuite.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 # Tests for c++/12273, breakpoint/12803
 standard_testfile .cc
diff --git a/gdb/testsuite/gdb.cp/constexpr-field.exp b/gdb/testsuite/gdb.cp/constexpr-field.exp
index f534961bc97..c961e853be8 100644
--- a/gdb/testsuite/gdb.cp/constexpr-field.exp
+++ b/gdb/testsuite/gdb.cp/constexpr-field.exp
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite.
 
-if {[skip_cplus_tests]} { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/cp-relocate.exp b/gdb/testsuite/gdb.cp/cp-relocate.exp
index c2cd3780cbb..622c1d8af03 100644
--- a/gdb/testsuite/gdb.cp/cp-relocate.exp
+++ b/gdb/testsuite/gdb.cp/cp-relocate.exp
@@ -18,7 +18,7 @@
 standard_testfile .cc
 append binfile .o
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {c++ debug}] != "" } {
      untested "failed to compile"
diff --git a/gdb/testsuite/gdb.cp/cpcompletion.exp b/gdb/testsuite/gdb.cp/cpcompletion.exp
index d19ac9c1b69..713bbb4a985 100644
--- a/gdb/testsuite/gdb.cp/cpcompletion.exp
+++ b/gdb/testsuite/gdb.cp/cpcompletion.exp
@@ -51,7 +51,7 @@ proc test_class_complete {class expr name matches} {
     }
 }
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile pr9594.cc
 
diff --git a/gdb/testsuite/gdb.cp/cplabel.exp b/gdb/testsuite/gdb.cp/cplabel.exp
index a57bc710f4f..051887841ce 100644
--- a/gdb/testsuite/gdb.cp/cplabel.exp
+++ b/gdb/testsuite/gdb.cp/cplabel.exp
@@ -15,7 +15,7 @@
 
 # Tests for breakpoint on labels in methods.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.exp b/gdb/testsuite/gdb.cp/cplusfuncs.exp
index 4824c19e818..3a70dab8555 100644
--- a/gdb/testsuite/gdb.cp/cplusfuncs.exp
+++ b/gdb/testsuite/gdb.cp/cplusfuncs.exp
@@ -16,7 +16,7 @@
 # This file was written by Fred Fish. (fnf@cygnus.com)
 # Adapted for g++ 3.0 ABI by Michael Chastain. (chastain@redhat.com)
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/cpsizeof.exp b/gdb/testsuite/gdb.cp/cpsizeof.exp
index a27dcfcc88e..a1f3d6a72b5 100644
--- a/gdb/testsuite/gdb.cp/cpsizeof.exp
+++ b/gdb/testsuite/gdb.cp/cpsizeof.exp
@@ -16,7 +16,7 @@
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} { return }
+require !skip_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}] } {
      return -1
diff --git a/gdb/testsuite/gdb.cp/ctti.exp b/gdb/testsuite/gdb.cp/ctti.exp
index aacda45c325..33f52db7ddd 100644
--- a/gdb/testsuite/gdb.cp/ctti.exp
+++ b/gdb/testsuite/gdb.cp/ctti.exp
@@ -21,7 +21,7 @@
 
 # Call to template instantiations.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile cttiadd.cc cttiadd1.cc cttiadd2.cc cttiadd3.cc
 
diff --git a/gdb/testsuite/gdb.cp/debug-expr.exp b/gdb/testsuite/gdb.cp/debug-expr.exp
index 1b84449f1e9..ef29b7f0d56 100644
--- a/gdb/testsuite/gdb.cp/debug-expr.exp
+++ b/gdb/testsuite/gdb.cp/debug-expr.exp
@@ -15,7 +15,7 @@
 
 # Test "set debug expr 1" on c++ expressions.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 gdb_start
 gdb_test_no_output "set language c++"
diff --git a/gdb/testsuite/gdb.cp/demangle.exp b/gdb/testsuite/gdb.cp/demangle.exp
index de96b684f44..5bda847e2b0 100644
--- a/gdb/testsuite/gdb.cp/demangle.exp
+++ b/gdb/testsuite/gdb.cp/demangle.exp
@@ -15,7 +15,7 @@
 
 # This file was written by Fred Fish. (fnf@cygnus.com)
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 ### The demangling style we last sent to GDB.
 set current_demangling_style none
diff --git a/gdb/testsuite/gdb.cp/derivation.exp b/gdb/testsuite/gdb.cp/derivation.exp
index 67ec4c11fe0..5ea1dc3cb97 100644
--- a/gdb/testsuite/gdb.cp/derivation.exp
+++ b/gdb/testsuite/gdb.cp/derivation.exp
@@ -28,7 +28,7 @@ set nl "\[\r\n\]+"
 # Start program.
 
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/disasm-func-name.exp b/gdb/testsuite/gdb.cp/disasm-func-name.exp
index bfc1739c6b4..2af2da56910 100644
--- a/gdb/testsuite/gdb.cp/disasm-func-name.exp
+++ b/gdb/testsuite/gdb.cp/disasm-func-name.exp
@@ -18,7 +18,7 @@
 # Test that the disassembler correctly demangles C++ function names in
 # it's header line.
 
-if {[skip_cplus_tests]} { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/dispcxx.exp b/gdb/testsuite/gdb.cp/dispcxx.exp
index e12b082135f..2892ecad72c 100644
--- a/gdb/testsuite/gdb.cp/dispcxx.exp
+++ b/gdb/testsuite/gdb.cp/dispcxx.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/ena-dis-br-range.exp b/gdb/testsuite/gdb.cp/ena-dis-br-range.exp
index 967d6b41c62..a25dc3b3000 100644
--- a/gdb/testsuite/gdb.cp/ena-dis-br-range.exp
+++ b/gdb/testsuite/gdb.cp/ena-dis-br-range.exp
@@ -21,7 +21,7 @@
 # multiple locations and breakpoints are found in
 # gdb.base/ena-dis-br.exp.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/enum-class.exp b/gdb/testsuite/gdb.cp/enum-class.exp
index fc5913bc51d..2745cf103c7 100644
--- a/gdb/testsuite/gdb.cp/enum-class.exp
+++ b/gdb/testsuite/gdb.cp/enum-class.exp
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/exceptprint.exp b/gdb/testsuite/gdb.cp/exceptprint.exp
index ddea1612871..9a005a356f9 100644
--- a/gdb/testsuite/gdb.cp/exceptprint.exp
+++ b/gdb/testsuite/gdb.cp/exceptprint.exp
@@ -15,9 +15,7 @@
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} {
-    return -1
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
diff --git a/gdb/testsuite/gdb.cp/expand-sals.exp b/gdb/testsuite/gdb.cp/expand-sals.exp
index 7ce851493ff..20311c39588 100644
--- a/gdb/testsuite/gdb.cp/expand-sals.exp
+++ b/gdb/testsuite/gdb.cp/expand-sals.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 set srcfile expand-sals.cc
 if { [prepare_for_testing "failed to prepare" expand-sals $srcfile {debug c++}] } {
diff --git a/gdb/testsuite/gdb.cp/extern-c.exp b/gdb/testsuite/gdb.cp/extern-c.exp
index e4a59b67385..6fcaada066f 100644
--- a/gdb/testsuite/gdb.cp/extern-c.exp
+++ b/gdb/testsuite/gdb.cp/extern-c.exp
@@ -15,7 +15,7 @@
 
 # Test breakpoints on extern "C" functions implemented in C++.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/filename.exp b/gdb/testsuite/gdb.cp/filename.exp
index 91ee3308c12..2bba4863c42 100644
--- a/gdb/testsuite/gdb.cp/filename.exp
+++ b/gdb/testsuite/gdb.cp/filename.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/formatted-ref.exp b/gdb/testsuite/gdb.cp/formatted-ref.exp
index 12515410c46..0ebe9605803 100644
--- a/gdb/testsuite/gdb.cp/formatted-ref.exp
+++ b/gdb/testsuite/gdb.cp/formatted-ref.exp
@@ -28,7 +28,7 @@
 # operand.
 
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/gdb1355.exp b/gdb/testsuite/gdb.cp/gdb1355.exp
index cd4ee9bad77..0566527c072 100644
--- a/gdb/testsuite/gdb.cp/gdb1355.exp
+++ b/gdb/testsuite/gdb.cp/gdb1355.exp
@@ -21,7 +21,7 @@
 set ws "\[\r\n\t \]*"
 set nl "\[\r\n\]+"
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 #
 # test running programs
diff --git a/gdb/testsuite/gdb.cp/gdb2384.exp b/gdb/testsuite/gdb.cp/gdb2384.exp
index e08ed9cb156..62250267602 100644
--- a/gdb/testsuite/gdb.cp/gdb2384.exp
+++ b/gdb/testsuite/gdb.cp/gdb2384.exp
@@ -21,8 +21,7 @@
 #
 # PR c++/9489.
 
-if { [skip_cplus_tests] } { continue }
-if { [skip_shlib_tests] } { continue }
+require !skip_cplus_tests !skip_shlib_tests
 
 standard_testfile .cc gdb2384-base.cc
 
diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp
index b2305a14e51..4a80b2f80b6 100644
--- a/gdb/testsuite/gdb.cp/gdb2495.exp
+++ b/gdb/testsuite/gdb.cp/gdb2495.exp
@@ -31,7 +31,7 @@
 
 # This test is largely based of gdb.base/callfuncs.exp.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 if [target_info exists gdb,nosignals] {
     verbose "Skipping gdb2495.exp because of nosignals."
diff --git a/gdb/testsuite/gdb.cp/hang.exp b/gdb/testsuite/gdb.cp/hang.exp
index 95e8d4958b5..8efa49376ca 100644
--- a/gdb/testsuite/gdb.cp/hang.exp
+++ b/gdb/testsuite/gdb.cp/hang.exp
@@ -14,7 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile hang1.cc hang2.cc hang3.cc
 
diff --git a/gdb/testsuite/gdb.cp/impl-this.exp b/gdb/testsuite/gdb.cp/impl-this.exp
index 9ce409ee10e..bac7615e53c 100644
--- a/gdb/testsuite/gdb.cp/impl-this.exp
+++ b/gdb/testsuite/gdb.cp/impl-this.exp
@@ -18,7 +18,7 @@
 # Test expressions which assume an implicit "this" with a qualified
 # name.
 
-if {[skip_cplus_tests]} { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/incomplete-type-overload.exp b/gdb/testsuite/gdb.cp/incomplete-type-overload.exp
index fdff30f3850..72d7869fb75 100644
--- a/gdb/testsuite/gdb.cp/incomplete-type-overload.exp
+++ b/gdb/testsuite/gdb.cp/incomplete-type-overload.exp
@@ -20,9 +20,7 @@
 
 load_lib dwarf.exp
 
-if { [skip_cplus_tests] } { return }
-
-require dwarf2_support
+require dwarf2_support !skip_cplus_tests
 
 standard_testfile .cc .S
 set asm_file [standard_output_file ${srcfile2}]
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp
index 2b5fc1ebdbf..793288156bc 100644
--- a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d0.exp
@@ -15,9 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Only test C++ if we are able.  Always use C.
-if { [skip_cplus_tests] } {
-    return -1
-}
+require !skip_cplus_tests
 set lang {c++}
 
 set debug nodebug
diff --git a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp
index 0914058a38d..424aa641f0b 100644
--- a/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp
+++ b/gdb/testsuite/gdb.cp/infcall-nodebug-c++-d1.exp
@@ -15,9 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Only test C++ if we are able.  Always use C.
-if { [skip_cplus_tests] } {
-    return -1
-}
+require !skip_cplus_tests
 set lang {c++}
 
 set debug debug
diff --git a/gdb/testsuite/gdb.cp/inherit.exp b/gdb/testsuite/gdb.cp/inherit.exp
index e1099fe5ed5..3af03807bc3 100644
--- a/gdb/testsuite/gdb.cp/inherit.exp
+++ b/gdb/testsuite/gdb.cp/inherit.exp
@@ -20,7 +20,7 @@ set ws  "\[\r\n\t \]+"
 set nl  "\[\r\n\]+"
 set vhn "\\$\[0-9\]+"
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/iostream.exp b/gdb/testsuite/gdb.cp/iostream.exp
index aa7c5359e69..92a1f2b04f7 100644
--- a/gdb/testsuite/gdb.cp/iostream.exp
+++ b/gdb/testsuite/gdb.cp/iostream.exp
@@ -16,7 +16,7 @@
 # This file is part of the gdb testsuite.
 # It tests various aspects of iostream that have caused problems for gdb.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/local.exp b/gdb/testsuite/gdb.cp/local.exp
index 378a5c31cc3..eb4c70b18ed 100644
--- a/gdb/testsuite/gdb.cp/local.exp
+++ b/gdb/testsuite/gdb.cp/local.exp
@@ -27,7 +27,7 @@ set nl "\[\r\n\]+"
 # test running programs
 #
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/m-data.exp b/gdb/testsuite/gdb.cp/m-data.exp
index 282b33a1f3f..5269dbb9621 100644
--- a/gdb/testsuite/gdb.cp/m-data.exp
+++ b/gdb/testsuite/gdb.cp/m-data.exp
@@ -18,7 +18,7 @@
 
 # This file is part of the gdb testsuite
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 #
 # test running programs
diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp
index 1acaf13ce90..54233a37c28 100644
--- a/gdb/testsuite/gdb.cp/m-static.exp
+++ b/gdb/testsuite/gdb.cp/m-static.exp
@@ -19,7 +19,7 @@
 
 # This file is part of the gdb testsuite
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 #
 # test running programs
diff --git a/gdb/testsuite/gdb.cp/many-args.exp b/gdb/testsuite/gdb.cp/many-args.exp
index c9c02f44122..d444aa470de 100644
--- a/gdb/testsuite/gdb.cp/many-args.exp
+++ b/gdb/testsuite/gdb.cp/many-args.exp
@@ -19,7 +19,7 @@
 # passed in registers.  This test passes so many structures it is
 # hoped that some will need to be placed onto the stack.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/mb-ctor.exp b/gdb/testsuite/gdb.cp/mb-ctor.exp
index f60d071ead4..24a1b65f42d 100644
--- a/gdb/testsuite/gdb.cp/mb-ctor.exp
+++ b/gdb/testsuite/gdb.cp/mb-ctor.exp
@@ -16,7 +16,7 @@
 # Test that breakpoints on C++ constructors work, despite the
 # fact that gcc generates several versions of constructor function.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 
 standard_testfile .cc
diff --git a/gdb/testsuite/gdb.cp/mb-inline.exp b/gdb/testsuite/gdb.cp/mb-inline.exp
index fffb9a57008..67218f2b9d9 100644
--- a/gdb/testsuite/gdb.cp/mb-inline.exp
+++ b/gdb/testsuite/gdb.cp/mb-inline.exp
@@ -18,7 +18,7 @@
 # This test verifies that setting breakpoint on line in inline
 # function will fire in all instantiations of that function.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile mb-inline1.cc mb-inline2.cc
 set hdrfile "${testfile}.h"
diff --git a/gdb/testsuite/gdb.cp/member-name.exp b/gdb/testsuite/gdb.cp/member-name.exp
index 6e3e0f07ae2..f961cf8bd9b 100644
--- a/gdb/testsuite/gdb.cp/member-name.exp
+++ b/gdb/testsuite/gdb.cp/member-name.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/member-ptr.exp b/gdb/testsuite/gdb.cp/member-ptr.exp
index abb20916a59..d31ec0c1624 100644
--- a/gdb/testsuite/gdb.cp/member-ptr.exp
+++ b/gdb/testsuite/gdb.cp/member-ptr.exp
@@ -21,7 +21,7 @@
 
 set vhn "\\$\[0-9\]+"
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 
 standard_testfile .cc
diff --git a/gdb/testsuite/gdb.cp/meth-typedefs.exp b/gdb/testsuite/gdb.cp/meth-typedefs.exp
index b357e36c7bc..2e3a713a87a 100644
--- a/gdb/testsuite/gdb.cp/meth-typedefs.exp
+++ b/gdb/testsuite/gdb.cp/meth-typedefs.exp
@@ -30,7 +30,7 @@ proc add {var name params expected {kind {func}}} {
     lappend result [list "${method_name}($params)" $expect]
 }
 
-if {[skip_cplus_tests]} { return }
+require !skip_cplus_tests
 
 # Tests for c++/12266 et al
 standard_testfile .cc
diff --git a/gdb/testsuite/gdb.cp/method.exp b/gdb/testsuite/gdb.cp/method.exp
index 7a3227b461c..cab84933dcb 100644
--- a/gdb/testsuite/gdb.cp/method.exp
+++ b/gdb/testsuite/gdb.cp/method.exp
@@ -32,7 +32,7 @@
 # test running programs
 #
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/method2.exp b/gdb/testsuite/gdb.cp/method2.exp
index c657b38a9a2..6376fb0e782 100644
--- a/gdb/testsuite/gdb.cp/method2.exp
+++ b/gdb/testsuite/gdb.cp/method2.exp
@@ -18,7 +18,7 @@
 # This tests setting a break in an ambiguous c++ method with
 # current_language set to c.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/misc.exp b/gdb/testsuite/gdb.cp/misc.exp
index 8a884445962..a6b1dc860d6 100644
--- a/gdb/testsuite/gdb.cp/misc.exp
+++ b/gdb/testsuite/gdb.cp/misc.exp
@@ -15,7 +15,7 @@
 
 # This file was written by Fred Fish. (fnf@cygnus.com)
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/namelessclass.exp b/gdb/testsuite/gdb.cp/namelessclass.exp
index 86d4a382444..435cdc7981f 100644
--- a/gdb/testsuite/gdb.cp/namelessclass.exp
+++ b/gdb/testsuite/gdb.cp/namelessclass.exp
@@ -19,12 +19,8 @@
 load_lib dwarf.exp
 
 # Do not run in environments which do not support C++.
-if {[skip_cplus_tests]} {
-    return
-}
-
 # This test can only be run on x86-like targets which support DWARF.
-require dwarf2_support
+require dwarf2_support !skip_cplus_tests
 
 if {![istarget "x86_64-*-*"] || ![is_lp64_target]} {
     return 0
diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
index f2eb2a48ae6..9270f253e41 100644
--- a/gdb/testsuite/gdb.cp/namespace.exp
+++ b/gdb/testsuite/gdb.cp/namespace.exp
@@ -25,7 +25,7 @@
 
 
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc namespace1.cc
 
diff --git a/gdb/testsuite/gdb.cp/nested-class-func-class.exp b/gdb/testsuite/gdb.cp/nested-class-func-class.exp
index 5196a394e92..ad7dccec348 100644
--- a/gdb/testsuite/gdb.cp/nested-class-func-class.exp
+++ b/gdb/testsuite/gdb.cp/nested-class-func-class.exp
@@ -15,7 +15,7 @@
 
 # Regression test for type printing of private nested classes.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/nested-types.exp b/gdb/testsuite/gdb.cp/nested-types.exp
index dddadb6bdb0..46c824935cf 100644
--- a/gdb/testsuite/gdb.cp/nested-types.exp
+++ b/gdb/testsuite/gdb.cp/nested-types.exp
@@ -19,7 +19,7 @@
 # the corresponding source file.  It then walks the nodes of this tree
 # to construct input suitable for passing to cp_test_ptype_class.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/nextoverthrow.exp b/gdb/testsuite/gdb.cp/nextoverthrow.exp
index fe6445cf96d..ff26b88b51b 100644
--- a/gdb/testsuite/gdb.cp/nextoverthrow.exp
+++ b/gdb/testsuite/gdb.cp/nextoverthrow.exp
@@ -14,7 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp b/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
index 606d479cec7..01a02e6e6e1 100644
--- a/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
+++ b/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
@@ -15,9 +15,7 @@
 
 standard_testfile exceptprint.cc
 
-if {[skip_cplus_tests]} {
-    return -1
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
diff --git a/gdb/testsuite/gdb.cp/non-trivial-retval.exp b/gdb/testsuite/gdb.cp/non-trivial-retval.exp
index 93a3a6832f7..f92a3a77711 100644
--- a/gdb/testsuite/gdb.cp/non-trivial-retval.exp
+++ b/gdb/testsuite/gdb.cp/non-trivial-retval.exp
@@ -17,7 +17,7 @@
 
 set additional_flags ""
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/nsalias.exp b/gdb/testsuite/gdb.cp/nsalias.exp
index 2ebf432dc8e..7bd987176b2 100644
--- a/gdb/testsuite/gdb.cp/nsalias.exp
+++ b/gdb/testsuite/gdb.cp/nsalias.exp
@@ -18,11 +18,7 @@
 
 load_lib dwarf.exp
 
-require dwarf2_support
-
-if {[skip_cplus_tests]} {
-    return
-}
+require dwarf2_support !skip_cplus_tests
 
 standard_testfile .cc nsalias-dw.S
 
diff --git a/gdb/testsuite/gdb.cp/overload-const.exp b/gdb/testsuite/gdb.cp/overload-const.exp
index 83a8b71ba22..9f51601b4c5 100644
--- a/gdb/testsuite/gdb.cp/overload-const.exp
+++ b/gdb/testsuite/gdb.cp/overload-const.exp
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp
index fde9d73c90b..b20a46770ce 100644
--- a/gdb/testsuite/gdb.cp/overload.exp
+++ b/gdb/testsuite/gdb.cp/overload.exp
@@ -24,7 +24,7 @@ set ws "\[\r\n\t \]+"
 set nl "\[\r\n\]+"
 
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp
index 94b58a5080d..4f2e294b9c7 100644
--- a/gdb/testsuite/gdb.cp/ovldbreak.exp
+++ b/gdb/testsuite/gdb.cp/ovldbreak.exp
@@ -28,7 +28,7 @@ set timeout 15
 # test running programs
 #
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/ovsrch.exp b/gdb/testsuite/gdb.cp/ovsrch.exp
index 32ac7ce72d0..08c1f9dc5e3 100644
--- a/gdb/testsuite/gdb.cp/ovsrch.exp
+++ b/gdb/testsuite/gdb.cp/ovsrch.exp
@@ -52,7 +52,7 @@ proc test_class {class} {
     gdb_test "break ${class}::hibob if (a_param == 3)" "Breakpoint (\[0-9\]).*"
 }
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 # Test for c++/11734
 standard_testfile ovsrch1.cc ovsrch2.cc ovsrch3.cc ovsrch4.cc
diff --git a/gdb/testsuite/gdb.cp/pass-by-ref-2.exp b/gdb/testsuite/gdb.cp/pass-by-ref-2.exp
index 97cb44f2f94..32b9889c452 100644
--- a/gdb/testsuite/gdb.cp/pass-by-ref-2.exp
+++ b/gdb/testsuite/gdb.cp/pass-by-ref-2.exp
@@ -25,10 +25,7 @@
 # - have inlined copy ctor
 # - have deleted destructor
 
-if {[skip_cplus_tests]} {
-    untested "c++ test skipped"
-    return
-}
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/pass-by-ref.exp b/gdb/testsuite/gdb.cp/pass-by-ref.exp
index 0ea5306ff7c..45fb64eebd6 100644
--- a/gdb/testsuite/gdb.cp/pass-by-ref.exp
+++ b/gdb/testsuite/gdb.cp/pass-by-ref.exp
@@ -68,10 +68,7 @@
 # The companion test file pass-by-ref-2.exp also contains
 # manually-written cases.
 
-if {[skip_cplus_tests]} {
-    untested "c++ test skipped"
-    return
-}
+require !skip_cplus_tests
 
 # The program source is generated in the output directory.
 # We use standard_testfile here to set convenience variables.
diff --git a/gdb/testsuite/gdb.cp/pointer-to-member.exp b/gdb/testsuite/gdb.cp/pointer-to-member.exp
index d946a60af7b..d20582a8958 100644
--- a/gdb/testsuite/gdb.cp/pointer-to-member.exp
+++ b/gdb/testsuite/gdb.cp/pointer-to-member.exp
@@ -17,7 +17,7 @@
 
 # Test printing c++ pointer-to-member.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/pr-1023.exp b/gdb/testsuite/gdb.cp/pr-1023.exp
index 0cd310b7c34..91f939bf990 100644
--- a/gdb/testsuite/gdb.cp/pr-1023.exp
+++ b/gdb/testsuite/gdb.cp/pr-1023.exp
@@ -18,7 +18,7 @@
 
 # This file is part of the gdb testsuite.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 #
 # test running programs
diff --git a/gdb/testsuite/gdb.cp/pr-1210.exp b/gdb/testsuite/gdb.cp/pr-1210.exp
index 5fabf6f8a44..296878ee3dd 100644
--- a/gdb/testsuite/gdb.cp/pr-1210.exp
+++ b/gdb/testsuite/gdb.cp/pr-1210.exp
@@ -17,7 +17,7 @@
 
 # This file is part of the gdb testsuite.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 #
 # test running programs
diff --git a/gdb/testsuite/gdb.cp/pr-574.exp b/gdb/testsuite/gdb.cp/pr-574.exp
index 06b96ccc0e9..b74dfcee8e8 100644
--- a/gdb/testsuite/gdb.cp/pr-574.exp
+++ b/gdb/testsuite/gdb.cp/pr-574.exp
@@ -20,7 +20,7 @@
 
 # This file is part of the gdb testsuite
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 #
 # test running programs
diff --git a/gdb/testsuite/gdb.cp/pr10728.exp b/gdb/testsuite/gdb.cp/pr10728.exp
index 07db26a6428..a76a4053609 100644
--- a/gdb/testsuite/gdb.cp/pr10728.exp
+++ b/gdb/testsuite/gdb.cp/pr10728.exp
@@ -17,7 +17,7 @@
 
 set nl		"\[\r\n\]+"
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/pr17132.exp b/gdb/testsuite/gdb.cp/pr17132.exp
index 1b707190192..e3b21b0ea40 100644
--- a/gdb/testsuite/gdb.cp/pr17132.exp
+++ b/gdb/testsuite/gdb.cp/pr17132.exp
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/pr17494.exp b/gdb/testsuite/gdb.cp/pr17494.exp
index b2321161d19..f322559d3a3 100644
--- a/gdb/testsuite/gdb.cp/pr17494.exp
+++ b/gdb/testsuite/gdb.cp/pr17494.exp
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/pr9067.exp b/gdb/testsuite/gdb.cp/pr9067.exp
index 79d18b5f65d..f0485c0935e 100644
--- a/gdb/testsuite/gdb.cp/pr9067.exp
+++ b/gdb/testsuite/gdb.cp/pr9067.exp
@@ -15,7 +15,7 @@
 
 set nl		"\[\r\n\]+"
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/pr9631.exp b/gdb/testsuite/gdb.cp/pr9631.exp
index 612feaab974..7597163e559 100644
--- a/gdb/testsuite/gdb.cp/pr9631.exp
+++ b/gdb/testsuite/gdb.cp/pr9631.exp
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/print-demangle.exp b/gdb/testsuite/gdb.cp/print-demangle.exp
index 8933a1f903b..9b77718f916 100644
--- a/gdb/testsuite/gdb.cp/print-demangle.exp
+++ b/gdb/testsuite/gdb.cp/print-demangle.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile bool.cc
 
diff --git a/gdb/testsuite/gdb.cp/print-method-args.exp b/gdb/testsuite/gdb.cp/print-method-args.exp
index 7773e041e21..a0c628fcf15 100644
--- a/gdb/testsuite/gdb.cp/print-method-args.exp
+++ b/gdb/testsuite/gdb.cp/print-method-args.exp
@@ -17,7 +17,7 @@
 
 # This test checks that a constructor and destructor are printed the same.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/printmethod.exp b/gdb/testsuite/gdb.cp/printmethod.exp
index 1530a40220e..0b7ca55e8c6 100644
--- a/gdb/testsuite/gdb.cp/printmethod.exp
+++ b/gdb/testsuite/gdb.cp/printmethod.exp
@@ -19,7 +19,7 @@
 
 # This file is part of the gdb testsuite
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 #
 # test running programs
diff --git a/gdb/testsuite/gdb.cp/psmang.exp b/gdb/testsuite/gdb.cp/psmang.exp
index 5751b6dc3a5..60eb19711d2 100644
--- a/gdb/testsuite/gdb.cp/psmang.exp
+++ b/gdb/testsuite/gdb.cp/psmang.exp
@@ -176,7 +176,7 @@
 #
 
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile psmang1.cc psmang2.cc
 
diff --git a/gdb/testsuite/gdb.cp/psymtab-parameter.exp b/gdb/testsuite/gdb.cp/psymtab-parameter.exp
index 700b894aa99..c1769cdf236 100644
--- a/gdb/testsuite/gdb.cp/psymtab-parameter.exp
+++ b/gdb/testsuite/gdb.cp/psymtab-parameter.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/ptype-cv-cp.exp b/gdb/testsuite/gdb.cp/ptype-cv-cp.exp
index 1505756ec4b..1c8a2e6d3a5 100644
--- a/gdb/testsuite/gdb.cp/ptype-cv-cp.exp
+++ b/gdb/testsuite/gdb.cp/ptype-cv-cp.exp
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/ptype-flags.exp b/gdb/testsuite/gdb.cp/ptype-flags.exp
index 8c42de837e7..4c6c196070a 100644
--- a/gdb/testsuite/gdb.cp/ptype-flags.exp
+++ b/gdb/testsuite/gdb.cp/ptype-flags.exp
@@ -15,7 +15,7 @@
 
 set nl		"\[\r\n\]+"
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/punctuator.exp b/gdb/testsuite/gdb.cp/punctuator.exp
index eaca92852a2..f0cc831cb4c 100644
--- a/gdb/testsuite/gdb.cp/punctuator.exp
+++ b/gdb/testsuite/gdb.cp/punctuator.exp
@@ -17,7 +17,7 @@
 
 # This file is part of the gdb testsuite
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 gdb_exit
 gdb_start
diff --git a/gdb/testsuite/gdb.cp/re-set-overloaded.exp b/gdb/testsuite/gdb.cp/re-set-overloaded.exp
index c64ae2f38ed..6a639741969 100644
--- a/gdb/testsuite/gdb.cp/re-set-overloaded.exp
+++ b/gdb/testsuite/gdb.cp/re-set-overloaded.exp
@@ -13,8 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { continue }
-if { [skip_shlib_tests] } { continue }
+require !skip_cplus_tests !skip_shlib_tests
 
 standard_testfile bool.cc .cc
 
diff --git a/gdb/testsuite/gdb.cp/ref-params.exp b/gdb/testsuite/gdb.cp/ref-params.exp
index e4d5eaa5946..b6c0d34b60f 100644
--- a/gdb/testsuite/gdb.cp/ref-params.exp
+++ b/gdb/testsuite/gdb.cp/ref-params.exp
@@ -20,7 +20,7 @@
 # test running programs
 #
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/ref-types.exp b/gdb/testsuite/gdb.cp/ref-types.exp
index fd99ea9c0d6..9784f384ca1 100644
--- a/gdb/testsuite/gdb.cp/ref-types.exp
+++ b/gdb/testsuite/gdb.cp/ref-types.exp
@@ -20,7 +20,7 @@
 # test running programs
 #
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/rtti.exp b/gdb/testsuite/gdb.cp/rtti.exp
index c72777bebff..4123371e5ec 100644
--- a/gdb/testsuite/gdb.cp/rtti.exp
+++ b/gdb/testsuite/gdb.cp/rtti.exp
@@ -26,7 +26,7 @@
 # (involving templates, in particular) where this problem triggers
 # because GDB and GCC have different ideas what a class is called.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 #
 # test running programs
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-casts.exp b/gdb/testsuite/gdb.cp/rvalue-ref-casts.exp
index e3b834a250a..e61c2c0c619 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-casts.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-casts.exp
@@ -17,7 +17,7 @@
 
 # C++11 rvalue reference type casting tests, based on gdb.cp/casts.exp.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp b/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp
index 36342673aad..d34f30378ba 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp
@@ -18,7 +18,7 @@
 # Tests for overloaded member functions with rvalue reference parameters,
 # based on gdb.cp/overload.exp.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp
index d9a5843cb27..ddac91595d9 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp
@@ -16,7 +16,7 @@
 # Tests for rvalue reference parameters of types and their subtypes in GDB,
 # based on gdb.cp/ref-params.exp.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp b/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp
index 80aeb078590..ed1c8d7a9a4 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp
@@ -18,7 +18,7 @@
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} { return }
+require !skip_cplus_tests
 
 if {[prepare_for_testing ${testfile}.exp $testfile $srcfile \
     {debug c++ additional_flags="-std=gnu++11"}] } {
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-types.exp b/gdb/testsuite/gdb.cp/rvalue-ref-types.exp
index e38393db40d..b48c3373a70 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-types.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-types.exp
@@ -16,7 +16,7 @@
 # Tests for reference types with short type variables in GDB, based on
 # gdb.cp/ref-types.exp.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/scope-err.exp b/gdb/testsuite/gdb.cp/scope-err.exp
index 4234f3f1a8a..8a9c9cfcaa7 100644
--- a/gdb/testsuite/gdb.cp/scope-err.exp
+++ b/gdb/testsuite/gdb.cp/scope-err.exp
@@ -16,9 +16,7 @@
 # Tests for linespec errors with C++.
 # Derived from gdb.linespec/ls-errs.exp.
 
-if {[skip_cplus_tests]} {
-    return
-}
+require !skip_cplus_tests
 
 standard_testfile .cc
 set exefile $testfile
diff --git a/gdb/testsuite/gdb.cp/static-method.exp b/gdb/testsuite/gdb.cp/static-method.exp
index 1499955f308..04899213caf 100644
--- a/gdb/testsuite/gdb.cp/static-method.exp
+++ b/gdb/testsuite/gdb.cp/static-method.exp
@@ -37,7 +37,7 @@ proc test_breakpoint {func result} {
     }
 }
 
-if {[skip_cplus_tests]} { return }
+require !skip_cplus_tests
 
 # Tests for c++/12750
 standard_testfile .cc
diff --git a/gdb/testsuite/gdb.cp/static-print-quit.exp b/gdb/testsuite/gdb.cp/static-print-quit.exp
index 0f3df4f3e65..e774f4660b9 100644
--- a/gdb/testsuite/gdb.cp/static-print-quit.exp
+++ b/gdb/testsuite/gdb.cp/static-print-quit.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/static-typedef-print.exp b/gdb/testsuite/gdb.cp/static-typedef-print.exp
index 0af27dd280e..23d7a918618 100644
--- a/gdb/testsuite/gdb.cp/static-typedef-print.exp
+++ b/gdb/testsuite/gdb.cp/static-typedef-print.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/stub-array-size.exp b/gdb/testsuite/gdb.cp/stub-array-size.exp
index 39f242f2eb4..0bc9f472b51 100644
--- a/gdb/testsuite/gdb.cp/stub-array-size.exp
+++ b/gdb/testsuite/gdb.cp/stub-array-size.exp
@@ -18,7 +18,7 @@
 # Test size of arrays of stubbed types (structures where the full definition
 # is not immediately available).
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc stub-array-size2.cc
 
diff --git a/gdb/testsuite/gdb.cp/subtypes.exp b/gdb/testsuite/gdb.cp/subtypes.exp
index e009df9ed29..fadd3c53ef3 100644
--- a/gdb/testsuite/gdb.cp/subtypes.exp
+++ b/gdb/testsuite/gdb.cp/subtypes.exp
@@ -16,7 +16,7 @@
 # Test for subtype definitions, i.e., types defined in classes, functions,
 # etc.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/temargs.exp b/gdb/testsuite/gdb.cp/temargs.exp
index 22c29cc7d8a..a763bbfb490 100644
--- a/gdb/testsuite/gdb.cp/temargs.exp
+++ b/gdb/testsuite/gdb.cp/temargs.exp
@@ -17,9 +17,7 @@
 
 # This file is part of the gdb testsuite.
 
-if {[skip_cplus_tests]} {
-    return
-}
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp
index d3ede5a5fb6..0daa03d6e93 100644
--- a/gdb/testsuite/gdb.cp/templates.exp
+++ b/gdb/testsuite/gdb.cp/templates.exp
@@ -17,7 +17,7 @@
 
 set ws "\[\r\n\t \]+"
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/typed-enum.exp b/gdb/testsuite/gdb.cp/typed-enum.exp
index 743a141f73c..59ab4bbc71a 100644
--- a/gdb/testsuite/gdb.cp/typed-enum.exp
+++ b/gdb/testsuite/gdb.cp/typed-enum.exp
@@ -15,7 +15,7 @@
 #
 # Check if unsigned typedef are handled correctly with typed enums.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/typedef-base.exp b/gdb/testsuite/gdb.cp/typedef-base.exp
index 6dc937d5986..46100d16e29 100644
--- a/gdb/testsuite/gdb.cp/typedef-base.exp
+++ b/gdb/testsuite/gdb.cp/typedef-base.exp
@@ -15,7 +15,7 @@
 #
 # Make sure that inheritance through a typedef is well handled.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/typedef-operator.exp b/gdb/testsuite/gdb.cp/typedef-operator.exp
index fe19279112e..18eaf6129bd 100644
--- a/gdb/testsuite/gdb.cp/typedef-operator.exp
+++ b/gdb/testsuite/gdb.cp/typedef-operator.exp
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/typeid.exp b/gdb/testsuite/gdb.cp/typeid.exp
index fd8e96276c5..445850d5ec6 100644
--- a/gdb/testsuite/gdb.cp/typeid.exp
+++ b/gdb/testsuite/gdb.cp/typeid.exp
@@ -15,9 +15,7 @@
 
 standard_testfile .cc
 
-if {[skip_cplus_tests]} {
-    return -1
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
diff --git a/gdb/testsuite/gdb.cp/var-tag.exp b/gdb/testsuite/gdb.cp/var-tag.exp
index 3a04dc6f5f4..8b9104d47c6 100644
--- a/gdb/testsuite/gdb.cp/var-tag.exp
+++ b/gdb/testsuite/gdb.cp/var-tag.exp
@@ -17,7 +17,7 @@
 
 # Test expressions in which variable names shadow tag names.
 
-if {[skip_cplus_tests]} { return }
+require !skip_cplus_tests
 
 standard_testfile var-tag.cc var-tag-2.cc var-tag-3.cc var-tag-4.cc
 
diff --git a/gdb/testsuite/gdb.cp/virtbase.exp b/gdb/testsuite/gdb.cp/virtbase.exp
index 1b83daf506b..8de2cc0fc9d 100644
--- a/gdb/testsuite/gdb.cp/virtbase.exp
+++ b/gdb/testsuite/gdb.cp/virtbase.exp
@@ -15,7 +15,7 @@
 
 # This file is part of the gdb testsuite.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/virtbase2.exp b/gdb/testsuite/gdb.cp/virtbase2.exp
index d55b02451bb..d7b6158f863 100644
--- a/gdb/testsuite/gdb.cp/virtbase2.exp
+++ b/gdb/testsuite/gdb.cp/virtbase2.exp
@@ -15,7 +15,7 @@
 
 # Make sure printing virtual base class data member works correctly (PR16841)
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/virtfunc.exp b/gdb/testsuite/gdb.cp/virtfunc.exp
index 8c2dc51d28a..a7e989a4871 100644
--- a/gdb/testsuite/gdb.cp/virtfunc.exp
+++ b/gdb/testsuite/gdb.cp/virtfunc.exp
@@ -18,7 +18,7 @@
 
 set nl		"\[\r\n\]+"
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/virtfunc2.exp b/gdb/testsuite/gdb.cp/virtfunc2.exp
index b2798b300e6..f47fa981d80 100644
--- a/gdb/testsuite/gdb.cp/virtfunc2.exp
+++ b/gdb/testsuite/gdb.cp/virtfunc2.exp
@@ -18,7 +18,7 @@
 
 set nl		"\[\r\n\]+"
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 load_lib "cp-support.exp"
 
diff --git a/gdb/testsuite/gdb.cp/watch-cp.exp b/gdb/testsuite/gdb.cp/watch-cp.exp
index 62bedde8d54..2876e28a15e 100644
--- a/gdb/testsuite/gdb.cp/watch-cp.exp
+++ b/gdb/testsuite/gdb.cp/watch-cp.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] || [skip_hw_watchpoint_tests]} { return }
+require !skip_cplus_tests !skip_hw_watchpoint_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.dwarf2/anon-ns-fn.exp b/gdb/testsuite/gdb.dwarf2/anon-ns-fn.exp
index 71b1a477a39..3a05bc1bbca 100644
--- a/gdb/testsuite/gdb.dwarf2/anon-ns-fn.exp
+++ b/gdb/testsuite/gdb.dwarf2/anon-ns-fn.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp
index 91fa7f919ea..099f7fef2eb 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp
@@ -18,7 +18,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
index 6c503b182b3..07da8670329 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
@@ -17,7 +17,7 @@
 # type containing a static member of the same type.
 
 # Still no C++ compiler is used.
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp
index 38133ab6e22..cf194de0127 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp
@@ -17,7 +17,7 @@
 # type containing a static member of the same type.
 
 # Still no C++ compiler is used.
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
diff --git a/gdb/testsuite/gdb.dwarf2/implptrconst.exp b/gdb/testsuite/gdb.dwarf2/implptrconst.exp
index 3c1cc7c4371..54056013498 100644
--- a/gdb/testsuite/gdb.dwarf2/implptrconst.exp
+++ b/gdb/testsuite/gdb.dwarf2/implptrconst.exp
@@ -18,7 +18,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/implptrpiece.exp b/gdb/testsuite/gdb.dwarf2/implptrpiece.exp
index 8441f3fbb96..cf2808f0b8a 100644
--- a/gdb/testsuite/gdb.dwarf2/implptrpiece.exp
+++ b/gdb/testsuite/gdb.dwarf2/implptrpiece.exp
@@ -18,7 +18,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/implref-array.exp b/gdb/testsuite/gdb.dwarf2/implref-array.exp
index e149b7caeb7..ff1b8bc92c5 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-array.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-array.exp
@@ -16,9 +16,7 @@
 # Test a C++ reference marked with DW_OP_GNU_implicit_pointer.
 # The referenced value is a global array whose location is a DW_OP_addr.
 
-if [skip_cplus_tests] {
-    return
-}
+require !skip_cplus_tests
 
 load_lib dwarf.exp
 
diff --git a/gdb/testsuite/gdb.dwarf2/implref-const.exp b/gdb/testsuite/gdb.dwarf2/implref-const.exp
index 8e2483bf542..ccd9f9eef38 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-const.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-const.exp
@@ -16,9 +16,7 @@
 # Test a C++ reference marked with DW_OP_GNU_implicit_pointer.
 # The referenced value is a DW_AT_const_value.
 
-if [skip_cplus_tests] {
-    return
-}
+require !skip_cplus_tests
 
 load_lib dwarf.exp
 
diff --git a/gdb/testsuite/gdb.dwarf2/implref-global.exp b/gdb/testsuite/gdb.dwarf2/implref-global.exp
index 9dd2bd343a0..b5552ed3766 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-global.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-global.exp
@@ -16,9 +16,7 @@
 # Test a C++ reference marked with DW_OP_GNU_implicit_pointer.
 # The referenced value is a global variable whose location is a DW_OP_addr.
 
-if [skip_cplus_tests] {
-    return
-}
+require !skip_cplus_tests
 
 load_lib dwarf.exp
 
diff --git a/gdb/testsuite/gdb.dwarf2/implref-struct.exp b/gdb/testsuite/gdb.dwarf2/implref-struct.exp
index 2e4456a902c..94db032e33f 100644
--- a/gdb/testsuite/gdb.dwarf2/implref-struct.exp
+++ b/gdb/testsuite/gdb.dwarf2/implref-struct.exp
@@ -16,9 +16,7 @@
 # Test a C++ reference marked with DW_OP_GNU_implicit_pointer.
 # The referenced value is a global struct whose location is a DW_OP_addr.
 
-if [skip_cplus_tests] {
-    return
-}
+require !skip_cplus_tests
 
 load_lib dwarf.exp
 
diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit.exp b/gdb/testsuite/gdb.dwarf2/imported-unit.exp
index 7c81c2a0a4e..fd578d6e3ca 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit.exp
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit.exp
@@ -22,9 +22,7 @@
 # on specific compiler versions or use of optimization switches, in
 # this case -flto.
 
-if [skip_cplus_tests] {
-    return
-}
+require !skip_cplus_tests
 
 load_lib dwarf.exp
 
diff --git a/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp b/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp
index 5f6b1c81c96..6f6ade33cff 100644
--- a/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp
+++ b/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp
@@ -17,7 +17,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/method-ptr.exp b/gdb/testsuite/gdb.dwarf2/method-ptr.exp
index 3998b61aa68..ff83a746eae 100644
--- a/gdb/testsuite/gdb.dwarf2/method-ptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/method-ptr.exp
@@ -17,7 +17,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp b/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp
index e4cefd061b8..24ce166b15e 100644
--- a/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp
@@ -17,7 +17,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile main.c -dw4.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/nostaticblock.exp b/gdb/testsuite/gdb.dwarf2/nostaticblock.exp
index 36f82191ca3..074b4ed59c1 100644
--- a/gdb/testsuite/gdb.dwarf2/nostaticblock.exp
+++ b/gdb/testsuite/gdb.dwarf2/nostaticblock.exp
@@ -17,7 +17,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile main.c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/nullptr_t.exp b/gdb/testsuite/gdb.dwarf2/nullptr_t.exp
index c597c660a36..e8cc5550927 100644
--- a/gdb/testsuite/gdb.dwarf2/nullptr_t.exp
+++ b/gdb/testsuite/gdb.dwarf2/nullptr_t.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.dwarf2/staticvirtual.exp b/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
index 02723cb574d..005e09cb668 100644
--- a/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
+++ b/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
@@ -17,7 +17,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/subrange.exp b/gdb/testsuite/gdb.dwarf2/subrange.exp
index 6b6e047ef01..5ef0911c5ce 100644
--- a/gdb/testsuite/gdb.dwarf2/subrange.exp
+++ b/gdb/testsuite/gdb.dwarf2/subrange.exp
@@ -17,7 +17,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile method-ptr.cc -dw.S
 
diff --git a/gdb/testsuite/gdb.guile/scm-value-cc.exp b/gdb/testsuite/gdb.guile/scm-value-cc.exp
index 487c31c2c9e..f60c7eff781 100644
--- a/gdb/testsuite/gdb.guile/scm-value-cc.exp
+++ b/gdb/testsuite/gdb.guile/scm-value-cc.exp
@@ -18,7 +18,7 @@
 
 load_lib gdb-guile.exp
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.linespec/break-ask.exp b/gdb/testsuite/gdb.linespec/break-ask.exp
index 120c399acf2..79744360eef 100644
--- a/gdb/testsuite/gdb.linespec/break-ask.exp
+++ b/gdb/testsuite/gdb.linespec/break-ask.exp
@@ -15,10 +15,7 @@
 
 standard_testfile lspec.cc
 
-if {[skip_cplus_tests]} {
-    unsupported "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 set opts {debug c++}
 set objfile1 [standard_output_file ${testfile}one.o]
diff --git a/gdb/testsuite/gdb.linespec/cpexplicit.exp b/gdb/testsuite/gdb.linespec/cpexplicit.exp
index 038c09f96fd..425d686fa56 100644
--- a/gdb/testsuite/gdb.linespec/cpexplicit.exp
+++ b/gdb/testsuite/gdb.linespec/cpexplicit.exp
@@ -15,10 +15,7 @@
 
 # Tests for explicit linespecs
 
-if {[skip_cplus_tests]} {
-    unsupported "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 standard_testfile .cc
 set exefile $testfile
diff --git a/gdb/testsuite/gdb.linespec/linespec.exp b/gdb/testsuite/gdb.linespec/linespec.exp
index cf3ce5b0597..a3c60b783f4 100644
--- a/gdb/testsuite/gdb.linespec/linespec.exp
+++ b/gdb/testsuite/gdb.linespec/linespec.exp
@@ -22,10 +22,7 @@ set exefile $testfile
 set baseone base/one/thefile.cc
 set basetwo base/two/thefile.cc
 
-if {[skip_cplus_tests]} {
-    unsupported "skipping c++ tests"
-    return
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $exefile \
 	 [list $srcfile $baseone $basetwo] \
diff --git a/gdb/testsuite/gdb.linespec/ls-dollar.exp b/gdb/testsuite/gdb.linespec/ls-dollar.exp
index 91fbb0a4a6b..c26ee31edab 100644
--- a/gdb/testsuite/gdb.linespec/ls-dollar.exp
+++ b/gdb/testsuite/gdb.linespec/ls-dollar.exp
@@ -18,10 +18,7 @@
 standard_testfile .cc
 set exefile $testfile
 
-if {[skip_cplus_tests]} {
-    unsupported "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $exefile $srcfile \
 	 {debug nowarnings c++}]} {
diff --git a/gdb/testsuite/gdb.linespec/skip-two.exp b/gdb/testsuite/gdb.linespec/skip-two.exp
index 468e39962a2..49780cb4032 100644
--- a/gdb/testsuite/gdb.linespec/skip-two.exp
+++ b/gdb/testsuite/gdb.linespec/skip-two.exp
@@ -20,10 +20,7 @@ set execfile $testfile
 set baseone base/one/thefile.cc
 set basetwo base/two/thefile.cc
 
-if {[skip_cplus_tests]} {
-    unsupported "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $execfile \
 	 [list $srcfile $baseone $basetwo] \
diff --git a/gdb/testsuite/gdb.mi/gdb792.exp b/gdb/testsuite/gdb.mi/gdb792.exp
index bd6bacf6108..c06e58215be 100644
--- a/gdb/testsuite/gdb.mi/gdb792.exp
+++ b/gdb/testsuite/gdb.mi/gdb792.exp
@@ -16,7 +16,7 @@
 # Test that children of classes are properly reported.  Regression
 # test for gdb/792.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp b/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp
index f10d028714c..318ad29205b 100644
--- a/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp
+++ b/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp
@@ -15,7 +15,7 @@
 
 # Test the -catch-throw, -catch-rethrow, and -catch-catch MI commands.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.mi/mi-inheritance-syntax-error.exp b/gdb/testsuite/gdb.mi/mi-inheritance-syntax-error.exp
index e8f507f90d5..30e40c2c580 100644
--- a/gdb/testsuite/gdb.mi/mi-inheritance-syntax-error.exp
+++ b/gdb/testsuite/gdb.mi/mi-inheritance-syntax-error.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.mi/mi-linespec-err-cp.exp b/gdb/testsuite/gdb.mi/mi-linespec-err-cp.exp
index d9999078059..151f53268e7 100644
--- a/gdb/testsuite/gdb.mi/mi-linespec-err-cp.exp
+++ b/gdb/testsuite/gdb.mi/mi-linespec-err-cp.exp
@@ -17,9 +17,7 @@
 # errors is generated when setting a breakpoint in a non-existent
 # file with a Windows-style logical drive names and C++.
 
-if {[skip_cplus_tests]} {
-    return
-}
+require !skip_cplus_tests
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.exp b/gdb/testsuite/gdb.mi/mi-var-cp.exp
index cb85b771dc7..4b27ad9b440 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cp.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-cp.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.mi/mi-var-rtti.exp b/gdb/testsuite/gdb.mi/mi-var-rtti.exp
index ad18d1ae56d..00416ba7cdf 100644
--- a/gdb/testsuite/gdb.mi/mi-var-rtti.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-rtti.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { return }
+require !skip_cplus_tests
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.python/py-explore-cc.exp b/gdb/testsuite/gdb.python/py-explore-cc.exp
index 1f4dbe2a09c..e3fa0e4d236 100644
--- a/gdb/testsuite/gdb.python/py-explore-cc.exp
+++ b/gdb/testsuite/gdb.python/py-explore-cc.exp
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests the mechanism
 # exposing values to Python.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile py-explore.cc
 
diff --git a/gdb/testsuite/gdb.python/py-rvalue-ref-value-cc.exp b/gdb/testsuite/gdb.python/py-rvalue-ref-value-cc.exp
index 11faca13fcf..8bd21a052c2 100644
--- a/gdb/testsuite/gdb.python/py-rvalue-ref-value-cc.exp
+++ b/gdb/testsuite/gdb.python/py-rvalue-ref-value-cc.exp
@@ -17,7 +17,7 @@
 # exposing rvalue reference values to Python.  It is based on
 # gdb.python/py-value-cc.exp.
 
-if {[skip_cplus_tests]} { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.python/py-template.exp b/gdb/testsuite/gdb.python/py-template.exp
index c2fd510867f..cf05f3f09c8 100644
--- a/gdb/testsuite/gdb.python/py-template.exp
+++ b/gdb/testsuite/gdb.python/py-template.exp
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests the mechanism
 # exposing values to Python.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
diff --git a/gdb/testsuite/gdb.python/py-typeprint.exp b/gdb/testsuite/gdb.python/py-typeprint.exp
index ead13f8d996..a46761d8b67 100644
--- a/gdb/testsuite/gdb.python/py-typeprint.exp
+++ b/gdb/testsuite/gdb.python/py-typeprint.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 load_lib gdb-python.exp
 load_lib cp-support.exp
diff --git a/gdb/testsuite/gdb.python/py-value-cc.exp b/gdb/testsuite/gdb.python/py-value-cc.exp
index c7e9683e2dc..cc6c257e049 100644
--- a/gdb/testsuite/gdb.python/py-value-cc.exp
+++ b/gdb/testsuite/gdb.python/py-value-cc.exp
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests the mechanism
 # exposing values to Python.
 
-if { [skip_cplus_tests] } { continue }
+require !skip_cplus_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.python/py-xmethods.exp b/gdb/testsuite/gdb.python/py-xmethods.exp
index 18057782143..f6dbc1abd68 100644
--- a/gdb/testsuite/gdb.python/py-xmethods.exp
+++ b/gdb/testsuite/gdb.python/py-xmethods.exp
@@ -18,10 +18,7 @@
 
 load_lib gdb-python.exp
 
-if { [skip_cplus_tests] } {
-    untested "skipping C++ tests"
-    return
-}
+require !skip_cplus_tests
 
 standard_testfile py-xmethods.cc
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 09/46] Use require skip_shlib_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (7 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 08/46] Use require skip_cplus_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 10/46] Use require skip_dlmopen_tests Tom Tromey
                   ` (38 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_shlib_tests".
---
 gdb/testsuite/gdb.ada/catch_ex_std.exp                 |  4 +---
 gdb/testsuite/gdb.base/bfd-errors.exp                  |  4 +---
 gdb/testsuite/gdb.base/break-probes.exp                |  4 +---
 gdb/testsuite/gdb.base/catch-load.exp                  |  5 +----
 gdb/testsuite/gdb.base/ctxobj.exp                      |  4 +---
 gdb/testsuite/gdb.base/dprintf-pending.exp             |  4 +---
 gdb/testsuite/gdb.base/dso2dso.exp                     |  4 +---
 gdb/testsuite/gdb.base/fixsection.exp                  |  4 +---
 .../gdb.base/fork-no-detach-follow-child-dlopen.exp    |  4 +---
 gdb/testsuite/gdb.base/gcore-relro.exp                 |  4 +---
 gdb/testsuite/gdb.base/gdb1555.exp                     |  4 +---
 gdb/testsuite/gdb.base/global-var-nested-by-dso.exp    |  4 +---
 gdb/testsuite/gdb.base/gnu-ifunc.exp                   |  4 +---
 gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp   |  4 +---
 gdb/testsuite/gdb.base/info-shared.exp                 |  4 +---
 gdb/testsuite/gdb.base/info_sources_2.exp              |  4 +---
 gdb/testsuite/gdb.base/jit-bfd-name.exp                |  5 +----
 gdb/testsuite/gdb.base/jit-elf-fork.exp                |  5 +----
 gdb/testsuite/gdb.base/jit-elf-so.exp                  |  5 +----
 gdb/testsuite/gdb.base/jit-elf.exp                     |  5 +----
 gdb/testsuite/gdb.base/jit-reader-simple.exp           |  5 +----
 gdb/testsuite/gdb.base/jit-reader.exp                  |  4 +---
 gdb/testsuite/gdb.base/msym-bp-shl.exp                 |  4 +---
 gdb/testsuite/gdb.base/pending.exp                     |  4 +---
 gdb/testsuite/gdb.base/print-file-var.exp              |  4 +---
 gdb/testsuite/gdb.base/print-symbol-loading.exp        |  4 +---
 gdb/testsuite/gdb.base/shlib-call.exp                  |  4 +---
 gdb/testsuite/gdb.base/shreloc.exp                     |  4 +---
 gdb/testsuite/gdb.base/so-impl-ld.exp                  |  4 +---
 gdb/testsuite/gdb.base/solib-corrupted.exp             |  4 +---
 gdb/testsuite/gdb.base/solib-disc.exp                  |  4 +---
 gdb/testsuite/gdb.base/solib-display.exp               |  4 +---
 gdb/testsuite/gdb.base/solib-nodir.exp                 |  4 +---
 gdb/testsuite/gdb.base/solib-overlap.exp               |  4 +---
 gdb/testsuite/gdb.base/solib-symbol.exp                |  4 +---
 gdb/testsuite/gdb.base/solib-vanish.exp                |  4 +---
 gdb/testsuite/gdb.base/solib-weak.exp                  |  4 +---
 gdb/testsuite/gdb.base/sym-file.exp                    |  4 +---
 gdb/testsuite/gdb.base/symtab-search-order.exp         |  4 +---
 gdb/testsuite/gdb.base/type-opaque.exp                 |  4 +---
 gdb/testsuite/gdb.base/unload.exp                      |  4 +---
 gdb/testsuite/gdb.base/watchpoint-solib.exp            |  4 +---
 gdb/testsuite/gdb.btrace/dlopen.exp                    | 10 +---------
 gdb/testsuite/gdb.compile/compile.exp                  |  5 +----
 gdb/testsuite/gdb.cp/except-multi-location.exp         |  4 +---
 gdb/testsuite/gdb.cp/infcall-dlopen.exp                |  4 +---
 gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp            |  6 +-----
 .../gdb.dwarf2/locexpr-data-member-location.exp        |  4 +---
 gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp         |  4 +---
 gdb/testsuite/gdb.mi/mi-catch-load.exp                 |  4 +---
 gdb/testsuite/gdb.mi/mi-dprintf-pending.exp            |  4 +---
 gdb/testsuite/gdb.mi/mi-pending.exp                    |  4 +---
 gdb/testsuite/gdb.mi/mi-solib.exp                      |  5 +----
 gdb/testsuite/gdb.mi/mi-var-invalidate-shlib.exp       |  4 +---
 gdb/testsuite/gdb.opt/solib-intra-step.exp             |  4 +---
 gdb/testsuite/gdb.python/py-event-load.exp             |  5 +----
 gdb/testsuite/gdb.python/py-finish-breakpoint.exp      |  5 +----
 gdb/testsuite/gdb.python/py-shared.exp                 |  4 +---
 gdb/testsuite/gdb.server/server-exec-info.exp          |  4 +---
 gdb/testsuite/gdb.server/solib-list.exp                |  4 +---
 gdb/testsuite/gdb.threads/dlopen-libpthread.exp        |  3 ++-
 gdb/testsuite/gdb.trace/change-loc.exp                 |  4 +---
 gdb/testsuite/gdb.trace/ftrace-lock.exp                |  4 +---
 gdb/testsuite/gdb.trace/ftrace.exp                     |  4 +---
 gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp      |  4 +---
 gdb/testsuite/gdb.trace/pending.exp                    |  4 +---
 gdb/testsuite/gdb.trace/range-stepping.exp             |  4 +---
 gdb/testsuite/gdb.trace/strace.exp                     |  4 +---
 gdb/testsuite/gdb.trace/trace-break.exp                |  4 +---
 gdb/testsuite/gdb.trace/trace-condition.exp            |  4 +---
 gdb/testsuite/gdb.trace/trace-enable-disable.exp       |  4 +---
 gdb/testsuite/gdb.trace/trace-mt.exp                   |  4 +---
 gdb/testsuite/gdb.trace/tspeed.exp                     |  4 +---
 73 files changed, 74 insertions(+), 235 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/catch_ex_std.exp b/gdb/testsuite/gdb.ada/catch_ex_std.exp
index 4d6f2a91c19..c8e0c288127 100644
--- a/gdb/testsuite/gdb.ada/catch_ex_std.exp
+++ b/gdb/testsuite/gdb.ada/catch_ex_std.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 load_lib "ada.exp"
 
diff --git a/gdb/testsuite/gdb.base/bfd-errors.exp b/gdb/testsuite/gdb.base/bfd-errors.exp
index e436e40ba6e..cb94dea4ae1 100644
--- a/gdb/testsuite/gdb.base/bfd-errors.exp
+++ b/gdb/testsuite/gdb.base/bfd-errors.exp
@@ -46,9 +46,7 @@
 
 # This test can't be run on targets lacking shared library support
 # or for non-ELF targets.
-if { [skip_shlib_tests] || ![is_elf_target] } {
-    return 0
-}
+require !skip_shlib_tests is_elf_target
 
 # Library file names and flags:
 set lib_basename ${::gdb_test_file_name}-lib
diff --git a/gdb/testsuite/gdb.base/break-probes.exp b/gdb/testsuite/gdb.base/break-probes.exp
index 51687c5ca68..93ac44d29a8 100644
--- a/gdb/testsuite/gdb.base/break-probes.exp
+++ b/gdb/testsuite/gdb.base/break-probes.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_shlib_tests] } {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/catch-load.exp b/gdb/testsuite/gdb.base/catch-load.exp
index f8677b0a53d..70149513e0c 100644
--- a/gdb/testsuite/gdb.base/catch-load.exp
+++ b/gdb/testsuite/gdb.base/catch-load.exp
@@ -13,10 +13,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-if {[skip_shlib_tests]} {
-    untested "skipping shared library tests"
-    return -1
-}
+require !skip_shlib_tests
 
 standard_testfile .c
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug shlib_load}] != "" } {
diff --git a/gdb/testsuite/gdb.base/ctxobj.exp b/gdb/testsuite/gdb.base/ctxobj.exp
index 228a6890f11..4c0430365e3 100644
--- a/gdb/testsuite/gdb.base/ctxobj.exp
+++ b/gdb/testsuite/gdb.base/ctxobj.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-if {[skip_shlib_tests]} {
-    return -1
-}
+require !skip_shlib_tests
 
 set executable ctxobj-m
 
diff --git a/gdb/testsuite/gdb.base/dprintf-pending.exp b/gdb/testsuite/gdb.base/dprintf-pending.exp
index 2ab8d52f146..ccaef55b510 100644
--- a/gdb/testsuite/gdb.base/dprintf-pending.exp
+++ b/gdb/testsuite/gdb.base/dprintf-pending.exp
@@ -14,9 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile
 set libfile "dprintf-pendshr"
diff --git a/gdb/testsuite/gdb.base/dso2dso.exp b/gdb/testsuite/gdb.base/dso2dso.exp
index 4c7a76d2dbe..0fd0e46b0f2 100644
--- a/gdb/testsuite/gdb.base/dso2dso.exp
+++ b/gdb/testsuite/gdb.base/dso2dso.exp
@@ -23,9 +23,7 @@
 # also happens to exercise an issue with displaced stepping on amd64
 # when libdso1 is mapped at an address greater than 0xffffffff.
 
-if { [skip_shlib_tests] } {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/fixsection.exp b/gdb/testsuite/gdb.base/fixsection.exp
index 0872017e015..3493132b332 100644
--- a/gdb/testsuite/gdb.base/fixsection.exp
+++ b/gdb/testsuite/gdb.base/fixsection.exp
@@ -14,9 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp b/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp
index e8b61450b47..91576818532 100644
--- a/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp
+++ b/gdb/testsuite/gdb.base/fork-no-detach-follow-child-dlopen.exp
@@ -23,9 +23,7 @@
 # in the source of the shlib, and "list" should display the source where
 # the program stopped.
 
-if { [skip_shlib_tests] } {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile .c -shlib.c
 set shlib_path [standard_output_file ${testfile}-lib.so]
diff --git a/gdb/testsuite/gdb.base/gcore-relro.exp b/gdb/testsuite/gdb.base/gcore-relro.exp
index 4530a9d094a..5b15c08c209 100644
--- a/gdb/testsuite/gdb.base/gcore-relro.exp
+++ b/gdb/testsuite/gdb.base/gcore-relro.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile gcore-relro-main.c
 set libfile gcore-relro-lib
diff --git a/gdb/testsuite/gdb.base/gdb1555.exp b/gdb/testsuite/gdb.base/gdb1555.exp
index 1d603ab94c0..aef6af0eae1 100644
--- a/gdb/testsuite/gdb.base/gdb1555.exp
+++ b/gdb/testsuite/gdb.base/gdb1555.exp
@@ -17,9 +17,7 @@
 # a shared library (PR gdb/1555, was PR shlib/1280, shlib/1237).
 # Tested on ppc-yellowdog-linux (Yellow Dog Linux 3.0 3.2.2-2a)
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile gdb1555-main.c gdb1555.c
 
diff --git a/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp b/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp
index ff9414e63b9..7839c3cfd36 100644
--- a/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp
+++ b/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_shlib_tests] } {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/gnu-ifunc.exp b/gdb/testsuite/gdb.base/gnu-ifunc.exp
index 715f5be04cb..f875443d830 100644
--- a/gdb/testsuite/gdb.base/gnu-ifunc.exp
+++ b/gdb/testsuite/gdb.base/gnu-ifunc.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 if {[skip_ifunc_tests]} {
     return 0
diff --git a/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp b/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp
index 4836e133107..a4fcca876b9 100644
--- a/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp
+++ b/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp
@@ -17,9 +17,7 @@
 # when the target doesn't support hw breakpoints doesn't silently
 # error out without informing the user.
 
-if {[skip_shlib_tests]} {
-    return -1
-}
+require !skip_shlib_tests
 
 set main_src hbreak-in-shr-unsupported.c
 set lib_src hbreak-in-shr-unsupported-shr.c
diff --git a/gdb/testsuite/gdb.base/info-shared.exp b/gdb/testsuite/gdb.base/info-shared.exp
index 8d3484b186c..a520e4d18d3 100644
--- a/gdb/testsuite/gdb.base/info-shared.exp
+++ b/gdb/testsuite/gdb.base/info-shared.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_shlib_tests] } {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/info_sources_2.exp b/gdb/testsuite/gdb.base/info_sources_2.exp
index 9fe3d479018..7a6a10b6435 100644
--- a/gdb/testsuite/gdb.base/info_sources_2.exp
+++ b/gdb/testsuite/gdb.base/info_sources_2.exp
@@ -16,9 +16,7 @@
 # Test 'info sources' when the test file makes use of a shared
 # library.
 
-if { [skip_shlib_tests] } {
-    return 0
-}
+require !skip_shlib_tests
 
 set is_remote_target [is_remote target]
 
diff --git a/gdb/testsuite/gdb.base/jit-bfd-name.exp b/gdb/testsuite/gdb.base/jit-bfd-name.exp
index 7c8ad50d072..03039eeea39 100644
--- a/gdb/testsuite/gdb.base/jit-bfd-name.exp
+++ b/gdb/testsuite/gdb.base/jit-bfd-name.exp
@@ -20,10 +20,7 @@
 # Additionally, check that GDB cau use 'dump binary memory' to write
 # out the in-memory JIT files.
 
-if {[skip_shlib_tests]} {
-    untested "skipping shared library tests"
-    return -1
-}
+require !skip_shlib_tests
 
 load_lib jit-elf-helpers.exp
 
diff --git a/gdb/testsuite/gdb.base/jit-elf-fork.exp b/gdb/testsuite/gdb.base/jit-elf-fork.exp
index a8e85b30e1b..17a1bcaba73 100644
--- a/gdb/testsuite/gdb.base/jit-elf-fork.exp
+++ b/gdb/testsuite/gdb.base/jit-elf-fork.exp
@@ -15,10 +15,7 @@
 
 # Test fork handling of an inferior that has JIT-ed objfiles.
 
-if {[skip_shlib_tests]} {
-    untested "skipping shared library tests"
-    return -1
-}
+require !skip_shlib_tests
 
 load_lib jit-elf-helpers.exp
 
diff --git a/gdb/testsuite/gdb.base/jit-elf-so.exp b/gdb/testsuite/gdb.base/jit-elf-so.exp
index d5f56600701..c3e357785a6 100644
--- a/gdb/testsuite/gdb.base/jit-elf-so.exp
+++ b/gdb/testsuite/gdb.base/jit-elf-so.exp
@@ -16,10 +16,7 @@
 # The same tests as in jit.exp, but loading JITer itself from a shared
 # library.
 
-if {[skip_shlib_tests]} {
-    untested "skipping shared library tests"
-    return -1
-}
+require !skip_shlib_tests
 
 load_lib jit-elf-helpers.exp
 
diff --git a/gdb/testsuite/gdb.base/jit-elf.exp b/gdb/testsuite/gdb.base/jit-elf.exp
index 0753072974f..eaa30b69399 100644
--- a/gdb/testsuite/gdb.base/jit-elf.exp
+++ b/gdb/testsuite/gdb.base/jit-elf.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_shlib_tests]} {
-    untested "skipping shared library tests"
-    return -1
-}
+require !skip_shlib_tests
 
 load_lib jit-elf-helpers.exp
 
diff --git a/gdb/testsuite/gdb.base/jit-reader-simple.exp b/gdb/testsuite/gdb.base/jit-reader-simple.exp
index a8b632628e4..75193c2bcc2 100644
--- a/gdb/testsuite/gdb.base/jit-reader-simple.exp
+++ b/gdb/testsuite/gdb.base/jit-reader-simple.exp
@@ -24,10 +24,7 @@
 # For completeness, also test when the JIT descriptor does not change
 # address between runs.
 
-if {[skip_shlib_tests]} {
-    untested "skipping shared library tests"
-    return -1
-}
+require !skip_shlib_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/jit-reader.exp b/gdb/testsuite/gdb.base/jit-reader.exp
index a66896dda67..bda31fef0a6 100644
--- a/gdb/testsuite/gdb.base/jit-reader.exp
+++ b/gdb/testsuite/gdb.base/jit-reader.exp
@@ -22,9 +22,7 @@ if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) || ![is_lp64_target] } {
     return -1;
 }
 
-if {[skip_shlib_tests]} {
-    return -1
-}
+require !skip_shlib_tests
 
 if { ![isnative] } {
     return -1
diff --git a/gdb/testsuite/gdb.base/msym-bp-shl.exp b/gdb/testsuite/gdb.base/msym-bp-shl.exp
index 42adcb191dd..fdf22269c79 100644
--- a/gdb/testsuite/gdb.base/msym-bp-shl.exp
+++ b/gdb/testsuite/gdb.base/msym-bp-shl.exp
@@ -18,9 +18,7 @@
 # static function named "foo" exists in the shared library.  Tests
 # both with and without debug info.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile msym-bp-shl-main.c msym-bp-shl-main-2.c msym-bp-shl-lib.c
 set srcfile ${srcdir}/${subdir}/${srcfile}
diff --git a/gdb/testsuite/gdb.base/pending.exp b/gdb/testsuite/gdb.base/pending.exp
index 1de35ea9927..3227675a156 100644
--- a/gdb/testsuite/gdb.base/pending.exp
+++ b/gdb/testsuite/gdb.base/pending.exp
@@ -19,9 +19,7 @@
 # test running programs
 #
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile .c
 set libfile "pendshr"
diff --git a/gdb/testsuite/gdb.base/print-file-var.exp b/gdb/testsuite/gdb.base/print-file-var.exp
index 841eb22d957..136e4d362aa 100644
--- a/gdb/testsuite/gdb.base/print-file-var.exp
+++ b/gdb/testsuite/gdb.base/print-file-var.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-if {[skip_shlib_tests]} {
-    return -1
-}
+require !skip_shlib_tests
 
 proc test {hidden dlopen version_id_main lang} {
     global srcdir subdir
diff --git a/gdb/testsuite/gdb.base/print-symbol-loading.exp b/gdb/testsuite/gdb.base/print-symbol-loading.exp
index 6de1a748d28..76c19b3c047 100644
--- a/gdb/testsuite/gdb.base/print-symbol-loading.exp
+++ b/gdb/testsuite/gdb.base/print-symbol-loading.exp
@@ -15,9 +15,7 @@
 
 # Test the "print symbol-loading" option.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile print-symbol-loading-main.c
 set libfile print-symbol-loading-lib
diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index b148e91520e..26e0e6e5c48 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -29,9 +29,7 @@
 #prop lib shr2.sl
 
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 if { [is_remote host] } {
     gdb_remote_download host $srcdir/$subdir/ss.h
diff --git a/gdb/testsuite/gdb.base/shreloc.exp b/gdb/testsuite/gdb.base/shreloc.exp
index ad10d5f3497..326a826d78b 100644
--- a/gdb/testsuite/gdb.base/shreloc.exp
+++ b/gdb/testsuite/gdb.base/shreloc.exp
@@ -19,9 +19,7 @@
 # them gets relocated at load-time. Check that gdb gets the right
 # values for the debugging and minimal symbols.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 #
 # This file uses shreloc.c, shreloc1.c and shreloc2.c
diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp
index 1822c03138c..8448617f6e3 100644
--- a/gdb/testsuite/gdb.base/so-impl-ld.exp
+++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
@@ -14,9 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile .c
 set libfile "solib1"
diff --git a/gdb/testsuite/gdb.base/solib-corrupted.exp b/gdb/testsuite/gdb.base/solib-corrupted.exp
index d65c32cad9c..594432acbc0 100644
--- a/gdb/testsuite/gdb.base/solib-corrupted.exp
+++ b/gdb/testsuite/gdb.base/solib-corrupted.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 if {[is_remote target]} {
     # gdbserver prints the warning message but expect is parsing only the GDB
diff --git a/gdb/testsuite/gdb.base/solib-disc.exp b/gdb/testsuite/gdb.base/solib-disc.exp
index 2433425bf00..c4de2e01ef0 100644
--- a/gdb/testsuite/gdb.base/solib-disc.exp
+++ b/gdb/testsuite/gdb.base/solib-disc.exp
@@ -15,9 +15,7 @@
 
 # Test connecting and disconnecting at shared library events.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 set gdbserver_reconnect_p 1
 if { [info proc gdb_reconnect] == "" } {
diff --git a/gdb/testsuite/gdb.base/solib-display.exp b/gdb/testsuite/gdb.base/solib-display.exp
index 6da4b8d4d4a..79e46865eba 100644
--- a/gdb/testsuite/gdb.base/solib-display.exp
+++ b/gdb/testsuite/gdb.base/solib-display.exp
@@ -28,9 +28,7 @@
 # (and thus aren't affected by shared library unloading) are not
 # disabled prematurely.
 
-if { [skip_shlib_tests] } {
-    return 0
-}
+require !skip_shlib_tests
 
 # This test is currently not supported for stub targets, because it uses the
 # start command (through gdb_start_cmd).  In theory, it could be changed to
diff --git a/gdb/testsuite/gdb.base/solib-nodir.exp b/gdb/testsuite/gdb.base/solib-nodir.exp
index c687b7eb511..b97064911dd 100644
--- a/gdb/testsuite/gdb.base/solib-nodir.exp
+++ b/gdb/testsuite/gdb.base/solib-nodir.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-if [skip_shlib_tests] {
-    return
-}
+require !skip_shlib_tests
 
 # The testcase assumes the target can access the OBJDIR.
 if [is_remote target] {
diff --git a/gdb/testsuite/gdb.base/solib-overlap.exp b/gdb/testsuite/gdb.base/solib-overlap.exp
index 3d9110baf2c..51378826657 100644
--- a/gdb/testsuite/gdb.base/solib-overlap.exp
+++ b/gdb/testsuite/gdb.base/solib-overlap.exp
@@ -27,9 +27,7 @@
 #   difference appears to be caused by prelink, adjusting expectations
 # In such case both disk libraries will be loaded at VMAs starting at zero.
 
-if [skip_shlib_tests] {
-    return 0
-}
+require !skip_shlib_tests
 
 if {![can_spawn_for_attach]} {
     return 0
diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp
index ff812a7e87b..04cbffa4a59 100644
--- a/gdb/testsuite/gdb.base/solib-symbol.exp
+++ b/gdb/testsuite/gdb.base/solib-symbol.exp
@@ -15,9 +15,7 @@
 # Contributed by Markus Deuling <deuling@de.ibm.com>.
 #
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 # Library file.
 set libname "solib-symbol-lib"
diff --git a/gdb/testsuite/gdb.base/solib-vanish.exp b/gdb/testsuite/gdb.base/solib-vanish.exp
index 57e0b684dc8..1942f4487b2 100644
--- a/gdb/testsuite/gdb.base/solib-vanish.exp
+++ b/gdb/testsuite/gdb.base/solib-vanish.exp
@@ -53,9 +53,7 @@
 # 1) GDB does not segfault when stepping
 # 2) The stack frame is printed
 
-if { [skip_shlib_tests] } {
-    return 0
-}
+require !skip_shlib_tests
 
 # Library 2
 set lib2name "solib-vanish-lib2"
diff --git a/gdb/testsuite/gdb.base/solib-weak.exp b/gdb/testsuite/gdb.base/solib-weak.exp
index a8a9fc915b3..68d34c0bea2 100644
--- a/gdb/testsuite/gdb.base/solib-weak.exp
+++ b/gdb/testsuite/gdb.base/solib-weak.exp
@@ -17,9 +17,7 @@
 # than one shared library, when one of the implementations is a "weak"
 # symbol.  GDB should set a breakpoint at the first copy it finds.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 # These targets have shared libraries, but weak symbols are not meaningful.
 if {([istarget *-*-mingw*]
diff --git a/gdb/testsuite/gdb.base/sym-file.exp b/gdb/testsuite/gdb.base/sym-file.exp
index c73facb1658..b93e99ed9a3 100644
--- a/gdb/testsuite/gdb.base/sym-file.exp
+++ b/gdb/testsuite/gdb.base/sym-file.exp
@@ -33,9 +33,7 @@ if {![is_elf_target]} {
     return 0
 }
 
-if [skip_shlib_tests] {
-    return 0
-}
+require !skip_shlib_tests
 
 set target_size TARGET_UNKNOWN
 if {[is_lp64_target]} {
diff --git a/gdb/testsuite/gdb.base/symtab-search-order.exp b/gdb/testsuite/gdb.base/symtab-search-order.exp
index d811af3cdec..bae7f8e458a 100644
--- a/gdb/testsuite/gdb.base/symtab-search-order.exp
+++ b/gdb/testsuite/gdb.base/symtab-search-order.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile .c symtab-search-order-1.c symtab-search-order-shlib-1.c
 set srcfile  $srcdir/$subdir/$srcfile
diff --git a/gdb/testsuite/gdb.base/type-opaque.exp b/gdb/testsuite/gdb.base/type-opaque.exp
index 35ccfb7ec68..6ec51802ef5 100644
--- a/gdb/testsuite/gdb.base/type-opaque.exp
+++ b/gdb/testsuite/gdb.base/type-opaque.exp
@@ -15,9 +15,7 @@
 
 # Test resolving of an opaque type from the loaded shared library.
 
-if {[skip_shlib_tests]} {
-    return -1
-}
+require !skip_shlib_tests
 
 standard_testfile type-opaque-main.c
 
diff --git a/gdb/testsuite/gdb.base/unload.exp b/gdb/testsuite/gdb.base/unload.exp
index 0a66814ac3f..9c5ad2e16fb 100644
--- a/gdb/testsuite/gdb.base/unload.exp
+++ b/gdb/testsuite/gdb.base/unload.exp
@@ -19,9 +19,7 @@
 # test running programs
 #
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 set testfile "unload"
 set libfile "unloadshr"
diff --git a/gdb/testsuite/gdb.base/watchpoint-solib.exp b/gdb/testsuite/gdb.base/watchpoint-solib.exp
index a3fb5041294..1325a8fa40d 100644
--- a/gdb/testsuite/gdb.base/watchpoint-solib.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-solib.exp
@@ -26,9 +26,7 @@ set skip_hw_watchpoint_tests_p [skip_hw_watchpoint_tests]
 #
 
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 set testfile "watchpoint-solib"
 set libfile "watchpoint-solib-shr"
diff --git a/gdb/testsuite/gdb.btrace/dlopen.exp b/gdb/testsuite/gdb.btrace/dlopen.exp
index 3557be98662..e9bd54dac90 100644
--- a/gdb/testsuite/gdb.btrace/dlopen.exp
+++ b/gdb/testsuite/gdb.btrace/dlopen.exp
@@ -15,15 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
-
-if { [skip_shlib_tests]  } {
-    unsupported "target does not support shared library tests"
-    return -1
-}
+require !skip_btrace_tests !skip_shlib_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp
index b75ec4bd485..236b59fa385 100644
--- a/gdb/testsuite/gdb.compile/compile.exp
+++ b/gdb/testsuite/gdb.compile/compile.exp
@@ -366,10 +366,7 @@ if { $srcfile3 != "" } {
 
 # Shared library tests.
 
-if {[skip_shlib_tests]} {
-    untested "skipping shlib tests"
-    return;
-}
+require !skip_shlib_tests
 
 set libbin [standard_output_file ${testfile}-shlib.so]
 set binfile [standard_output_file ${testfile}-shlib]
diff --git a/gdb/testsuite/gdb.cp/except-multi-location.exp b/gdb/testsuite/gdb.cp/except-multi-location.exp
index a81a169c999..2dd457860d2 100644
--- a/gdb/testsuite/gdb.cp/except-multi-location.exp
+++ b/gdb/testsuite/gdb.cp/except-multi-location.exp
@@ -19,9 +19,7 @@
 # on the libstc++.so DSO (which is how GDB was built and revealed the
 # bug), and vice versa.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 # STATIC_BIN indicates whether to build the main binary with
 # -static-libgcc/-static-libstdc++.  STATIC_LIB is the same, but for
diff --git a/gdb/testsuite/gdb.cp/infcall-dlopen.exp b/gdb/testsuite/gdb.cp/infcall-dlopen.exp
index 0ca53ef872e..0978c30e007 100644
--- a/gdb/testsuite/gdb.cp/infcall-dlopen.exp
+++ b/gdb/testsuite/gdb.cp/infcall-dlopen.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile .cc infcall-dlopen-lib.cc
 set libfile [standard_output_file ${testfile}.so]
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp b/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp
index 5248da6e491..7d06bd53b99 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp
@@ -19,11 +19,7 @@
 load_lib dwarf.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-if {[skip_shlib_tests]} {
-    return 0
-}
+require dwarf2_support !skip_shlib_tests
 
 standard_testfile .c -shlib.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
index 270a03b7568..3decad78c2e 100644
--- a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
+++ b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
@@ -49,9 +49,7 @@
 # which is then used by a shared object.
 
 # This test can't be run on targets lacking shared library support.
-if [skip_shlib_tests] {
-    return 0
-}
+require !skip_shlib_tests
 
 load_lib dwarf.exp
 
diff --git a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
index b71ea35d3c8..9757b057042 100644
--- a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
+++ b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 load_lib mi-support.exp
 
diff --git a/gdb/testsuite/gdb.mi/mi-catch-load.exp b/gdb/testsuite/gdb.mi/mi-catch-load.exp
index 354168bd975..72df7e21d04 100644
--- a/gdb/testsuite/gdb.mi/mi-catch-load.exp
+++ b/gdb/testsuite/gdb.mi/mi-catch-load.exp
@@ -14,9 +14,7 @@
 #
 load_lib mi-support.exp
 
-if {[skip_shlib_tests]} {
-    return -1
-}
+require !skip_shlib_tests
 
 standard_testfile mi-catch-load.c
 
diff --git a/gdb/testsuite/gdb.mi/mi-dprintf-pending.exp b/gdb/testsuite/gdb.mi/mi-dprintf-pending.exp
index 0e77735f682..b79bec3e5f9 100644
--- a/gdb/testsuite/gdb.mi/mi-dprintf-pending.exp
+++ b/gdb/testsuite/gdb.mi/mi-dprintf-pending.exp
@@ -19,9 +19,7 @@
 
 load_lib mi-support.exp
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile mi-dprintf-pending.c
 
diff --git a/gdb/testsuite/gdb.mi/mi-pending.exp b/gdb/testsuite/gdb.mi/mi-pending.exp
index cfb4a3a99f2..d3771f6b39a 100644
--- a/gdb/testsuite/gdb.mi/mi-pending.exp
+++ b/gdb/testsuite/gdb.mi/mi-pending.exp
@@ -20,9 +20,7 @@ set MIFLAGS "-i=mi"
 # test running programs
 #
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile mi-pending.c
 
diff --git a/gdb/testsuite/gdb.mi/mi-solib.exp b/gdb/testsuite/gdb.mi/mi-solib.exp
index 37c203b04e0..98365165eb0 100644
--- a/gdb/testsuite/gdb.mi/mi-solib.exp
+++ b/gdb/testsuite/gdb.mi/mi-solib.exp
@@ -16,10 +16,7 @@
 load_lib mi-support.exp
 set MIFLAGS "-i=mi2"
 
-if {[skip_shlib_tests]} {
-    untested "skipping shared library tests"
-    return -1
-}
+require !skip_shlib_tests
 
 gdb_exit
 if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-var-invalidate-shlib.exp b/gdb/testsuite/gdb.mi/mi-var-invalidate-shlib.exp
index 7d1938880f9..1ada1f56472 100644
--- a/gdb/testsuite/gdb.mi/mi-var-invalidate-shlib.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-invalidate-shlib.exp
@@ -20,9 +20,7 @@
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
-if { [skip_shlib_tests] } {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile .c -lib.c
 set shlib_path [standard_output_file ${testfile}-lib.so]
diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp b/gdb/testsuite/gdb.opt/solib-intra-step.exp
index 9306ced85c8..6a995a6375a 100644
--- a/gdb/testsuite/gdb.opt/solib-intra-step.exp
+++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp
@@ -15,9 +15,7 @@
 
 standard_testfile
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 # Library file.
 set libname "${testfile}-lib"
diff --git a/gdb/testsuite/gdb.python/py-event-load.exp b/gdb/testsuite/gdb.python/py-event-load.exp
index f7aeb5f33fb..8503af0ef78 100644
--- a/gdb/testsuite/gdb.python/py-event-load.exp
+++ b/gdb/testsuite/gdb.python/py-event-load.exp
@@ -18,10 +18,7 @@
 
 load_lib gdb-python.exp
 
-if {[skip_shlib_tests]} {
-    untested "skipping shared library tests"
-    return -1
-}
+require !skip_shlib_tests
 
 if {[get_compiler_info]} {
     warning "Could not get compiler info"
diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
index 2f6c2f78e67..e8cc3be0cfe 100644
--- a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
@@ -16,10 +16,7 @@
 # This file is part of the GDB testsuite.  It tests the mechanism
 # exposing values to Python.
 
-if {[skip_shlib_tests]} {
-	untested "skipping shared library tests"
-    return 0
-}
+require !skip_shlib_tests
 
 load_lib gdb-python.exp
 
diff --git a/gdb/testsuite/gdb.python/py-shared.exp b/gdb/testsuite/gdb.python/py-shared.exp
index 8dfd53acd26..1b82e694046 100644
--- a/gdb/testsuite/gdb.python/py-shared.exp
+++ b/gdb/testsuite/gdb.python/py-shared.exp
@@ -17,9 +17,7 @@
 
 load_lib gdb-python.exp
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.server/server-exec-info.exp b/gdb/testsuite/gdb.server/server-exec-info.exp
index 8ab33af3364..68dc65c5376 100644
--- a/gdb/testsuite/gdb.server/server-exec-info.exp
+++ b/gdb/testsuite/gdb.server/server-exec-info.exp
@@ -18,9 +18,7 @@ load_lib gdbserver-support.exp
 # We test for skip_shlib_tests in this test because without a main
 # exec file we only have the exec target loaded if shared libraries
 # are present.
-if {[skip_gdbserver_tests] || [skip_shlib_tests]} {
-    return
-}
+require !skip_gdbserver_tests !skip_shlib_tests
 
 standard_testfile server.c
 if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] {
diff --git a/gdb/testsuite/gdb.server/solib-list.exp b/gdb/testsuite/gdb.server/solib-list.exp
index 9c99107af4e..7cbc4a941b9 100644
--- a/gdb/testsuite/gdb.server/solib-list.exp
+++ b/gdb/testsuite/gdb.server/solib-list.exp
@@ -23,9 +23,7 @@
 load_lib gdbserver-support.exp
 load_lib prelink-support.exp
 
-if {[skip_gdbserver_tests] || [skip_shlib_tests]} {
-    return
-}
+require !skip_gdbserver_tests !skip_shlib_tests
 
 standard_testfile solib-list-main.c
 set srclibfile ${testfile}-lib.c
diff --git a/gdb/testsuite/gdb.threads/dlopen-libpthread.exp b/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
index 5c3d8a34c30..0c871b3b84d 100644
--- a/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
+++ b/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
@@ -13,7 +13,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {![isnative] || ![istarget *-linux*] || [skip_shlib_tests]} {
+require isnative !skip_shlib_tests
+if {![istarget *-linux*]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.trace/change-loc.exp
index 4710b8d0952..371fa7cca14 100644
--- a/gdb/testsuite/gdb.trace/change-loc.exp
+++ b/gdb/testsuite/gdb.trace/change-loc.exp
@@ -14,9 +14,7 @@
 
 load_lib "trace-support.exp"
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 if ![gdb_trace_common_supports_arch] {
     unsupported "no trace-common.h support for arch"
diff --git a/gdb/testsuite/gdb.trace/ftrace-lock.exp b/gdb/testsuite/gdb.trace/ftrace-lock.exp
index 7611e79074d..48cbe21397d 100644
--- a/gdb/testsuite/gdb.trace/ftrace-lock.exp
+++ b/gdb/testsuite/gdb.trace/ftrace-lock.exp
@@ -14,9 +14,7 @@
 
 load_lib "trace-support.exp"
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile
 set executable $testfile
diff --git a/gdb/testsuite/gdb.trace/ftrace.exp b/gdb/testsuite/gdb.trace/ftrace.exp
index c32211a9d54..79fa6d3e924 100644
--- a/gdb/testsuite/gdb.trace/ftrace.exp
+++ b/gdb/testsuite/gdb.trace/ftrace.exp
@@ -14,9 +14,7 @@
 
 load_lib "trace-support.exp"
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile
 set executable $testfile
diff --git a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
index abf5fec1ba2..f4b0b0ecead 100644
--- a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
+++ b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
@@ -15,9 +15,7 @@
 
 load_lib trace-support.exp
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 if ![gdb_trace_common_supports_arch] {
     unsupported "no trace-common.h support for arch"
     return -1
diff --git a/gdb/testsuite/gdb.trace/pending.exp b/gdb/testsuite/gdb.trace/pending.exp
index 7950fe86a4b..4ef0e5b4df2 100644
--- a/gdb/testsuite/gdb.trace/pending.exp
+++ b/gdb/testsuite/gdb.trace/pending.exp
@@ -14,9 +14,7 @@
 
 load_lib "trace-support.exp"
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 if ![gdb_trace_common_supports_arch] {
     unsupported "no trace-common.h support for arch"
diff --git a/gdb/testsuite/gdb.trace/range-stepping.exp b/gdb/testsuite/gdb.trace/range-stepping.exp
index 1a543e5b070..8ed11d52139 100644
--- a/gdb/testsuite/gdb.trace/range-stepping.exp
+++ b/gdb/testsuite/gdb.trace/range-stepping.exp
@@ -65,9 +65,7 @@ proc range_stepping_with_tracepoint { type } {
 
 range_stepping_with_tracepoint "trace"
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 set libipa [get_in_proc_agent]
 set remote_libipa [gdb_load_shlib $libipa]
diff --git a/gdb/testsuite/gdb.trace/strace.exp b/gdb/testsuite/gdb.trace/strace.exp
index 2e754891903..fd3d39d229d 100644
--- a/gdb/testsuite/gdb.trace/strace.exp
+++ b/gdb/testsuite/gdb.trace/strace.exp
@@ -14,9 +14,7 @@
 
 load_lib "trace-support.exp"
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile
 set executable $testfile
diff --git a/gdb/testsuite/gdb.trace/trace-break.exp b/gdb/testsuite/gdb.trace/trace-break.exp
index 8d80bdd909e..c3227494c45 100644
--- a/gdb/testsuite/gdb.trace/trace-break.exp
+++ b/gdb/testsuite/gdb.trace/trace-break.exp
@@ -345,9 +345,7 @@ foreach at_first_loc { "1" "0" } {
 break_trace_same_addr_6 "trace" "enable" "trace" "disable"
 break_trace_same_addr_6 "trace" "disable" "trace" "enable"
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 set libipa [get_in_proc_agent]
 set remote_libipa [gdb_load_shlib $libipa]
diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp
index ec0b5a186fa..6b0e6f80746 100644
--- a/gdb/testsuite/gdb.trace/trace-condition.exp
+++ b/gdb/testsuite/gdb.trace/trace-condition.exp
@@ -14,9 +14,7 @@
 
 load_lib "trace-support.exp"
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile
 set executable $testfile
diff --git a/gdb/testsuite/gdb.trace/trace-enable-disable.exp b/gdb/testsuite/gdb.trace/trace-enable-disable.exp
index 813e2ea4a16..e477ad6152b 100644
--- a/gdb/testsuite/gdb.trace/trace-enable-disable.exp
+++ b/gdb/testsuite/gdb.trace/trace-enable-disable.exp
@@ -14,9 +14,7 @@
 
 load_lib "trace-support.exp"
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 standard_testfile
 set executable $testfile
diff --git a/gdb/testsuite/gdb.trace/trace-mt.exp b/gdb/testsuite/gdb.trace/trace-mt.exp
index eba46f776a0..daf674a1c6d 100644
--- a/gdb/testsuite/gdb.trace/trace-mt.exp
+++ b/gdb/testsuite/gdb.trace/trace-mt.exp
@@ -108,9 +108,7 @@ foreach break_always_inserted { "on" "off" } {
 
 step_over_tracepoint "trace"
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 set libipa [get_in_proc_agent]
 set remote_libipa [gdb_load_shlib $libipa]
diff --git a/gdb/testsuite/gdb.trace/tspeed.exp b/gdb/testsuite/gdb.trace/tspeed.exp
index 80ec962c042..f2be6e54186 100644
--- a/gdb/testsuite/gdb.trace/tspeed.exp
+++ b/gdb/testsuite/gdb.trace/tspeed.exp
@@ -15,9 +15,7 @@
 
 load_lib "trace-support.exp"
 
-if {[skip_shlib_tests]} {
-    return 0
-}
+require !skip_shlib_tests
 
 # Do not run if gdbsever debug is enabled - the output file is many Gb.
 if [gdbserver_debug_enabled] {
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 10/46] Use require skip_dlmopen_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (8 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 09/46] Use require skip_shlib_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 11/46] Use require skip_stl_tests Tom Tromey
                   ` (37 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_dlmopen_tests".
---
 gdb/testsuite/gdb.base/dlmopen.exp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.base/dlmopen.exp b/gdb/testsuite/gdb.base/dlmopen.exp
index 31f74008f10..e8793fbd46d 100644
--- a/gdb/testsuite/gdb.base/dlmopen.exp
+++ b/gdb/testsuite/gdb.base/dlmopen.exp
@@ -21,10 +21,7 @@
 # We test that GDB shows the correct number of instances of the libraries
 # the test loaded while unloading them one-by-one.
 
-if { [skip_dlmopen_tests] } {
-    unsupported "target does not support dlmopen debugging"
-    return -1
-}
+require !skip_dlmopen_tests
 
 standard_testfile
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 11/46] Use require skip_stl_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (9 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 10/46] Use require skip_dlmopen_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 12/46] Use require skip_rust_tests Tom Tromey
                   ` (36 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_stl_tests".
---
 gdb/testsuite/gdb.cp/bs15503.exp      | 2 +-
 gdb/testsuite/gdb.cp/exception.exp    | 2 +-
 gdb/testsuite/gdb.cp/mb-templates.exp | 2 +-
 gdb/testsuite/gdb.cp/try_catch.exp    | 2 +-
 gdb/testsuite/gdb.cp/userdef.exp      | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/testsuite/gdb.cp/bs15503.exp b/gdb/testsuite/gdb.cp/bs15503.exp
index b50333fc4b4..d4a35db0fd7 100644
--- a/gdb/testsuite/gdb.cp/bs15503.exp
+++ b/gdb/testsuite/gdb.cp/bs15503.exp
@@ -17,7 +17,7 @@
 # This file was written by Sue Kimura (sue_kimura@hp.com)
 # Rewritten by Michael Chastain (mec.gnu@mindspring.com)
 
-if { [skip_stl_tests] } { return }
+require !skip_stl_tests
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.cp/exception.exp b/gdb/testsuite/gdb.cp/exception.exp
index 7970b8cc115..993c19ff3dd 100644
--- a/gdb/testsuite/gdb.cp/exception.exp
+++ b/gdb/testsuite/gdb.cp/exception.exp
@@ -33,7 +33,7 @@
 set ws	"\[\r\n\t \]+"
 set nl	"\[\r\n\]+"
 
-if { [skip_stl_tests] } { return }
+require !skip_stl_tests
 
 standard_testfile .cc
  
diff --git a/gdb/testsuite/gdb.cp/mb-templates.exp b/gdb/testsuite/gdb.cp/mb-templates.exp
index 72476d0c6f7..6873d44080d 100644
--- a/gdb/testsuite/gdb.cp/mb-templates.exp
+++ b/gdb/testsuite/gdb.cp/mb-templates.exp
@@ -16,7 +16,7 @@
 # This test verifies that setting breakpoint on line in template
 # function will fire in all instantiations of that template.
 
-if { [skip_stl_tests] } { continue }
+require !skip_stl_tests
 
 
 standard_testfile .cc
diff --git a/gdb/testsuite/gdb.cp/try_catch.exp b/gdb/testsuite/gdb.cp/try_catch.exp
index 25c20409990..ad51e2042a8 100644
--- a/gdb/testsuite/gdb.cp/try_catch.exp
+++ b/gdb/testsuite/gdb.cp/try_catch.exp
@@ -18,7 +18,7 @@
 
 # This file is part of the gdb testsuite
 
-if { [skip_stl_tests] } { return }
+require !skip_stl_tests
 
 #
 # test running programs
diff --git a/gdb/testsuite/gdb.cp/userdef.exp b/gdb/testsuite/gdb.cp/userdef.exp
index 0245a6ee9d7..6889d1f0bb7 100644
--- a/gdb/testsuite/gdb.cp/userdef.exp
+++ b/gdb/testsuite/gdb.cp/userdef.exp
@@ -19,7 +19,7 @@
 # source file "userdef.cc"
 #
 
-if { [skip_stl_tests] } { return }
+require !skip_stl_tests
 
 standard_testfile .cc
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 12/46] Use require skip_rust_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (10 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 11/46] Use require skip_stl_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 13/46] Use require skip_fortran_tests Tom Tromey
                   ` (35 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_rust_tests".
---
 gdb/testsuite/gdb.rust/dwindex.exp    | 4 +---
 gdb/testsuite/gdb.rust/expr.exp       | 2 +-
 gdb/testsuite/gdb.rust/fnfield.exp    | 4 +---
 gdb/testsuite/gdb.rust/generics.exp   | 4 +---
 gdb/testsuite/gdb.rust/methods.exp    | 4 +---
 gdb/testsuite/gdb.rust/modules.exp    | 4 +---
 gdb/testsuite/gdb.rust/pp.exp         | 4 +---
 gdb/testsuite/gdb.rust/rawids.exp     | 4 +---
 gdb/testsuite/gdb.rust/rust-style.exp | 4 +---
 gdb/testsuite/gdb.rust/simple.exp     | 4 +---
 gdb/testsuite/gdb.rust/traits.exp     | 4 +---
 gdb/testsuite/gdb.rust/unicode.exp    | 4 +---
 gdb/testsuite/gdb.rust/union.exp      | 4 +---
 gdb/testsuite/gdb.rust/unsized.exp    | 4 +---
 gdb/testsuite/gdb.rust/watch.exp      | 4 +---
 15 files changed, 15 insertions(+), 43 deletions(-)

diff --git a/gdb/testsuite/gdb.rust/dwindex.exp b/gdb/testsuite/gdb.rust/dwindex.exp
index 09001cbba0f..a21c4a20242 100644
--- a/gdb/testsuite/gdb.rust/dwindex.exp
+++ b/gdb/testsuite/gdb.rust/dwindex.exp
@@ -16,9 +16,7 @@
 # Test that a rustc-produced .debug_aranges can be read.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 standard_testfile .rs
 
diff --git a/gdb/testsuite/gdb.rust/expr.exp b/gdb/testsuite/gdb.rust/expr.exp
index 81a2aaca4c8..639c8d3f347 100644
--- a/gdb/testsuite/gdb.rust/expr.exp
+++ b/gdb/testsuite/gdb.rust/expr.exp
@@ -17,7 +17,7 @@
 # Rust compiler.  This serves as a smoke test.
 
 load_lib "rust-support.exp"
-if {[skip_rust_tests]} { return }
+require !skip_rust_tests
 
 gdb_start
 
diff --git a/gdb/testsuite/gdb.rust/fnfield.exp b/gdb/testsuite/gdb.rust/fnfield.exp
index 9e12f624a7f..41796e8c38f 100644
--- a/gdb/testsuite/gdb.rust/fnfield.exp
+++ b/gdb/testsuite/gdb.rust/fnfield.exp
@@ -16,9 +16,7 @@
 # Test trait object printing.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/generics.exp b/gdb/testsuite/gdb.rust/generics.exp
index 6dfb068c6d8..eba6fe47f58 100644
--- a/gdb/testsuite/gdb.rust/generics.exp
+++ b/gdb/testsuite/gdb.rust/generics.exp
@@ -16,9 +16,7 @@
 # Test expressions involving generics.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/methods.exp b/gdb/testsuite/gdb.rust/methods.exp
index f3eb943c1b7..d3f7e003045 100644
--- a/gdb/testsuite/gdb.rust/methods.exp
+++ b/gdb/testsuite/gdb.rust/methods.exp
@@ -16,9 +16,7 @@
 # Test method calls.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/modules.exp b/gdb/testsuite/gdb.rust/modules.exp
index 07d74956228..11814586a20 100644
--- a/gdb/testsuite/gdb.rust/modules.exp
+++ b/gdb/testsuite/gdb.rust/modules.exp
@@ -16,9 +16,7 @@
 # Test name lookup.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/pp.exp b/gdb/testsuite/gdb.rust/pp.exp
index e3e226c5db5..d976c79ae43 100644
--- a/gdb/testsuite/gdb.rust/pp.exp
+++ b/gdb/testsuite/gdb.rust/pp.exp
@@ -17,9 +17,7 @@
 
 load_lib gdb-python.exp
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/rawids.exp b/gdb/testsuite/gdb.rust/rawids.exp
index 3d2ac070bca..1d26a8f25ea 100644
--- a/gdb/testsuite/gdb.rust/rawids.exp
+++ b/gdb/testsuite/gdb.rust/rawids.exp
@@ -16,9 +16,7 @@
 # Test raw identifiers.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 set v [split [rust_compiler_version] .]
 if {[lindex $v 0] == 1 && [lindex $v 1] < 30} {
diff --git a/gdb/testsuite/gdb.rust/rust-style.exp b/gdb/testsuite/gdb.rust/rust-style.exp
index 8383cb743ae..0389db766a6 100644
--- a/gdb/testsuite/gdb.rust/rust-style.exp
+++ b/gdb/testsuite/gdb.rust/rust-style.exp
@@ -16,9 +16,7 @@
 # Test CLI output styling for Rust.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 save_vars { env(TERM) } {
     # We need an ANSI-capable terminal to get the output.
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp
index 0fb06af9380..e6c78489c2c 100644
--- a/gdb/testsuite/gdb.rust/simple.exp
+++ b/gdb/testsuite/gdb.rust/simple.exp
@@ -16,9 +16,7 @@
 # Test expression parsing and evaluation that requires Rust compiler.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/traits.exp b/gdb/testsuite/gdb.rust/traits.exp
index 949e7cb919e..163d87c4c85 100644
--- a/gdb/testsuite/gdb.rust/traits.exp
+++ b/gdb/testsuite/gdb.rust/traits.exp
@@ -16,9 +16,7 @@
 # Test trait object printing.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/unicode.exp b/gdb/testsuite/gdb.rust/unicode.exp
index d091a8ac92e..ffd66c1e1d3 100644
--- a/gdb/testsuite/gdb.rust/unicode.exp
+++ b/gdb/testsuite/gdb.rust/unicode.exp
@@ -16,9 +16,7 @@
 # Test raw identifiers.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 # Non-ASCII identifiers were allowed starting in 1.53.
 set v [split [rust_compiler_version] .]
diff --git a/gdb/testsuite/gdb.rust/union.exp b/gdb/testsuite/gdb.rust/union.exp
index 0a786569e34..52c071dd877 100644
--- a/gdb/testsuite/gdb.rust/union.exp
+++ b/gdb/testsuite/gdb.rust/union.exp
@@ -16,9 +16,7 @@
 # Test of "union" for Rust.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/unsized.exp b/gdb/testsuite/gdb.rust/unsized.exp
index 59a7394a943..ffc6a22dd4f 100644
--- a/gdb/testsuite/gdb.rust/unsized.exp
+++ b/gdb/testsuite/gdb.rust/unsized.exp
@@ -16,9 +16,7 @@
 # Test expression parsing and evaluation that requires Rust compiler.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
diff --git a/gdb/testsuite/gdb.rust/watch.exp b/gdb/testsuite/gdb.rust/watch.exp
index 8f34c2928d9..9c3f8055dd3 100644
--- a/gdb/testsuite/gdb.rust/watch.exp
+++ b/gdb/testsuite/gdb.rust/watch.exp
@@ -16,9 +16,7 @@
 # Test watch -location with Rust.
 
 load_lib rust-support.exp
-if {[skip_rust_tests]} {
-    return
-}
+require !skip_rust_tests
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 13/46] Use require skip_fortran_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (11 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 12/46] Use require skip_rust_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 14/46] Use require skip_ada_tests Tom Tromey
                   ` (34 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_fortran_tests".
---
 gdb/testsuite/gdb.dwarf2/dw2-common-block.exp             | 4 +---
 gdb/testsuite/gdb.fortran/allocated.exp                   | 2 +-
 gdb/testsuite/gdb.fortran/array-bounds-high.exp           | 2 +-
 gdb/testsuite/gdb.fortran/array-bounds.exp                | 2 +-
 gdb/testsuite/gdb.fortran/array-element.exp               | 2 +-
 gdb/testsuite/gdb.fortran/array-indices.exp               | 2 +-
 gdb/testsuite/gdb.fortran/array-no-bounds.exp             | 2 +-
 gdb/testsuite/gdb.fortran/array-repeat.exp                | 2 +-
 gdb/testsuite/gdb.fortran/array-slices-bad.exp            | 2 +-
 gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp     | 2 +-
 gdb/testsuite/gdb.fortran/array-slices.exp                | 2 +-
 gdb/testsuite/gdb.fortran/associated.exp                  | 2 +-
 gdb/testsuite/gdb.fortran/assumedrank.exp                 | 2 +-
 gdb/testsuite/gdb.fortran/block-data.exp                  | 2 +-
 gdb/testsuite/gdb.fortran/call-no-debug.exp               | 2 +-
 gdb/testsuite/gdb.fortran/charset.exp                     | 2 +-
 gdb/testsuite/gdb.fortran/class-allocatable-array.exp     | 2 +-
 gdb/testsuite/gdb.fortran/common-block.exp                | 4 +---
 gdb/testsuite/gdb.fortran/completion.exp                  | 2 +-
 gdb/testsuite/gdb.fortran/complex.exp                     | 2 +-
 gdb/testsuite/gdb.fortran/debug-expr.exp                  | 2 +-
 gdb/testsuite/gdb.fortran/derived-type-function.exp       | 2 +-
 gdb/testsuite/gdb.fortran/derived-type-striding.exp       | 2 +-
 gdb/testsuite/gdb.fortran/derived-type.exp                | 2 +-
 gdb/testsuite/gdb.fortran/dot-ops.exp                     | 2 +-
 gdb/testsuite/gdb.fortran/dynamic-ptype-whatis.exp        | 2 +-
 gdb/testsuite/gdb.fortran/empty-string.exp                | 2 +-
 gdb/testsuite/gdb.fortran/exprs.exp                       | 2 +-
 gdb/testsuite/gdb.fortran/function-calls.exp              | 2 +-
 gdb/testsuite/gdb.fortran/info-modules.exp                | 2 +-
 gdb/testsuite/gdb.fortran/info-types.exp                  | 2 +-
 gdb/testsuite/gdb.fortran/intrinsics.exp                  | 2 +-
 gdb/testsuite/gdb.fortran/lbound-ubound.exp               | 2 +-
 gdb/testsuite/gdb.fortran/library-module.exp              | 2 +-
 gdb/testsuite/gdb.fortran/logical.exp                     | 2 +-
 gdb/testsuite/gdb.fortran/max-depth.exp                   | 2 +-
 gdb/testsuite/gdb.fortran/mixed-lang-stack.exp            | 2 +-
 gdb/testsuite/gdb.fortran/module.exp                      | 2 +-
 gdb/testsuite/gdb.fortran/multi-dim.exp                   | 2 +-
 gdb/testsuite/gdb.fortran/namelist.exp                    | 2 +-
 gdb/testsuite/gdb.fortran/nested-funcs-2.exp              | 2 +-
 gdb/testsuite/gdb.fortran/nested-funcs.exp                | 2 +-
 gdb/testsuite/gdb.fortran/oop_extend_type.exp             | 4 +---
 gdb/testsuite/gdb.fortran/pointer-to-pointer.exp          | 2 +-
 gdb/testsuite/gdb.fortran/print-formatted.exp             | 4 +---
 gdb/testsuite/gdb.fortran/print_type.exp                  | 2 +-
 gdb/testsuite/gdb.fortran/printing-types.exp              | 2 +-
 gdb/testsuite/gdb.fortran/ptr-indentation.exp             | 2 +-
 gdb/testsuite/gdb.fortran/ptype-on-functions.exp          | 2 +-
 gdb/testsuite/gdb.fortran/rank.exp                        | 2 +-
 gdb/testsuite/gdb.fortran/shape.exp                       | 2 +-
 gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp | 2 +-
 gdb/testsuite/gdb.fortran/size.exp                        | 2 +-
 gdb/testsuite/gdb.fortran/string-types.exp                | 2 +-
 gdb/testsuite/gdb.fortran/subarray.exp                    | 2 +-
 gdb/testsuite/gdb.fortran/type-kinds.exp                  | 2 +-
 gdb/testsuite/gdb.fortran/types.exp                       | 2 +-
 gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp             | 2 +-
 gdb/testsuite/gdb.fortran/vla-datatypes.exp               | 2 +-
 gdb/testsuite/gdb.fortran/vla-history.exp                 | 2 +-
 gdb/testsuite/gdb.fortran/vla-ptr-info.exp                | 2 +-
 gdb/testsuite/gdb.fortran/vla-ptype-sub.exp               | 2 +-
 gdb/testsuite/gdb.fortran/vla-ptype.exp                   | 2 +-
 gdb/testsuite/gdb.fortran/vla-sizeof.exp                  | 2 +-
 gdb/testsuite/gdb.fortran/vla-type.exp                    | 2 +-
 gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp     | 2 +-
 gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp        | 2 +-
 gdb/testsuite/gdb.fortran/vla-value-sub.exp               | 2 +-
 gdb/testsuite/gdb.fortran/vla-value.exp                   | 2 +-
 gdb/testsuite/gdb.fortran/whatis_type.exp                 | 2 +-
 gdb/testsuite/gdb.mi/mi-fortran-modules.exp               | 2 +-
 gdb/testsuite/gdb.mi/mi-var-child-f.exp                   | 2 +-
 gdb/testsuite/gdb.mi/mi-vla-fortran.exp                   | 2 +-
 73 files changed, 73 insertions(+), 81 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp b/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp
index d07890580a9..8bb79183067 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp
@@ -24,9 +24,7 @@ if {![istarget x86_64-*] || ![is_lp64_target]} {
 }
 
 # It requires fortran.
-if {[skip_fortran_tests]} {
-    return 0
-}
+require !skip_fortran_tests
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.fortran/allocated.exp b/gdb/testsuite/gdb.fortran/allocated.exp
index bd179353761..3421dce36b6 100644
--- a/gdb/testsuite/gdb.fortran/allocated.exp
+++ b/gdb/testsuite/gdb.fortran/allocated.exp
@@ -15,7 +15,7 @@
 
 # Testing GDB's implementation of ALLOCATED keyword.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/array-bounds-high.exp b/gdb/testsuite/gdb.fortran/array-bounds-high.exp
index effbddcb528..ce3c709d846 100644
--- a/gdb/testsuite/gdb.fortran/array-bounds-high.exp
+++ b/gdb/testsuite/gdb.fortran/array-bounds-high.exp
@@ -16,7 +16,7 @@
 # This file is part of the gdb testsuite.  It contains test to ensure that
 # array bounds accept LONGEST.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 set testfile "array-bounds-high"
 standard_testfile .f90
diff --git a/gdb/testsuite/gdb.fortran/array-bounds.exp b/gdb/testsuite/gdb.fortran/array-bounds.exp
index 1b11f01ca40..de900464643 100644
--- a/gdb/testsuite/gdb.fortran/array-bounds.exp
+++ b/gdb/testsuite/gdb.fortran/array-bounds.exp
@@ -16,7 +16,7 @@
 # This file is part of the gdb testsuite.  It contains test to ensure that
 # array bounds accept LONGEST.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 set testfile "array-bounds"
 standard_testfile .f90
diff --git a/gdb/testsuite/gdb.fortran/array-element.exp b/gdb/testsuite/gdb.fortran/array-element.exp
index 9c8798d1f6d..56c5e522551 100644
--- a/gdb/testsuite/gdb.fortran/array-element.exp
+++ b/gdb/testsuite/gdb.fortran/array-element.exp
@@ -18,7 +18,7 @@
 # This file is part of the gdb testsuite.  It contains test for printing
 # the elements of an array which is passed as pointer to a subroutine.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f
 
diff --git a/gdb/testsuite/gdb.fortran/array-indices.exp b/gdb/testsuite/gdb.fortran/array-indices.exp
index 403a5fc023c..89c9a013508 100644
--- a/gdb/testsuite/gdb.fortran/array-indices.exp
+++ b/gdb/testsuite/gdb.fortran/array-indices.exp
@@ -15,7 +15,7 @@
 
 # Test the printing of element indices in Fortran arrays.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 load_lib fortran.exp
 
diff --git a/gdb/testsuite/gdb.fortran/array-no-bounds.exp b/gdb/testsuite/gdb.fortran/array-no-bounds.exp
index da965c559fa..29bbbbaf67b 100644
--- a/gdb/testsuite/gdb.fortran/array-no-bounds.exp
+++ b/gdb/testsuite/gdb.fortran/array-no-bounds.exp
@@ -16,7 +16,7 @@
 # This file is part of the gdb testsuite.  It contains test to ensure that
 # array bounds accept LONGEST.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f90
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/array-repeat.exp b/gdb/testsuite/gdb.fortran/array-repeat.exp
index 045bac17ea1..2f543fd6555 100644
--- a/gdb/testsuite/gdb.fortran/array-repeat.exp
+++ b/gdb/testsuite/gdb.fortran/array-repeat.exp
@@ -15,7 +15,7 @@
 
 # Test the detection and printing of repeated elements in Fortran arrays.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 load_lib fortran.exp
 
diff --git a/gdb/testsuite/gdb.fortran/array-slices-bad.exp b/gdb/testsuite/gdb.fortran/array-slices-bad.exp
index b832fea292a..0a0ccc04aff 100644
--- a/gdb/testsuite/gdb.fortran/array-slices-bad.exp
+++ b/gdb/testsuite/gdb.fortran/array-slices-bad.exp
@@ -15,7 +15,7 @@
 
 # Test invalid element and slice array accesses.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp b/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp
index a0f00ebd04c..a0ef8031379 100644
--- a/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp
+++ b/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp
@@ -15,7 +15,7 @@
 
 # Create a slice of an array, then take a slice of that slice.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/array-slices.exp b/gdb/testsuite/gdb.fortran/array-slices.exp
index a38276c67e4..921befdac5a 100644
--- a/gdb/testsuite/gdb.fortran/array-slices.exp
+++ b/gdb/testsuite/gdb.fortran/array-slices.exp
@@ -33,7 +33,7 @@
 # debug information) matches the size of the slice manually extracted
 # by GDB.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 # This test relies on output from the inferior.
 if [target_info exists gdb,noinferiorio] {
diff --git a/gdb/testsuite/gdb.fortran/associated.exp b/gdb/testsuite/gdb.fortran/associated.exp
index 70a6fbdfb72..6e40af6c23c 100644
--- a/gdb/testsuite/gdb.fortran/associated.exp
+++ b/gdb/testsuite/gdb.fortran/associated.exp
@@ -15,7 +15,7 @@
 
 # Testing GDB's implementation of ASSOCIATED keyword.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/assumedrank.exp b/gdb/testsuite/gdb.fortran/assumedrank.exp
index 37bb825d164..7e630789e60 100644
--- a/gdb/testsuite/gdb.fortran/assumedrank.exp
+++ b/gdb/testsuite/gdb.fortran/assumedrank.exp
@@ -15,7 +15,7 @@
 
 # Testing GDB's implementation of ASSUMED RANK arrays.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/block-data.exp b/gdb/testsuite/gdb.fortran/block-data.exp
index ab064910108..18619f649e7 100644
--- a/gdb/testsuite/gdb.fortran/block-data.exp
+++ b/gdb/testsuite/gdb.fortran/block-data.exp
@@ -21,7 +21,7 @@
 # outputs nameless DW_TAG_module, unlike with gfortran which just
 # doesn't emit DW_TAG_module in this case.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f
 load_lib "fortran.exp"
diff --git a/gdb/testsuite/gdb.fortran/call-no-debug.exp b/gdb/testsuite/gdb.fortran/call-no-debug.exp
index ffcc9ab3cef..e217c4db3eb 100644
--- a/gdb/testsuite/gdb.fortran/call-no-debug.exp
+++ b/gdb/testsuite/gdb.fortran/call-no-debug.exp
@@ -16,7 +16,7 @@
 # Test calling Fortran functions that are compiled without debug
 # information.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile call-no-debug-prog.f90 call-no-debug-func.f90
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/charset.exp b/gdb/testsuite/gdb.fortran/charset.exp
index 5238faaaa6a..f2e733982db 100644
--- a/gdb/testsuite/gdb.fortran/charset.exp
+++ b/gdb/testsuite/gdb.fortran/charset.exp
@@ -16,7 +16,7 @@
 # This file is part of the gdb testsuite.  It contains tests for evaluating
 # Fortran subarray expression.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f90
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/class-allocatable-array.exp b/gdb/testsuite/gdb.fortran/class-allocatable-array.exp
index 30bdcb01652..29d77ff3881 100644
--- a/gdb/testsuite/gdb.fortran/class-allocatable-array.exp
+++ b/gdb/testsuite/gdb.fortran/class-allocatable-array.exp
@@ -16,7 +16,7 @@
 # Test that GDB can print an allocatable array that is a data field
 # within a class like type.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/common-block.exp b/gdb/testsuite/gdb.fortran/common-block.exp
index 8509283a17f..c47f27557b5 100644
--- a/gdb/testsuite/gdb.fortran/common-block.exp
+++ b/gdb/testsuite/gdb.fortran/common-block.exp
@@ -15,9 +15,7 @@
 
 # This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
-if {[skip_fortran_tests]} {
-    return 0
-}
+require !skip_fortran_tests
 
 standard_testfile .f90
 load_lib "fortran.exp"
diff --git a/gdb/testsuite/gdb.fortran/completion.exp b/gdb/testsuite/gdb.fortran/completion.exp
index 890e07adcef..bbbbc6257fe 100644
--- a/gdb/testsuite/gdb.fortran/completion.exp
+++ b/gdb/testsuite/gdb.fortran/completion.exp
@@ -15,7 +15,7 @@
 
 # Test tab completion of Fortran type field names.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/complex.exp b/gdb/testsuite/gdb.fortran/complex.exp
index b6fc95534eb..b1961858066 100644
--- a/gdb/testsuite/gdb.fortran/complex.exp
+++ b/gdb/testsuite/gdb.fortran/complex.exp
@@ -16,7 +16,7 @@
 standard_testfile .f90
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90 quiet}]} {
     return -1
diff --git a/gdb/testsuite/gdb.fortran/debug-expr.exp b/gdb/testsuite/gdb.fortran/debug-expr.exp
index f09f04edd7a..acc0aadc11e 100644
--- a/gdb/testsuite/gdb.fortran/debug-expr.exp
+++ b/gdb/testsuite/gdb.fortran/debug-expr.exp
@@ -15,7 +15,7 @@
 
 # Test "set debug expr 1" on Fortran expressions.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 # Test relies on checking gdb debug output. Do not run if gdb debug is
 # enabled as any debug will be redirected to the log.
diff --git a/gdb/testsuite/gdb.fortran/derived-type-function.exp b/gdb/testsuite/gdb.fortran/derived-type-function.exp
index 08d8ad4a60e..73453315370 100644
--- a/gdb/testsuite/gdb.fortran/derived-type-function.exp
+++ b/gdb/testsuite/gdb.fortran/derived-type-function.exp
@@ -18,7 +18,7 @@
 # This file is part of the gdb testsuite.  It contains tests for type-printing
 # and value-printing Fortran derived types having also functions.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f90
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/derived-type-striding.exp b/gdb/testsuite/gdb.fortran/derived-type-striding.exp
index 3d45a63f839..9efad8e9aa3 100644
--- a/gdb/testsuite/gdb.fortran/derived-type-striding.exp
+++ b/gdb/testsuite/gdb.fortran/derived-type-striding.exp
@@ -16,7 +16,7 @@
 # Print some single dimensional integer arrays that will have a byte
 # stride in the debug information.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 
diff --git a/gdb/testsuite/gdb.fortran/derived-type.exp b/gdb/testsuite/gdb.fortran/derived-type.exp
index 5187e3ef480..e862a9a5f61 100644
--- a/gdb/testsuite/gdb.fortran/derived-type.exp
+++ b/gdb/testsuite/gdb.fortran/derived-type.exp
@@ -18,7 +18,7 @@
 # This file is part of the gdb testsuite.  It contains tests for type-printing
 # and value-printing Fortran derived types.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f90
 load_lib "fortran.exp"
diff --git a/gdb/testsuite/gdb.fortran/dot-ops.exp b/gdb/testsuite/gdb.fortran/dot-ops.exp
index 2bad2bc7c8f..c4e7f698fcf 100644
--- a/gdb/testsuite/gdb.fortran/dot-ops.exp
+++ b/gdb/testsuite/gdb.fortran/dot-ops.exp
@@ -18,7 +18,7 @@
 
 load_lib "fortran.exp"
 
-if { [skip_fortran_tests] } { continue }
+require !skip_fortran_tests
 
 proc test_dot_operations {} {
 
diff --git a/gdb/testsuite/gdb.fortran/dynamic-ptype-whatis.exp b/gdb/testsuite/gdb.fortran/dynamic-ptype-whatis.exp
index f0463f4f62b..2264ad86714 100644
--- a/gdb/testsuite/gdb.fortran/dynamic-ptype-whatis.exp
+++ b/gdb/testsuite/gdb.fortran/dynamic-ptype-whatis.exp
@@ -16,7 +16,7 @@
 # Test using whatis and ptype on different configurations of dynamic
 # types.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/empty-string.exp b/gdb/testsuite/gdb.fortran/empty-string.exp
index 892f189784a..91ae2193124 100644
--- a/gdb/testsuite/gdb.fortran/empty-string.exp
+++ b/gdb/testsuite/gdb.fortran/empty-string.exp
@@ -15,7 +15,7 @@
 
 # Test printing of an empty Fortran string.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/exprs.exp b/gdb/testsuite/gdb.fortran/exprs.exp
index c14cdad4ff5..b9fe5a45c8c 100644
--- a/gdb/testsuite/gdb.fortran/exprs.exp
+++ b/gdb/testsuite/gdb.fortran/exprs.exp
@@ -18,7 +18,7 @@
 
 load_lib "fortran.exp"
 
-if { [skip_fortran_tests] } { continue }
+require !skip_fortran_tests
 
 proc test_integer_literals_accepted {} {
     global gdb_prompt
diff --git a/gdb/testsuite/gdb.fortran/function-calls.exp b/gdb/testsuite/gdb.fortran/function-calls.exp
index f240bd71d57..8d1888d77d4 100644
--- a/gdb/testsuite/gdb.fortran/function-calls.exp
+++ b/gdb/testsuite/gdb.fortran/function-calls.exp
@@ -16,7 +16,7 @@
 # Exercise passing and returning arguments in Fortran. This test case
 # is based on the GNU Fortran Argument passing conventions.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 
diff --git a/gdb/testsuite/gdb.fortran/info-modules.exp b/gdb/testsuite/gdb.fortran/info-modules.exp
index a6359374a46..b4c15a69533 100644
--- a/gdb/testsuite/gdb.fortran/info-modules.exp
+++ b/gdb/testsuite/gdb.fortran/info-modules.exp
@@ -19,7 +19,7 @@
 load_lib "fortran.exp"
 load_lib "sym-info-cmds.exp"
 
-if { [skip_fortran_tests] } { return }
+require !skip_fortran_tests
 
 standard_testfile info-types.f90 info-types-2.f90
 
diff --git a/gdb/testsuite/gdb.fortran/info-types.exp b/gdb/testsuite/gdb.fortran/info-types.exp
index 527f9fead30..3d19cfa7593 100644
--- a/gdb/testsuite/gdb.fortran/info-types.exp
+++ b/gdb/testsuite/gdb.fortran/info-types.exp
@@ -18,7 +18,7 @@
 load_lib "fortran.exp"
 load_lib "sym-info-cmds.exp"
 
-if { [skip_fortran_tests] } { return }
+require !skip_fortran_tests
 
 standard_testfile info-types.f90 info-types-2.f90
 
diff --git a/gdb/testsuite/gdb.fortran/intrinsics.exp b/gdb/testsuite/gdb.fortran/intrinsics.exp
index 0894654f781..3e581ef2761 100644
--- a/gdb/testsuite/gdb.fortran/intrinsics.exp
+++ b/gdb/testsuite/gdb.fortran/intrinsics.exp
@@ -17,7 +17,7 @@
 
 load_lib "fortran.exp"
 
-if { [skip_fortran_tests] } { return }
+require !skip_fortran_tests
 
 standard_testfile .f90
 
diff --git a/gdb/testsuite/gdb.fortran/lbound-ubound.exp b/gdb/testsuite/gdb.fortran/lbound-ubound.exp
index 6be9d03af6b..c1c4bea7b53 100644
--- a/gdb/testsuite/gdb.fortran/lbound-ubound.exp
+++ b/gdb/testsuite/gdb.fortran/lbound-ubound.exp
@@ -15,7 +15,7 @@
 
 # Testing GDB's implementation of LBOUND and UBOUND.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".F90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/library-module.exp b/gdb/testsuite/gdb.fortran/library-module.exp
index 08fb6059bdf..0c5a71f4f5e 100644
--- a/gdb/testsuite/gdb.fortran/library-module.exp
+++ b/gdb/testsuite/gdb.fortran/library-module.exp
@@ -15,7 +15,7 @@
 
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile library-module-main.f90 
 set srclibfile ${testfile}-lib.f90
diff --git a/gdb/testsuite/gdb.fortran/logical.exp b/gdb/testsuite/gdb.fortran/logical.exp
index 1efb031b136..5c755fed079 100644
--- a/gdb/testsuite/gdb.fortran/logical.exp
+++ b/gdb/testsuite/gdb.fortran/logical.exp
@@ -18,7 +18,7 @@
 standard_testfile .f90
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90 quiet}]} {
     return -1
diff --git a/gdb/testsuite/gdb.fortran/max-depth.exp b/gdb/testsuite/gdb.fortran/max-depth.exp
index 3a8a94e895d..bc0176373d3 100644
--- a/gdb/testsuite/gdb.fortran/max-depth.exp
+++ b/gdb/testsuite/gdb.fortran/max-depth.exp
@@ -18,7 +18,7 @@
 
 load_lib "fortran.exp"
 
-if { [skip_fortran_tests] } { return }
+require !skip_fortran_tests
 
 standard_testfile .f90
 
diff --git a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
index 5bed3be8697..0ff4fe41936 100644
--- a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
+++ b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
@@ -23,7 +23,7 @@
 # each case to ensure that trying to print objects or types from one
 # language, while GDB's language is set to another, doesn't crash GDB.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile mixed-lang-stack.c mixed-lang-stack.cpp mixed-lang-stack.f90
 
diff --git a/gdb/testsuite/gdb.fortran/module.exp b/gdb/testsuite/gdb.fortran/module.exp
index 47fbf748e3f..e3f9cb62a9b 100644
--- a/gdb/testsuite/gdb.fortran/module.exp
+++ b/gdb/testsuite/gdb.fortran/module.exp
@@ -15,7 +15,7 @@
 
 load_lib "fortran.exp"
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f90
 
diff --git a/gdb/testsuite/gdb.fortran/multi-dim.exp b/gdb/testsuite/gdb.fortran/multi-dim.exp
index cafb12d0e75..ac5c0741713 100644
--- a/gdb/testsuite/gdb.fortran/multi-dim.exp
+++ b/gdb/testsuite/gdb.fortran/multi-dim.exp
@@ -16,7 +16,7 @@
 # This file is part of the gdb testsuite.  It contains tests for evaluating
 # Fortran subarray expression.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f90
 load_lib "fortran.exp"
diff --git a/gdb/testsuite/gdb.fortran/namelist.exp b/gdb/testsuite/gdb.fortran/namelist.exp
index 8e2c9be5c99..f9e6ead7069 100644
--- a/gdb/testsuite/gdb.fortran/namelist.exp
+++ b/gdb/testsuite/gdb.fortran/namelist.exp
@@ -16,7 +16,7 @@
 # This file is part of the gdb testsuite.  It contains tests for fortran
 # namelist.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f90
 load_lib "fortran.exp"
diff --git a/gdb/testsuite/gdb.fortran/nested-funcs-2.exp b/gdb/testsuite/gdb.fortran/nested-funcs-2.exp
index 9aaf57db9b5..496efed8dea 100644
--- a/gdb/testsuite/gdb.fortran/nested-funcs-2.exp
+++ b/gdb/testsuite/gdb.fortran/nested-funcs-2.exp
@@ -15,7 +15,7 @@
 
 # Further testing of placing breakpoints in nested subroutines.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 load_lib "fortran.exp"
 
 standard_testfile ".f90"
diff --git a/gdb/testsuite/gdb.fortran/nested-funcs.exp b/gdb/testsuite/gdb.fortran/nested-funcs.exp
index b065336c830..a3df0d81392 100755
--- a/gdb/testsuite/gdb.fortran/nested-funcs.exp
+++ b/gdb/testsuite/gdb.fortran/nested-funcs.exp
@@ -16,7 +16,7 @@
 # This testcase is supposed to test DWARF static link which is usually
 # used together with nested functions.  
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f90
 load_lib "fortran.exp"
diff --git a/gdb/testsuite/gdb.fortran/oop_extend_type.exp b/gdb/testsuite/gdb.fortran/oop_extend_type.exp
index 00cfffa0b63..1a71a0ab178 100755
--- a/gdb/testsuite/gdb.fortran/oop_extend_type.exp
+++ b/gdb/testsuite/gdb.fortran/oop_extend_type.exp
@@ -16,9 +16,7 @@
 standard_testfile ".f90"
 load_lib "fortran.exp"
 
-if { [skip_fortran_tests] } {
-    return -1
-}
+require !skip_fortran_tests
 
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
      {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/pointer-to-pointer.exp b/gdb/testsuite/gdb.fortran/pointer-to-pointer.exp
index 8c43d177295..85bb91259f6 100644
--- a/gdb/testsuite/gdb.fortran/pointer-to-pointer.exp
+++ b/gdb/testsuite/gdb.fortran/pointer-to-pointer.exp
@@ -15,7 +15,7 @@
 
 # Test for GDB printing a pointer to a type containing a buffer.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/print-formatted.exp b/gdb/testsuite/gdb.fortran/print-formatted.exp
index 524cfa757d6..0cdfda796c2 100644
--- a/gdb/testsuite/gdb.fortran/print-formatted.exp
+++ b/gdb/testsuite/gdb.fortran/print-formatted.exp
@@ -15,9 +15,7 @@
 
 load_lib "fortran.exp"
 
-if { [skip_fortran_tests] } {
-    return
-}
+require !skip_fortran_tests
 
 standard_testfile .f90
 
diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortran/print_type.exp
index fc605386c4d..cd040f0bac8 100755
--- a/gdb/testsuite/gdb.fortran/print_type.exp
+++ b/gdb/testsuite/gdb.fortran/print_type.exp
@@ -19,7 +19,7 @@
 standard_testfile "pointers.f90"
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
     {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/printing-types.exp b/gdb/testsuite/gdb.fortran/printing-types.exp
index 0ba07f6c1ff..5a1d8cc0923 100644
--- a/gdb/testsuite/gdb.fortran/printing-types.exp
+++ b/gdb/testsuite/gdb.fortran/printing-types.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f90
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/ptr-indentation.exp b/gdb/testsuite/gdb.fortran/ptr-indentation.exp
index daf5bd53550..fb42e5d8522 100644
--- a/gdb/testsuite/gdb.fortran/ptr-indentation.exp
+++ b/gdb/testsuite/gdb.fortran/ptr-indentation.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f90
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
index 156e4fe4d17..7e28019eed6 100644
--- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
+++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
@@ -15,7 +15,7 @@
 
 # This file contains a test for printing the types of functions.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f90
 load_lib "fortran.exp"
diff --git a/gdb/testsuite/gdb.fortran/rank.exp b/gdb/testsuite/gdb.fortran/rank.exp
index cef30b1a6c3..8ceebe38594 100644
--- a/gdb/testsuite/gdb.fortran/rank.exp
+++ b/gdb/testsuite/gdb.fortran/rank.exp
@@ -15,7 +15,7 @@
 
 # Testing GDB's implementation of RANK keyword.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/shape.exp b/gdb/testsuite/gdb.fortran/shape.exp
index f7248dd6c43..5b464254787 100644
--- a/gdb/testsuite/gdb.fortran/shape.exp
+++ b/gdb/testsuite/gdb.fortran/shape.exp
@@ -15,7 +15,7 @@
 
 # Testing GDB's implementation of SHAPE keyword.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp b/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp
index ccb4d145e8a..f341292006c 100644
--- a/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp
+++ b/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp
@@ -17,7 +17,7 @@
 # calls and substring operations that are to be skipped due to short
 # circuiting.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 
diff --git a/gdb/testsuite/gdb.fortran/size.exp b/gdb/testsuite/gdb.fortran/size.exp
index fb49e286e5b..00634547214 100644
--- a/gdb/testsuite/gdb.fortran/size.exp
+++ b/gdb/testsuite/gdb.fortran/size.exp
@@ -15,7 +15,7 @@
 
 # Testing GDB's implementation of SIZE keyword.
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 standard_testfile ".f90"
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/string-types.exp b/gdb/testsuite/gdb.fortran/string-types.exp
index a39d55c51f3..3dfb5d3a337 100644
--- a/gdb/testsuite/gdb.fortran/string-types.exp
+++ b/gdb/testsuite/gdb.fortran/string-types.exp
@@ -19,7 +19,7 @@
 standard_testfile .f90
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 {debug f90 quiet}]} {
diff --git a/gdb/testsuite/gdb.fortran/subarray.exp b/gdb/testsuite/gdb.fortran/subarray.exp
index 776872ed219..8f8a64445f8 100644
--- a/gdb/testsuite/gdb.fortran/subarray.exp
+++ b/gdb/testsuite/gdb.fortran/subarray.exp
@@ -18,7 +18,7 @@
 # This file is part of the gdb testsuite.  It contains tests for evaluating
 # Fortran subarray expression.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 standard_testfile .f
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.fortran/type-kinds.exp b/gdb/testsuite/gdb.fortran/type-kinds.exp
index e481ad3b38d..bd54fea7835 100644
--- a/gdb/testsuite/gdb.fortran/type-kinds.exp
+++ b/gdb/testsuite/gdb.fortran/type-kinds.exp
@@ -19,7 +19,7 @@
 
 load_lib "fortran.exp"
 
-if { [skip_fortran_tests] } { continue }
+require !skip_fortran_tests
 
 # Cast the value 1 to the type 'BASE_TYPE (kind=TYPE_KIND)'.  The
 # expected result of the cast is CAST_RESULT, and the size of the
diff --git a/gdb/testsuite/gdb.fortran/types.exp b/gdb/testsuite/gdb.fortran/types.exp
index eac667646ac..d95bdb05009 100644
--- a/gdb/testsuite/gdb.fortran/types.exp
+++ b/gdb/testsuite/gdb.fortran/types.exp
@@ -18,7 +18,7 @@
 
 load_lib "fortran.exp"
 
-if { [skip_fortran_tests] } { continue }
+require !skip_fortran_tests
 
 proc test_integer_literal_types_accepted {} {
     global gdb_prompt
diff --git a/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp b/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp
index d6a1b857c95..dd8d1ce3e74 100644
--- a/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp
+++ b/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp
@@ -16,7 +16,7 @@
 standard_testfile "vla.f90"
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/vla-datatypes.exp b/gdb/testsuite/gdb.fortran/vla-datatypes.exp
index 9750c2e7ab2..99874bb44ac 100644
--- a/gdb/testsuite/gdb.fortran/vla-datatypes.exp
+++ b/gdb/testsuite/gdb.fortran/vla-datatypes.exp
@@ -16,7 +16,7 @@
 standard_testfile ".f90"
 load_lib "fortran.exp"
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/vla-history.exp b/gdb/testsuite/gdb.fortran/vla-history.exp
index ed2db8cbc24..490236b78d4 100644
--- a/gdb/testsuite/gdb.fortran/vla-history.exp
+++ b/gdb/testsuite/gdb.fortran/vla-history.exp
@@ -16,7 +16,7 @@
 standard_testfile "vla.f90"
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
index dd0a7783d8d..04d5a3a0e08 100644
--- a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
+++ b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
@@ -16,7 +16,7 @@
 standard_testfile "vla.f90"
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp b/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp
index 52a70d1100b..f7bbc04ac70 100644
--- a/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp
+++ b/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp
@@ -16,7 +16,7 @@
 standard_testfile "vla-sub.f90"
 load_lib "fortran.exp"
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp
index 3f267f2bb69..90fe19316ec 100644
--- a/gdb/testsuite/gdb.fortran/vla-ptype.exp
+++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp
@@ -16,7 +16,7 @@
 standard_testfile "vla.f90"
 load_lib "fortran.exp"
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortran/vla-sizeof.exp
index 9930cd92ad0..5375d0458c7 100644
--- a/gdb/testsuite/gdb.fortran/vla-sizeof.exp
+++ b/gdb/testsuite/gdb.fortran/vla-sizeof.exp
@@ -16,7 +16,7 @@
 standard_testfile "vla.f90"
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp
index fc8494fe36c..9f84a446272 100755
--- a/gdb/testsuite/gdb.fortran/vla-type.exp
+++ b/gdb/testsuite/gdb.fortran/vla-type.exp
@@ -16,7 +16,7 @@
 standard_testfile ".f90"
 load_lib "fortran.exp"
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
      {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp b/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp
index 5ac744ecde7..92b3313cb70 100644
--- a/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp
+++ b/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp
@@ -16,7 +16,7 @@
 standard_testfile "vla-sub.f90"
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp b/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp
index 7b7b48940d2..ea55aa10994 100644
--- a/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp
+++ b/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp
@@ -16,7 +16,7 @@
 standard_testfile "vla-sub.f90"
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/vla-value-sub.exp b/gdb/testsuite/gdb.fortran/vla-value-sub.exp
index b7ab7a51726..84c37267c72 100644
--- a/gdb/testsuite/gdb.fortran/vla-value-sub.exp
+++ b/gdb/testsuite/gdb.fortran/vla-value-sub.exp
@@ -16,7 +16,7 @@
 standard_testfile "vla-sub.f90"
 load_lib fortran.exp
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp
index a920fb879ee..0621c72a89c 100644
--- a/gdb/testsuite/gdb.fortran/vla-value.exp
+++ b/gdb/testsuite/gdb.fortran/vla-value.exp
@@ -16,7 +16,7 @@
 standard_testfile "vla.f90"
 load_lib "fortran.exp"
 
-if {[skip_fortran_tests]} { return -1 }
+require !skip_fortran_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
      {debug f90 quiet}] } {
diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp
index 83f313e1ae8..97166f8e8b3 100644
--- a/gdb/testsuite/gdb.fortran/whatis_type.exp
+++ b/gdb/testsuite/gdb.fortran/whatis_type.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_fortran_tests] } { continue }
+require !skip_fortran_tests
 
 standard_testfile type.f90
 load_lib "fortran.exp"
diff --git a/gdb/testsuite/gdb.mi/mi-fortran-modules.exp b/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
index fe4692fd52a..c9b8212e3fe 100644
--- a/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
+++ b/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
@@ -15,7 +15,7 @@
 
 # Test -symbol-info-modules, listing Fortran modules.
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 load_lib fortran.exp
 load_lib mi-support.exp
diff --git a/gdb/testsuite/gdb.mi/mi-var-child-f.exp b/gdb/testsuite/gdb.mi/mi-var-child-f.exp
index b097b1c4673..8d5c738a93c 100644
--- a/gdb/testsuite/gdb.mi/mi-var-child-f.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-child-f.exp
@@ -19,7 +19,7 @@ load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 load_lib "fortran.exp"
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 gdb_exit
 if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
index 00312354fc9..780b3068b97 100644
--- a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
+++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
@@ -16,7 +16,7 @@
 # Verify that, using the MI, we can evaluate a simple Fortran Variable
 # Length Array (VLA).
 
-if { [skip_fortran_tests] } { return -1 }
+require !skip_fortran_tests
 
 load_lib mi-support.exp
 load_lib fortran.exp
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 14/46] Use require skip_ada_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (12 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 13/46] Use require skip_fortran_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 15/46] Use require skip_go_tests Tom Tromey
                   ` (33 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_ada_tests".
---
 gdb/testsuite/gdb.ada/O2_float_param.exp              | 2 +-
 gdb/testsuite/gdb.ada/access_tagged_param.exp         | 2 +-
 gdb/testsuite/gdb.ada/access_to_packed_array.exp      | 2 +-
 gdb/testsuite/gdb.ada/access_to_unbounded_array.exp   | 2 +-
 gdb/testsuite/gdb.ada/addr_arith.exp                  | 2 +-
 gdb/testsuite/gdb.ada/aliased_array.exp               | 2 +-
 gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp           | 2 +-
 gdb/testsuite/gdb.ada/arr_arr.exp                     | 2 +-
 gdb/testsuite/gdb.ada/arr_enum_idx_w_gap.exp          | 2 +-
 gdb/testsuite/gdb.ada/array_bounds.exp                | 2 +-
 gdb/testsuite/gdb.ada/array_char_idx.exp              | 2 +-
 gdb/testsuite/gdb.ada/array_of_symbolic_length.exp    | 2 +-
 gdb/testsuite/gdb.ada/array_of_variable_length.exp    | 2 +-
 gdb/testsuite/gdb.ada/array_of_variant.exp            | 2 +-
 gdb/testsuite/gdb.ada/array_ptr_renaming.exp          | 2 +-
 gdb/testsuite/gdb.ada/array_return.exp                | 2 +-
 gdb/testsuite/gdb.ada/array_subscript_addr.exp        | 2 +-
 gdb/testsuite/gdb.ada/arraydim.exp                    | 2 +-
 gdb/testsuite/gdb.ada/arrayidx.exp                    | 2 +-
 gdb/testsuite/gdb.ada/arrayparam.exp                  | 2 +-
 gdb/testsuite/gdb.ada/arrayptr.exp                    | 2 +-
 gdb/testsuite/gdb.ada/assign_1.exp                    | 2 +-
 gdb/testsuite/gdb.ada/assign_arr.exp                  | 2 +-
 gdb/testsuite/gdb.ada/atomic_enum.exp                 | 2 +-
 gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp        | 2 +-
 gdb/testsuite/gdb.ada/bad-task-bp-keyword.exp         | 2 +-
 gdb/testsuite/gdb.ada/bias.exp                        | 2 +-
 gdb/testsuite/gdb.ada/big_packed_array.exp            | 2 +-
 gdb/testsuite/gdb.ada/boolean_expr.exp                | 2 +-
 gdb/testsuite/gdb.ada/bp_c_mixed_case.exp             | 2 +-
 gdb/testsuite/gdb.ada/bp_enum_homonym.exp             | 2 +-
 gdb/testsuite/gdb.ada/bp_fun_addr.exp                 | 2 +-
 gdb/testsuite/gdb.ada/bp_inlined_func.exp             | 2 +-
 gdb/testsuite/gdb.ada/bp_on_var.exp                   | 2 +-
 gdb/testsuite/gdb.ada/bp_range_type.exp               | 2 +-
 gdb/testsuite/gdb.ada/bp_reset.exp                    | 2 +-
 gdb/testsuite/gdb.ada/byte_packed_arr.exp             | 2 +-
 gdb/testsuite/gdb.ada/call_pn.exp                     | 2 +-
 gdb/testsuite/gdb.ada/catch_assert_if.exp             | 2 +-
 gdb/testsuite/gdb.ada/catch_ex.exp                    | 2 +-
 gdb/testsuite/gdb.ada/catch_ex_std.exp                | 2 +-
 gdb/testsuite/gdb.ada/char_enum.exp                   | 2 +-
 gdb/testsuite/gdb.ada/char_enum_overload.exp          | 2 +-
 gdb/testsuite/gdb.ada/char_enum_unicode.exp           | 2 +-
 gdb/testsuite/gdb.ada/char_param.exp                  | 2 +-
 gdb/testsuite/gdb.ada/complete.exp                    | 2 +-
 gdb/testsuite/gdb.ada/cond_lang.exp                   | 2 +-
 gdb/testsuite/gdb.ada/convvar_comp.exp                | 2 +-
 gdb/testsuite/gdb.ada/dgopt.exp                       | 2 +-
 gdb/testsuite/gdb.ada/disc_arr_bound.exp              | 2 +-
 gdb/testsuite/gdb.ada/discrete-char.exp               | 2 +-
 gdb/testsuite/gdb.ada/display_nested.exp              | 2 +-
 gdb/testsuite/gdb.ada/dot_all.exp                     | 2 +-
 gdb/testsuite/gdb.ada/dyn_arrayidx.exp                | 2 +-
 gdb/testsuite/gdb.ada/dyn_loc.exp                     | 2 +-
 gdb/testsuite/gdb.ada/dyn_stride.exp                  | 2 +-
 gdb/testsuite/gdb.ada/dynamic-iface.exp               | 2 +-
 gdb/testsuite/gdb.ada/enum_idx_packed.exp             | 2 +-
 gdb/testsuite/gdb.ada/enum_qual.exp                   | 2 +-
 gdb/testsuite/gdb.ada/enums_overload.exp              | 2 +-
 gdb/testsuite/gdb.ada/excep_handle.exp                | 2 +-
 gdb/testsuite/gdb.ada/exec_changed.exp                | 2 +-
 gdb/testsuite/gdb.ada/expr_delims.exp                 | 2 +-
 gdb/testsuite/gdb.ada/expr_with_funcall.exp           | 2 +-
 gdb/testsuite/gdb.ada/exprs.exp                       | 2 +-
 gdb/testsuite/gdb.ada/fin_fun_out.exp                 | 2 +-
 gdb/testsuite/gdb.ada/fixed_cmp.exp                   | 2 +-
 gdb/testsuite/gdb.ada/fixed_points.exp                | 2 +-
 gdb/testsuite/gdb.ada/fixed_points_function.exp       | 2 +-
 gdb/testsuite/gdb.ada/float-bits.exp                  | 2 +-
 gdb/testsuite/gdb.ada/float_param.exp                 | 2 +-
 gdb/testsuite/gdb.ada/formatted_ref.exp               | 2 +-
 gdb/testsuite/gdb.ada/frame_arg_lang.exp              | 2 +-
 gdb/testsuite/gdb.ada/frame_args.exp                  | 2 +-
 gdb/testsuite/gdb.ada/fullname_bp.exp                 | 2 +-
 gdb/testsuite/gdb.ada/fun_addr.exp                    | 2 +-
 gdb/testsuite/gdb.ada/fun_in_declare.exp              | 2 +-
 gdb/testsuite/gdb.ada/fun_overload_menu.exp           | 2 +-
 gdb/testsuite/gdb.ada/fun_renaming.exp                | 2 +-
 gdb/testsuite/gdb.ada/funcall_char.exp                | 2 +-
 gdb/testsuite/gdb.ada/funcall_param.exp               | 2 +-
 gdb/testsuite/gdb.ada/funcall_ptr.exp                 | 2 +-
 gdb/testsuite/gdb.ada/funcall_ref.exp                 | 2 +-
 gdb/testsuite/gdb.ada/ghost.exp                       | 2 +-
 gdb/testsuite/gdb.ada/homonym.exp                     | 2 +-
 gdb/testsuite/gdb.ada/info_addr_mixed_case.exp        | 2 +-
 gdb/testsuite/gdb.ada/info_auto_lang.exp              | 2 +-
 gdb/testsuite/gdb.ada/info_exc.exp                    | 2 +-
 gdb/testsuite/gdb.ada/info_locals_renaming.exp        | 2 +-
 gdb/testsuite/gdb.ada/info_types.exp                  | 2 +-
 gdb/testsuite/gdb.ada/inline-section-gc.exp           | 2 +-
 gdb/testsuite/gdb.ada/int_deref.exp                   | 2 +-
 gdb/testsuite/gdb.ada/interface.exp                   | 2 +-
 gdb/testsuite/gdb.ada/iwide.exp                       | 2 +-
 gdb/testsuite/gdb.ada/lang_switch.exp                 | 2 +-
 gdb/testsuite/gdb.ada/length_cond.exp                 | 2 +-
 gdb/testsuite/gdb.ada/literals.exp                    | 2 +-
 gdb/testsuite/gdb.ada/local-enum.exp                  | 2 +-
 gdb/testsuite/gdb.ada/maint_with_ada.exp              | 2 +-
 gdb/testsuite/gdb.ada/mi_catch_assert.exp             | 2 +-
 gdb/testsuite/gdb.ada/mi_catch_ex.exp                 | 2 +-
 gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp            | 2 +-
 gdb/testsuite/gdb.ada/mi_dyn_arr.exp                  | 2 +-
 gdb/testsuite/gdb.ada/mi_ex_cond.exp                  | 2 +-
 gdb/testsuite/gdb.ada/mi_exc_info.exp                 | 2 +-
 gdb/testsuite/gdb.ada/mi_interface.exp                | 2 +-
 gdb/testsuite/gdb.ada/mi_prot.exp                     | 2 +-
 gdb/testsuite/gdb.ada/mi_ref_changeable.exp           | 2 +-
 gdb/testsuite/gdb.ada/mi_string_access.exp            | 2 +-
 gdb/testsuite/gdb.ada/mi_task_arg.exp                 | 2 +-
 gdb/testsuite/gdb.ada/mi_task_info.exp                | 2 +-
 gdb/testsuite/gdb.ada/mi_var_access.exp               | 4 +---
 gdb/testsuite/gdb.ada/mi_var_array.exp                | 2 +-
 gdb/testsuite/gdb.ada/mi_var_union.exp                | 2 +-
 gdb/testsuite/gdb.ada/mi_variant.exp                  | 2 +-
 gdb/testsuite/gdb.ada/minsyms.exp                     | 2 +-
 gdb/testsuite/gdb.ada/mod_from_name.exp               | 2 +-
 gdb/testsuite/gdb.ada/multiarray.exp                  | 2 +-
 gdb/testsuite/gdb.ada/n_arr_bound.exp                 | 2 +-
 gdb/testsuite/gdb.ada/nested.exp                      | 2 +-
 gdb/testsuite/gdb.ada/non-ascii-latin-1.exp           | 2 +-
 gdb/testsuite/gdb.ada/non-ascii-latin-3.exp           | 2 +-
 gdb/testsuite/gdb.ada/non-ascii-utf-8.exp             | 2 +-
 gdb/testsuite/gdb.ada/notcplusplus.exp                | 2 +-
 gdb/testsuite/gdb.ada/null_array.exp                  | 2 +-
 gdb/testsuite/gdb.ada/null_overload.exp               | 2 +-
 gdb/testsuite/gdb.ada/null_record.exp                 | 2 +-
 gdb/testsuite/gdb.ada/operator_bp.exp                 | 2 +-
 gdb/testsuite/gdb.ada/operator_call.exp               | 2 +-
 gdb/testsuite/gdb.ada/optim_drec.exp                  | 2 +-
 gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp      | 2 +-
 gdb/testsuite/gdb.ada/overload_menu_crash.exp         | 2 +-
 gdb/testsuite/gdb.ada/packed_array.exp                | 2 +-
 gdb/testsuite/gdb.ada/packed_array_assign.exp         | 2 +-
 gdb/testsuite/gdb.ada/packed_record.exp               | 2 +-
 gdb/testsuite/gdb.ada/packed_tagged.exp               | 2 +-
 gdb/testsuite/gdb.ada/pckd_arr_ren.exp                | 2 +-
 gdb/testsuite/gdb.ada/pckd_neg.exp                    | 2 +-
 gdb/testsuite/gdb.ada/pkd_arr_elem.exp                | 2 +-
 gdb/testsuite/gdb.ada/pp-rec-component.exp            | 2 +-
 gdb/testsuite/gdb.ada/print_chars.exp                 | 2 +-
 gdb/testsuite/gdb.ada/print_pc.exp                    | 2 +-
 gdb/testsuite/gdb.ada/ptr_typedef.exp                 | 2 +-
 gdb/testsuite/gdb.ada/ptype_arith_binop.exp           | 2 +-
 gdb/testsuite/gdb.ada/ptype_array.exp                 | 2 +-
 gdb/testsuite/gdb.ada/ptype_field.exp                 | 2 +-
 gdb/testsuite/gdb.ada/ptype_tagged_param.exp          | 2 +-
 gdb/testsuite/gdb.ada/ptype_union.exp                 | 2 +-
 gdb/testsuite/gdb.ada/py_range.exp                    | 2 +-
 gdb/testsuite/gdb.ada/py_taft.exp                     | 2 +-
 gdb/testsuite/gdb.ada/rdv_wait.exp                    | 2 +-
 gdb/testsuite/gdb.ada/rec_comp.exp                    | 2 +-
 gdb/testsuite/gdb.ada/rec_ptype.exp                   | 2 +-
 gdb/testsuite/gdb.ada/rec_return.exp                  | 2 +-
 gdb/testsuite/gdb.ada/ref_param.exp                   | 2 +-
 gdb/testsuite/gdb.ada/ref_tick_size.exp               | 2 +-
 gdb/testsuite/gdb.ada/rename_subscript_param.exp      | 2 +-
 gdb/testsuite/gdb.ada/repeat_dyn.exp                  | 2 +-
 gdb/testsuite/gdb.ada/same_component_name.exp         | 2 +-
 gdb/testsuite/gdb.ada/same_enum.exp                   | 2 +-
 gdb/testsuite/gdb.ada/scalar_storage.exp              | 2 +-
 gdb/testsuite/gdb.ada/scoped_watch.exp                | 2 +-
 gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp            | 2 +-
 gdb/testsuite/gdb.ada/set_wstr.exp                    | 2 +-
 gdb/testsuite/gdb.ada/small_reg_param.exp             | 2 +-
 gdb/testsuite/gdb.ada/start.exp                       | 2 +-
 gdb/testsuite/gdb.ada/str_binop_equal.exp             | 2 +-
 gdb/testsuite/gdb.ada/str_ref_cmp.exp                 | 2 +-
 gdb/testsuite/gdb.ada/str_uninit.exp                  | 2 +-
 gdb/testsuite/gdb.ada/sub_variant.exp                 | 2 +-
 gdb/testsuite/gdb.ada/sym_print_name.exp              | 2 +-
 gdb/testsuite/gdb.ada/taft_type.exp                   | 2 +-
 gdb/testsuite/gdb.ada/tagged.exp                      | 2 +-
 gdb/testsuite/gdb.ada/tagged_access.exp               | 2 +-
 gdb/testsuite/gdb.ada/tagged_not_init.exp             | 2 +-
 gdb/testsuite/gdb.ada/task_bp.exp                     | 2 +-
 gdb/testsuite/gdb.ada/task_switch_in_core.exp         | 2 +-
 gdb/testsuite/gdb.ada/task_watch.exp                  | 2 +-
 gdb/testsuite/gdb.ada/tasks.exp                       | 2 +-
 gdb/testsuite/gdb.ada/tick_last_segv.exp              | 2 +-
 gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp  | 2 +-
 gdb/testsuite/gdb.ada/type_coercion.exp               | 2 +-
 gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec.exp      | 2 +-
 gdb/testsuite/gdb.ada/unchecked_union.exp             | 2 +-
 gdb/testsuite/gdb.ada/uninitialized_vars.exp          | 2 +-
 gdb/testsuite/gdb.ada/unsigned_last.exp               | 2 +-
 gdb/testsuite/gdb.ada/unsigned_range.exp              | 2 +-
 gdb/testsuite/gdb.ada/var_arr_attrs.exp               | 2 +-
 gdb/testsuite/gdb.ada/var_arr_typedef.exp             | 2 +-
 gdb/testsuite/gdb.ada/var_rec_arr.exp                 | 2 +-
 gdb/testsuite/gdb.ada/variant-record.exp              | 2 +-
 gdb/testsuite/gdb.ada/variant.exp                     | 2 +-
 gdb/testsuite/gdb.ada/variant_record_packed_array.exp | 2 +-
 gdb/testsuite/gdb.ada/varsize_limit.exp               | 2 +-
 gdb/testsuite/gdb.ada/vla.exp                         | 2 +-
 gdb/testsuite/gdb.ada/voidctx.exp                     | 2 +-
 gdb/testsuite/gdb.ada/watch_arg.exp                   | 2 +-
 gdb/testsuite/gdb.ada/watch_minus_l.exp               | 2 +-
 gdb/testsuite/gdb.ada/whatis_array_val.exp            | 2 +-
 gdb/testsuite/gdb.ada/widewide.exp                    | 2 +-
 gdb/testsuite/gdb.ada/win_fu_syms.exp                 | 2 +-
 201 files changed, 201 insertions(+), 203 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/O2_float_param.exp b/gdb/testsuite/gdb.ada/O2_float_param.exp
index f34dc86b0bc..e2ecb8dc5c1 100644
--- a/gdb/testsuite/gdb.ada/O2_float_param.exp
+++ b/gdb/testsuite/gdb.ada/O2_float_param.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/access_tagged_param.exp b/gdb/testsuite/gdb.ada/access_tagged_param.exp
index 4676cbdddc3..d025e554ca5 100644
--- a/gdb/testsuite/gdb.ada/access_tagged_param.exp
+++ b/gdb/testsuite/gdb.ada/access_tagged_param.exp
@@ -18,7 +18,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/access_to_packed_array.exp b/gdb/testsuite/gdb.ada/access_to_packed_array.exp
index bb31b5b7bef..0e772948625 100644
--- a/gdb/testsuite/gdb.ada/access_to_packed_array.exp
+++ b/gdb/testsuite/gdb.ada/access_to_packed_array.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/access_to_unbounded_array.exp b/gdb/testsuite/gdb.ada/access_to_unbounded_array.exp
index 46715edaf48..39947abe25e 100644
--- a/gdb/testsuite/gdb.ada/access_to_unbounded_array.exp
+++ b/gdb/testsuite/gdb.ada/access_to_unbounded_array.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/addr_arith.exp b/gdb/testsuite/gdb.ada/addr_arith.exp
index 82d2e6744f5..511c407d80c 100644
--- a/gdb/testsuite/gdb.ada/addr_arith.exp
+++ b/gdb/testsuite/gdb.ada/addr_arith.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_na07_019
 
diff --git a/gdb/testsuite/gdb.ada/aliased_array.exp b/gdb/testsuite/gdb.ada/aliased_array.exp
index 84bfb8b0e99..f59e7066d09 100644
--- a/gdb/testsuite/gdb.ada/aliased_array.exp
+++ b/gdb/testsuite/gdb.ada/aliased_array.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp b/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp
index 39e12c6160a..30ff315a73f 100644
--- a/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp
+++ b/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile enum_with_gap_main
 
diff --git a/gdb/testsuite/gdb.ada/arr_arr.exp b/gdb/testsuite/gdb.ada/arr_arr.exp
index 8358aaec52c..ce05933d992 100644
--- a/gdb/testsuite/gdb.ada/arr_arr.exp
+++ b/gdb/testsuite/gdb.ada/arr_arr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/arr_enum_idx_w_gap.exp b/gdb/testsuite/gdb.ada/arr_enum_idx_w_gap.exp
index ed1915fa098..fa0ba4c11d5 100644
--- a/gdb/testsuite/gdb.ada/arr_enum_idx_w_gap.exp
+++ b/gdb/testsuite/gdb.ada/arr_enum_idx_w_gap.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_q418_043
 
diff --git a/gdb/testsuite/gdb.ada/array_bounds.exp b/gdb/testsuite/gdb.ada/array_bounds.exp
index 0a897d06b58..6bc30e02d99 100644
--- a/gdb/testsuite/gdb.ada/array_bounds.exp
+++ b/gdb/testsuite/gdb.ada/array_bounds.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile bar
 
diff --git a/gdb/testsuite/gdb.ada/array_char_idx.exp b/gdb/testsuite/gdb.ada/array_char_idx.exp
index 91c9e351310..b81e8bf04dd 100644
--- a/gdb/testsuite/gdb.ada/array_char_idx.exp
+++ b/gdb/testsuite/gdb.ada/array_char_idx.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/array_of_symbolic_length.exp b/gdb/testsuite/gdb.ada/array_of_symbolic_length.exp
index a94bdd7f71f..d96ac20b48b 100644
--- a/gdb/testsuite/gdb.ada/array_of_symbolic_length.exp
+++ b/gdb/testsuite/gdb.ada/array_of_symbolic_length.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/array_of_variable_length.exp b/gdb/testsuite/gdb.ada/array_of_variable_length.exp
index 5547b7f1af6..04dad957f34 100644
--- a/gdb/testsuite/gdb.ada/array_of_variable_length.exp
+++ b/gdb/testsuite/gdb.ada/array_of_variable_length.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/array_of_variant.exp b/gdb/testsuite/gdb.ada/array_of_variant.exp
index 3d0bc672c18..626e6446520 100644
--- a/gdb/testsuite/gdb.ada/array_of_variant.exp
+++ b/gdb/testsuite/gdb.ada/array_of_variant.exp
@@ -16,7 +16,7 @@
 load_lib "ada.exp"
 load_lib "gdb-python.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile p
 
diff --git a/gdb/testsuite/gdb.ada/array_ptr_renaming.exp b/gdb/testsuite/gdb.ada/array_ptr_renaming.exp
index 9832cdd360e..478261783bd 100644
--- a/gdb/testsuite/gdb.ada/array_ptr_renaming.exp
+++ b/gdb/testsuite/gdb.ada/array_ptr_renaming.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/array_return.exp b/gdb/testsuite/gdb.ada/array_return.exp
index 97ba3bc4e59..5125dd10f12 100644
--- a/gdb/testsuite/gdb.ada/array_return.exp
+++ b/gdb/testsuite/gdb.ada/array_return.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile p
 
diff --git a/gdb/testsuite/gdb.ada/array_subscript_addr.exp b/gdb/testsuite/gdb.ada/array_subscript_addr.exp
index e6cdddf9b1c..7f78796adc5 100644
--- a/gdb/testsuite/gdb.ada/array_subscript_addr.exp
+++ b/gdb/testsuite/gdb.ada/array_subscript_addr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile p
 
diff --git a/gdb/testsuite/gdb.ada/arraydim.exp b/gdb/testsuite/gdb.ada/arraydim.exp
index 2c26865d35b..b8c3a01fa86 100644
--- a/gdb/testsuite/gdb.ada/arraydim.exp
+++ b/gdb/testsuite/gdb.ada/arraydim.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/arrayidx.exp b/gdb/testsuite/gdb.ada/arrayidx.exp
index 43393e61d3c..d3440197171 100644
--- a/gdb/testsuite/gdb.ada/arrayidx.exp
+++ b/gdb/testsuite/gdb.ada/arrayidx.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile p
 
diff --git a/gdb/testsuite/gdb.ada/arrayparam.exp b/gdb/testsuite/gdb.ada/arrayparam.exp
index 3c6f59b662f..c3138bfb2c3 100644
--- a/gdb/testsuite/gdb.ada/arrayparam.exp
+++ b/gdb/testsuite/gdb.ada/arrayparam.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/arrayptr.exp b/gdb/testsuite/gdb.ada/arrayptr.exp
index eefd21ae376..a093f4acdde 100644
--- a/gdb/testsuite/gdb.ada/arrayptr.exp
+++ b/gdb/testsuite/gdb.ada/arrayptr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/assign_1.exp b/gdb/testsuite/gdb.ada/assign_1.exp
index 25e92e7d874..eaf0764456d 100644
--- a/gdb/testsuite/gdb.ada/assign_1.exp
+++ b/gdb/testsuite/gdb.ada/assign_1.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 gdb_exit
 gdb_start
diff --git a/gdb/testsuite/gdb.ada/assign_arr.exp b/gdb/testsuite/gdb.ada/assign_arr.exp
index 35a4b4dfce9..316cf159936 100644
--- a/gdb/testsuite/gdb.ada/assign_arr.exp
+++ b/gdb/testsuite/gdb.ada/assign_arr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile main_p324_051
 
diff --git a/gdb/testsuite/gdb.ada/atomic_enum.exp b/gdb/testsuite/gdb.ada/atomic_enum.exp
index 6e0b5291f2a..e88d2f09e80 100644
--- a/gdb/testsuite/gdb.ada/atomic_enum.exp
+++ b/gdb/testsuite/gdb.ada/atomic_enum.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp b/gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp
index 7b02c58ff46..3cea6c65eac 100644
--- a/gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp
+++ b/gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile "foo"
 
diff --git a/gdb/testsuite/gdb.ada/bad-task-bp-keyword.exp b/gdb/testsuite/gdb.ada/bad-task-bp-keyword.exp
index 5d741d3b831..bfef0314b4d 100644
--- a/gdb/testsuite/gdb.ada/bad-task-bp-keyword.exp
+++ b/gdb/testsuite/gdb.ada/bad-task-bp-keyword.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/bias.exp b/gdb/testsuite/gdb.ada/bias.exp
index 1d30db9dc19..b4d6c9efc10 100644
--- a/gdb/testsuite/gdb.ada/bias.exp
+++ b/gdb/testsuite/gdb.ada/bias.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile bias
 
diff --git a/gdb/testsuite/gdb.ada/big_packed_array.exp b/gdb/testsuite/gdb.ada/big_packed_array.exp
index cc500463e37..b7c6efe0ff9 100644
--- a/gdb/testsuite/gdb.ada/big_packed_array.exp
+++ b/gdb/testsuite/gdb.ada/big_packed_array.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_ra24_010
 
diff --git a/gdb/testsuite/gdb.ada/boolean_expr.exp b/gdb/testsuite/gdb.ada/boolean_expr.exp
index 375f7bdafac..66d6f04a0c5 100644
--- a/gdb/testsuite/gdb.ada/boolean_expr.exp
+++ b/gdb/testsuite/gdb.ada/boolean_expr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 gdb_exit
 gdb_start
diff --git a/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp b/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp
index 98f75f76fe1..d7d031f7aea 100644
--- a/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp
+++ b/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp
@@ -20,7 +20,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_h731_021
 
diff --git a/gdb/testsuite/gdb.ada/bp_enum_homonym.exp b/gdb/testsuite/gdb.ada/bp_enum_homonym.exp
index 37cb8064f6f..2f01bfa3571 100644
--- a/gdb/testsuite/gdb.ada/bp_enum_homonym.exp
+++ b/gdb/testsuite/gdb.ada/bp_enum_homonym.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile p
 
diff --git a/gdb/testsuite/gdb.ada/bp_fun_addr.exp b/gdb/testsuite/gdb.ada/bp_fun_addr.exp
index 17f4696fb8e..1f7570fe3e0 100644
--- a/gdb/testsuite/gdb.ada/bp_fun_addr.exp
+++ b/gdb/testsuite/gdb.ada/bp_fun_addr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile bp_fun_addr
 
diff --git a/gdb/testsuite/gdb.ada/bp_inlined_func.exp b/gdb/testsuite/gdb.ada/bp_inlined_func.exp
index c2434241831..319857ec142 100644
--- a/gdb/testsuite/gdb.ada/bp_inlined_func.exp
+++ b/gdb/testsuite/gdb.ada/bp_inlined_func.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/bp_on_var.exp b/gdb/testsuite/gdb.ada/bp_on_var.exp
index a7e1bb2ab4d..f38c34001ee 100644
--- a/gdb/testsuite/gdb.ada/bp_on_var.exp
+++ b/gdb/testsuite/gdb.ada/bp_on_var.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/bp_range_type.exp b/gdb/testsuite/gdb.ada/bp_range_type.exp
index 73d947070d1..11d3c2daaed 100644
--- a/gdb/testsuite/gdb.ada/bp_range_type.exp
+++ b/gdb/testsuite/gdb.ada/bp_range_type.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/bp_reset.exp b/gdb/testsuite/gdb.ada/bp_reset.exp
index f1e8b2e9473..2a227a29499 100644
--- a/gdb/testsuite/gdb.ada/bp_reset.exp
+++ b/gdb/testsuite/gdb.ada/bp_reset.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/byte_packed_arr.exp b/gdb/testsuite/gdb.ada/byte_packed_arr.exp
index 86d3507a534..81bd50a56ef 100644
--- a/gdb/testsuite/gdb.ada/byte_packed_arr.exp
+++ b/gdb/testsuite/gdb.ada/byte_packed_arr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile reprod_main
 
diff --git a/gdb/testsuite/gdb.ada/call_pn.exp b/gdb/testsuite/gdb.ada/call_pn.exp
index 758b64abc35..50a07e71e83 100644
--- a/gdb/testsuite/gdb.ada/call_pn.exp
+++ b/gdb/testsuite/gdb.ada/call_pn.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/catch_assert_if.exp b/gdb/testsuite/gdb.ada/catch_assert_if.exp
index 0f0ec4ddfe9..9e1687afcf5 100644
--- a/gdb/testsuite/gdb.ada/catch_assert_if.exp
+++ b/gdb/testsuite/gdb.ada/catch_assert_if.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile bla
 
diff --git a/gdb/testsuite/gdb.ada/catch_ex.exp b/gdb/testsuite/gdb.ada/catch_ex.exp
index d8fa04015fd..9fc8700c360 100644
--- a/gdb/testsuite/gdb.ada/catch_ex.exp
+++ b/gdb/testsuite/gdb.ada/catch_ex.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/catch_ex_std.exp b/gdb/testsuite/gdb.ada/catch_ex_std.exp
index c8e0c288127..3ec842e42f2 100644
--- a/gdb/testsuite/gdb.ada/catch_ex_std.exp
+++ b/gdb/testsuite/gdb.ada/catch_ex_std.exp
@@ -17,7 +17,7 @@ require !skip_shlib_tests
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/char_enum.exp b/gdb/testsuite/gdb.ada/char_enum.exp
index ed400f1e046..7db3edc7d12 100644
--- a/gdb/testsuite/gdb.ada/char_enum.exp
+++ b/gdb/testsuite/gdb.ada/char_enum.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/char_enum_overload.exp b/gdb/testsuite/gdb.ada/char_enum_overload.exp
index 17d16ef1bf1..ed8f830bfb7 100644
--- a/gdb/testsuite/gdb.ada/char_enum_overload.exp
+++ b/gdb/testsuite/gdb.ada/char_enum_overload.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/char_enum_unicode.exp b/gdb/testsuite/gdb.ada/char_enum_unicode.exp
index fad239983a3..df1360366c3 100644
--- a/gdb/testsuite/gdb.ada/char_enum_unicode.exp
+++ b/gdb/testsuite/gdb.ada/char_enum_unicode.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/char_param.exp b/gdb/testsuite/gdb.ada/char_param.exp
index cca7aab01c1..6abe595d0e5 100644
--- a/gdb/testsuite/gdb.ada/char_param.exp
+++ b/gdb/testsuite/gdb.ada/char_param.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/complete.exp b/gdb/testsuite/gdb.ada/complete.exp
index a52b3a42b75..e9b8256ee5d 100644
--- a/gdb/testsuite/gdb.ada/complete.exp
+++ b/gdb/testsuite/gdb.ada/complete.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/cond_lang.exp b/gdb/testsuite/gdb.ada/cond_lang.exp
index 8a68e5edc72..7834d989e17 100644
--- a/gdb/testsuite/gdb.ada/cond_lang.exp
+++ b/gdb/testsuite/gdb.ada/cond_lang.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile a
 
diff --git a/gdb/testsuite/gdb.ada/convvar_comp.exp b/gdb/testsuite/gdb.ada/convvar_comp.exp
index 366ac60d7c8..c865c400534 100644
--- a/gdb/testsuite/gdb.ada/convvar_comp.exp
+++ b/gdb/testsuite/gdb.ada/convvar_comp.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile pb16_063
 
diff --git a/gdb/testsuite/gdb.ada/dgopt.exp b/gdb/testsuite/gdb.ada/dgopt.exp
index 0f9d9bd24bc..cd372383734 100644
--- a/gdb/testsuite/gdb.ada/dgopt.exp
+++ b/gdb/testsuite/gdb.ada/dgopt.exp
@@ -17,7 +17,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile x
 
diff --git a/gdb/testsuite/gdb.ada/disc_arr_bound.exp b/gdb/testsuite/gdb.ada/disc_arr_bound.exp
index e5155f33c34..bd069e4d647 100644
--- a/gdb/testsuite/gdb.ada/disc_arr_bound.exp
+++ b/gdb/testsuite/gdb.ada/disc_arr_bound.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_n612_026
 
diff --git a/gdb/testsuite/gdb.ada/discrete-char.exp b/gdb/testsuite/gdb.ada/discrete-char.exp
index 1896252d099..7503fe6958d 100644
--- a/gdb/testsuite/gdb.ada/discrete-char.exp
+++ b/gdb/testsuite/gdb.ada/discrete-char.exp
@@ -17,7 +17,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile main
 
diff --git a/gdb/testsuite/gdb.ada/display_nested.exp b/gdb/testsuite/gdb.ada/display_nested.exp
index 002144deae3..75b65034e2c 100644
--- a/gdb/testsuite/gdb.ada/display_nested.exp
+++ b/gdb/testsuite/gdb.ada/display_nested.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/dot_all.exp b/gdb/testsuite/gdb.ada/dot_all.exp
index 0b0eba53c29..ab188998fd8 100644
--- a/gdb/testsuite/gdb.ada/dot_all.exp
+++ b/gdb/testsuite/gdb.ada/dot_all.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/dyn_arrayidx.exp b/gdb/testsuite/gdb.ada/dyn_arrayidx.exp
index b715f696640..9e345cfc1d1 100644
--- a/gdb/testsuite/gdb.ada/dyn_arrayidx.exp
+++ b/gdb/testsuite/gdb.ada/dyn_arrayidx.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/dyn_loc.exp b/gdb/testsuite/gdb.ada/dyn_loc.exp
index d2cf68d1dc7..f0d7abe0270 100644
--- a/gdb/testsuite/gdb.ada/dyn_loc.exp
+++ b/gdb/testsuite/gdb.ada/dyn_loc.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile p
 
diff --git a/gdb/testsuite/gdb.ada/dyn_stride.exp b/gdb/testsuite/gdb.ada/dyn_stride.exp
index dad3f0c0cbd..ec1d2a9ad8e 100644
--- a/gdb/testsuite/gdb.ada/dyn_stride.exp
+++ b/gdb/testsuite/gdb.ada/dyn_stride.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/dynamic-iface.exp b/gdb/testsuite/gdb.ada/dynamic-iface.exp
index 2942a437687..e75569c48b8 100644
--- a/gdb/testsuite/gdb.ada/dynamic-iface.exp
+++ b/gdb/testsuite/gdb.ada/dynamic-iface.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 if {![gnat_runtime_has_debug_info]} {
     untested "GNAT runtime debuginfo required for this test"
diff --git a/gdb/testsuite/gdb.ada/enum_idx_packed.exp b/gdb/testsuite/gdb.ada/enum_idx_packed.exp
index e827da5367b..eaebf0a3fc8 100644
--- a/gdb/testsuite/gdb.ada/enum_idx_packed.exp
+++ b/gdb/testsuite/gdb.ada/enum_idx_packed.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/enum_qual.exp b/gdb/testsuite/gdb.ada/enum_qual.exp
index 1a099b0b02b..e305a514485 100644
--- a/gdb/testsuite/gdb.ada/enum_qual.exp
+++ b/gdb/testsuite/gdb.ada/enum_qual.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile qual
 
diff --git a/gdb/testsuite/gdb.ada/enums_overload.exp b/gdb/testsuite/gdb.ada/enums_overload.exp
index 63652598a0c..81ec120f404 100644
--- a/gdb/testsuite/gdb.ada/enums_overload.exp
+++ b/gdb/testsuite/gdb.ada/enums_overload.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile enums_overload_main
 
diff --git a/gdb/testsuite/gdb.ada/excep_handle.exp b/gdb/testsuite/gdb.ada/excep_handle.exp
index ddc1886b59d..59e764604e9 100644
--- a/gdb/testsuite/gdb.ada/excep_handle.exp
+++ b/gdb/testsuite/gdb.ada/excep_handle.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/exec_changed.exp b/gdb/testsuite/gdb.ada/exec_changed.exp
index e09f59e5269..2d9b46a20a6 100644
--- a/gdb/testsuite/gdb.ada/exec_changed.exp
+++ b/gdb/testsuite/gdb.ada/exec_changed.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 # This testcase verifies the behavior of the `start' command, which
 # does not work when we use the gdb stub...
diff --git a/gdb/testsuite/gdb.ada/expr_delims.exp b/gdb/testsuite/gdb.ada/expr_delims.exp
index c53d88fab34..0841caaa39f 100644
--- a/gdb/testsuite/gdb.ada/expr_delims.exp
+++ b/gdb/testsuite/gdb.ada/expr_delims.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/expr_with_funcall.exp b/gdb/testsuite/gdb.ada/expr_with_funcall.exp
index ddbbba00976..f5f92412f5e 100644
--- a/gdb/testsuite/gdb.ada/expr_with_funcall.exp
+++ b/gdb/testsuite/gdb.ada/expr_with_funcall.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile expr_r821_013
 
diff --git a/gdb/testsuite/gdb.ada/exprs.exp b/gdb/testsuite/gdb.ada/exprs.exp
index 8708772c5a4..93eee702db8 100644
--- a/gdb/testsuite/gdb.ada/exprs.exp
+++ b/gdb/testsuite/gdb.ada/exprs.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile p
 
diff --git a/gdb/testsuite/gdb.ada/fin_fun_out.exp b/gdb/testsuite/gdb.ada/fin_fun_out.exp
index 3cd8270dddf..dd12f1c0752 100644
--- a/gdb/testsuite/gdb.ada/fin_fun_out.exp
+++ b/gdb/testsuite/gdb.ada/fin_fun_out.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_o525_013
 
diff --git a/gdb/testsuite/gdb.ada/fixed_cmp.exp b/gdb/testsuite/gdb.ada/fixed_cmp.exp
index 5b7a061ffbd..9a39ae35833 100644
--- a/gdb/testsuite/gdb.ada/fixed_cmp.exp
+++ b/gdb/testsuite/gdb.ada/fixed_cmp.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile fixed
 
diff --git a/gdb/testsuite/gdb.ada/fixed_points.exp b/gdb/testsuite/gdb.ada/fixed_points.exp
index 8f32ec71742..fcd2e7b861a 100644
--- a/gdb/testsuite/gdb.ada/fixed_points.exp
+++ b/gdb/testsuite/gdb.ada/fixed_points.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile fixed_points
 
diff --git a/gdb/testsuite/gdb.ada/fixed_points_function.exp b/gdb/testsuite/gdb.ada/fixed_points_function.exp
index 6bc8578b87c..e30cc303d12 100644
--- a/gdb/testsuite/gdb.ada/fixed_points_function.exp
+++ b/gdb/testsuite/gdb.ada/fixed_points_function.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile fixed_points_function
 
diff --git a/gdb/testsuite/gdb.ada/float-bits.exp b/gdb/testsuite/gdb.ada/float-bits.exp
index dab16a60286..3e7a6c290a0 100644
--- a/gdb/testsuite/gdb.ada/float-bits.exp
+++ b/gdb/testsuite/gdb.ada/float-bits.exp
@@ -17,7 +17,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile prog
 
diff --git a/gdb/testsuite/gdb.ada/float_param.exp b/gdb/testsuite/gdb.ada/float_param.exp
index 78c002b95b7..ea75046c5cb 100644
--- a/gdb/testsuite/gdb.ada/float_param.exp
+++ b/gdb/testsuite/gdb.ada/float_param.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/formatted_ref.exp b/gdb/testsuite/gdb.ada/formatted_ref.exp
index 1d780cc1b0c..03044ab20da 100644
--- a/gdb/testsuite/gdb.ada/formatted_ref.exp
+++ b/gdb/testsuite/gdb.ada/formatted_ref.exp
@@ -26,7 +26,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile formatted_ref
 
diff --git a/gdb/testsuite/gdb.ada/frame_arg_lang.exp b/gdb/testsuite/gdb.ada/frame_arg_lang.exp
index dab46c91db4..41107a9af49 100644
--- a/gdb/testsuite/gdb.ada/frame_arg_lang.exp
+++ b/gdb/testsuite/gdb.ada/frame_arg_lang.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile bla
 set cfile "foo"
diff --git a/gdb/testsuite/gdb.ada/frame_args.exp b/gdb/testsuite/gdb.ada/frame_args.exp
index f3fa41f7981..dd54d729425 100644
--- a/gdb/testsuite/gdb.ada/frame_args.exp
+++ b/gdb/testsuite/gdb.ada/frame_args.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/fullname_bp.exp b/gdb/testsuite/gdb.ada/fullname_bp.exp
index 68631841418..6821cee033a 100644
--- a/gdb/testsuite/gdb.ada/fullname_bp.exp
+++ b/gdb/testsuite/gdb.ada/fullname_bp.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/fun_addr.exp b/gdb/testsuite/gdb.ada/fun_addr.exp
index 31f777623cc..b2800aa5c6c 100644
--- a/gdb/testsuite/gdb.ada/fun_addr.exp
+++ b/gdb/testsuite/gdb.ada/fun_addr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/fun_in_declare.exp b/gdb/testsuite/gdb.ada/fun_in_declare.exp
index a0972441e98..a330e95b18c 100644
--- a/gdb/testsuite/gdb.ada/fun_in_declare.exp
+++ b/gdb/testsuite/gdb.ada/fun_in_declare.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/fun_overload_menu.exp b/gdb/testsuite/gdb.ada/fun_overload_menu.exp
index bd60a9e2db0..93f02155625 100644
--- a/gdb/testsuite/gdb.ada/fun_overload_menu.exp
+++ b/gdb/testsuite/gdb.ada/fun_overload_menu.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/fun_renaming.exp b/gdb/testsuite/gdb.ada/fun_renaming.exp
index 89555e8db5f..d58817dbdd8 100644
--- a/gdb/testsuite/gdb.ada/fun_renaming.exp
+++ b/gdb/testsuite/gdb.ada/fun_renaming.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile fun_renaming
 
diff --git a/gdb/testsuite/gdb.ada/funcall_char.exp b/gdb/testsuite/gdb.ada/funcall_char.exp
index 0d8735a9645..7eb14816fea 100644
--- a/gdb/testsuite/gdb.ada/funcall_char.exp
+++ b/gdb/testsuite/gdb.ada/funcall_char.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/funcall_param.exp b/gdb/testsuite/gdb.ada/funcall_param.exp
index 66809578be7..1549d5a525f 100644
--- a/gdb/testsuite/gdb.ada/funcall_param.exp
+++ b/gdb/testsuite/gdb.ada/funcall_param.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/funcall_ptr.exp b/gdb/testsuite/gdb.ada/funcall_ptr.exp
index 97cd296c100..235da6ed479 100644
--- a/gdb/testsuite/gdb.ada/funcall_ptr.exp
+++ b/gdb/testsuite/gdb.ada/funcall_ptr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/funcall_ref.exp b/gdb/testsuite/gdb.ada/funcall_ref.exp
index c783806d30d..f8f9492d17f 100644
--- a/gdb/testsuite/gdb.ada/funcall_ref.exp
+++ b/gdb/testsuite/gdb.ada/funcall_ref.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/ghost.exp b/gdb/testsuite/gdb.ada/ghost.exp
index 412a2607683..454c7fa478d 100644
--- a/gdb/testsuite/gdb.ada/ghost.exp
+++ b/gdb/testsuite/gdb.ada/ghost.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile main
 
diff --git a/gdb/testsuite/gdb.ada/homonym.exp b/gdb/testsuite/gdb.ada/homonym.exp
index edf92d0ece0..dd3b737016a 100644
--- a/gdb/testsuite/gdb.ada/homonym.exp
+++ b/gdb/testsuite/gdb.ada/homonym.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile homonym_main
 
diff --git a/gdb/testsuite/gdb.ada/info_addr_mixed_case.exp b/gdb/testsuite/gdb.ada/info_addr_mixed_case.exp
index 4b3277b9061..8fc7a550d3f 100644
--- a/gdb/testsuite/gdb.ada/info_addr_mixed_case.exp
+++ b/gdb/testsuite/gdb.ada/info_addr_mixed_case.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/info_auto_lang.exp b/gdb/testsuite/gdb.ada/info_auto_lang.exp
index 9e17cf6c028..a79d86a7a4d 100644
--- a/gdb/testsuite/gdb.ada/info_auto_lang.exp
+++ b/gdb/testsuite/gdb.ada/info_auto_lang.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 # This test verifies that the commands
 #   info [functions|variables|types]
diff --git a/gdb/testsuite/gdb.ada/info_exc.exp b/gdb/testsuite/gdb.ada/info_exc.exp
index c0a9e4dea53..f37c2e03159 100644
--- a/gdb/testsuite/gdb.ada/info_exc.exp
+++ b/gdb/testsuite/gdb.ada/info_exc.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/info_locals_renaming.exp b/gdb/testsuite/gdb.ada/info_locals_renaming.exp
index 965b67682a5..e2eff3cad32 100644
--- a/gdb/testsuite/gdb.ada/info_locals_renaming.exp
+++ b/gdb/testsuite/gdb.ada/info_locals_renaming.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/info_types.exp b/gdb/testsuite/gdb.ada/info_types.exp
index c24bafa8a54..0a780376636 100644
--- a/gdb/testsuite/gdb.ada/info_types.exp
+++ b/gdb/testsuite/gdb.ada/info_types.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.ada/inline-section-gc.exp b/gdb/testsuite/gdb.ada/inline-section-gc.exp
index e1b7bb616b7..6a2009314e1 100644
--- a/gdb/testsuite/gdb.ada/inline-section-gc.exp
+++ b/gdb/testsuite/gdb.ada/inline-section-gc.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile caller
 
diff --git a/gdb/testsuite/gdb.ada/int_deref.exp b/gdb/testsuite/gdb.ada/int_deref.exp
index c54044be626..d557c22b608 100644
--- a/gdb/testsuite/gdb.ada/int_deref.exp
+++ b/gdb/testsuite/gdb.ada/int_deref.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/interface.exp b/gdb/testsuite/gdb.ada/interface.exp
index 06b9660113b..bf08aa59601 100644
--- a/gdb/testsuite/gdb.ada/interface.exp
+++ b/gdb/testsuite/gdb.ada/interface.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 if {![gnat_runtime_has_debug_info]} {
     untested "GNAT runtime debuginfo required for this test"
diff --git a/gdb/testsuite/gdb.ada/iwide.exp b/gdb/testsuite/gdb.ada/iwide.exp
index 5d24ae5fd58..fc4bc79eb65 100644
--- a/gdb/testsuite/gdb.ada/iwide.exp
+++ b/gdb/testsuite/gdb.ada/iwide.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 if {![gnat_runtime_has_debug_info]} {
     untested "GNAT runtime debuginfo required for this test"
diff --git a/gdb/testsuite/gdb.ada/lang_switch.exp b/gdb/testsuite/gdb.ada/lang_switch.exp
index 2482977d908..3f9dfdf4c44 100644
--- a/gdb/testsuite/gdb.ada/lang_switch.exp
+++ b/gdb/testsuite/gdb.ada/lang_switch.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile lang_switch
 set cfile "foo"
diff --git a/gdb/testsuite/gdb.ada/length_cond.exp b/gdb/testsuite/gdb.ada/length_cond.exp
index f8619c3377f..4b9228a294e 100644
--- a/gdb/testsuite/gdb.ada/length_cond.exp
+++ b/gdb/testsuite/gdb.ada/length_cond.exp
@@ -18,7 +18,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile length_cond
 
diff --git a/gdb/testsuite/gdb.ada/literals.exp b/gdb/testsuite/gdb.ada/literals.exp
index 6badc857292..cb7028071ec 100644
--- a/gdb/testsuite/gdb.ada/literals.exp
+++ b/gdb/testsuite/gdb.ada/literals.exp
@@ -17,7 +17,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 clean_restart
 
diff --git a/gdb/testsuite/gdb.ada/local-enum.exp b/gdb/testsuite/gdb.ada/local-enum.exp
index 409ea35b162..0589ac2c4fa 100644
--- a/gdb/testsuite/gdb.ada/local-enum.exp
+++ b/gdb/testsuite/gdb.ada/local-enum.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile local
 
diff --git a/gdb/testsuite/gdb.ada/maint_with_ada.exp b/gdb/testsuite/gdb.ada/maint_with_ada.exp
index 24c64b5249a..9ea0faceb8c 100644
--- a/gdb/testsuite/gdb.ada/maint_with_ada.exp
+++ b/gdb/testsuite/gdb.ada/maint_with_ada.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile var_arr_typedef
 
diff --git a/gdb/testsuite/gdb.ada/mi_catch_assert.exp b/gdb/testsuite/gdb.ada/mi_catch_assert.exp
index d34938fa181..f807f1295e0 100644
--- a/gdb/testsuite/gdb.ada/mi_catch_assert.exp
+++ b/gdb/testsuite/gdb.ada/mi_catch_assert.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile bla
 
diff --git a/gdb/testsuite/gdb.ada/mi_catch_ex.exp b/gdb/testsuite/gdb.ada/mi_catch_ex.exp
index 3258476be56..6ca5473205c 100644
--- a/gdb/testsuite/gdb.ada/mi_catch_ex.exp
+++ b/gdb/testsuite/gdb.ada/mi_catch_ex.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp b/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp
index 9ca6688d430..5e91d0b8a40 100644
--- a/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp
+++ b/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/mi_dyn_arr.exp b/gdb/testsuite/gdb.ada/mi_dyn_arr.exp
index 13d2f865da3..afe902f5428 100644
--- a/gdb/testsuite/gdb.ada/mi_dyn_arr.exp
+++ b/gdb/testsuite/gdb.ada/mi_dyn_arr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/mi_ex_cond.exp b/gdb/testsuite/gdb.ada/mi_ex_cond.exp
index ddf9e0bbea7..db889e533b1 100644
--- a/gdb/testsuite/gdb.ada/mi_ex_cond.exp
+++ b/gdb/testsuite/gdb.ada/mi_ex_cond.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/mi_exc_info.exp b/gdb/testsuite/gdb.ada/mi_exc_info.exp
index aebf4cea5bd..b9da5f7df7f 100644
--- a/gdb/testsuite/gdb.ada/mi_exc_info.exp
+++ b/gdb/testsuite/gdb.ada/mi_exc_info.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/mi_interface.exp b/gdb/testsuite/gdb.ada/mi_interface.exp
index fa176e21ef1..2ddf4b1fca5 100644
--- a/gdb/testsuite/gdb.ada/mi_interface.exp
+++ b/gdb/testsuite/gdb.ada/mi_interface.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 if {![gnat_runtime_has_debug_info]} {
     untested "GNAT runtime debuginfo required for this test"
diff --git a/gdb/testsuite/gdb.ada/mi_prot.exp b/gdb/testsuite/gdb.ada/mi_prot.exp
index 5ec7f8ddc6d..8f8378d3bb1 100644
--- a/gdb/testsuite/gdb.ada/mi_prot.exp
+++ b/gdb/testsuite/gdb.ada/mi_prot.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 if { ![gnatmake_version_at_least 8] } {
     return -1
diff --git a/gdb/testsuite/gdb.ada/mi_ref_changeable.exp b/gdb/testsuite/gdb.ada/mi_ref_changeable.exp
index e42606f4785..4a1a0326d13 100644
--- a/gdb/testsuite/gdb.ada/mi_ref_changeable.exp
+++ b/gdb/testsuite/gdb.ada/mi_ref_changeable.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_rb20_056
 
diff --git a/gdb/testsuite/gdb.ada/mi_string_access.exp b/gdb/testsuite/gdb.ada/mi_string_access.exp
index 82fc6b66c33..f48a6bb6e00 100644
--- a/gdb/testsuite/gdb.ada/mi_string_access.exp
+++ b/gdb/testsuite/gdb.ada/mi_string_access.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile bar
 
diff --git a/gdb/testsuite/gdb.ada/mi_task_arg.exp b/gdb/testsuite/gdb.ada/mi_task_arg.exp
index d80dfd47015..390d083f9c8 100644
--- a/gdb/testsuite/gdb.ada/mi_task_arg.exp
+++ b/gdb/testsuite/gdb.ada/mi_task_arg.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile task_switch
 
diff --git a/gdb/testsuite/gdb.ada/mi_task_info.exp b/gdb/testsuite/gdb.ada/mi_task_info.exp
index 62d0b834dca..10bbeea8674 100644
--- a/gdb/testsuite/gdb.ada/mi_task_info.exp
+++ b/gdb/testsuite/gdb.ada/mi_task_info.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile task_switch
 
diff --git a/gdb/testsuite/gdb.ada/mi_var_access.exp b/gdb/testsuite/gdb.ada/mi_var_access.exp
index 0d5e4e949d6..177328c93f2 100644
--- a/gdb/testsuite/gdb.ada/mi_var_access.exp
+++ b/gdb/testsuite/gdb.ada/mi_var_access.exp
@@ -15,9 +15,7 @@
 
 load_lib "ada.exp"
 
-if {[skip_ada_tests]} {
-    return -1
-}
+require !skip_ada_tests
 
 standard_ada_testfile mi_access
 
diff --git a/gdb/testsuite/gdb.ada/mi_var_array.exp b/gdb/testsuite/gdb.ada/mi_var_array.exp
index a0904855222..67cd4488a08 100644
--- a/gdb/testsuite/gdb.ada/mi_var_array.exp
+++ b/gdb/testsuite/gdb.ada/mi_var_array.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile bar
 
diff --git a/gdb/testsuite/gdb.ada/mi_var_union.exp b/gdb/testsuite/gdb.ada/mi_var_union.exp
index 7a254d16c21..34932276050 100644
--- a/gdb/testsuite/gdb.ada/mi_var_union.exp
+++ b/gdb/testsuite/gdb.ada/mi_var_union.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile bar
 
diff --git a/gdb/testsuite/gdb.ada/mi_variant.exp b/gdb/testsuite/gdb.ada/mi_variant.exp
index e745819b882..ad5241d2a2b 100644
--- a/gdb/testsuite/gdb.ada/mi_variant.exp
+++ b/gdb/testsuite/gdb.ada/mi_variant.exp
@@ -16,7 +16,7 @@
 load_lib "ada.exp"
 load_lib "gdb-python.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile pkg
 
diff --git a/gdb/testsuite/gdb.ada/minsyms.exp b/gdb/testsuite/gdb.ada/minsyms.exp
index 4e974392a79..e1b82da50ef 100644
--- a/gdb/testsuite/gdb.ada/minsyms.exp
+++ b/gdb/testsuite/gdb.ada/minsyms.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_qb07_057
 
diff --git a/gdb/testsuite/gdb.ada/mod_from_name.exp b/gdb/testsuite/gdb.ada/mod_from_name.exp
index 7ee7d8c467e..679c07c7fa2 100644
--- a/gdb/testsuite/gdb.ada/mod_from_name.exp
+++ b/gdb/testsuite/gdb.ada/mod_from_name.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/multiarray.exp b/gdb/testsuite/gdb.ada/multiarray.exp
index 5a8e1eaff4a..45cbdc0dac5 100644
--- a/gdb/testsuite/gdb.ada/multiarray.exp
+++ b/gdb/testsuite/gdb.ada/multiarray.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile p
 
diff --git a/gdb/testsuite/gdb.ada/n_arr_bound.exp b/gdb/testsuite/gdb.ada/n_arr_bound.exp
index fc8544ee562..2bda715a18a 100644
--- a/gdb/testsuite/gdb.ada/n_arr_bound.exp
+++ b/gdb/testsuite/gdb.ada/n_arr_bound.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/nested.exp b/gdb/testsuite/gdb.ada/nested.exp
index e64f65feebc..c181d34c5c5 100644
--- a/gdb/testsuite/gdb.ada/nested.exp
+++ b/gdb/testsuite/gdb.ada/nested.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile hello
 
diff --git a/gdb/testsuite/gdb.ada/non-ascii-latin-1.exp b/gdb/testsuite/gdb.ada/non-ascii-latin-1.exp
index 5ff55d66a68..2079c7cbde1 100644
--- a/gdb/testsuite/gdb.ada/non-ascii-latin-1.exp
+++ b/gdb/testsuite/gdb.ada/non-ascii-latin-1.exp
@@ -17,7 +17,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 # Enable basic use of UTF-8.  LC_ALL gets reset for each testfile.  We
 # want this despite the program itself using Latin-1, as this test is
diff --git a/gdb/testsuite/gdb.ada/non-ascii-latin-3.exp b/gdb/testsuite/gdb.ada/non-ascii-latin-3.exp
index bafcdeb13e7..cfcf6838d19 100644
--- a/gdb/testsuite/gdb.ada/non-ascii-latin-3.exp
+++ b/gdb/testsuite/gdb.ada/non-ascii-latin-3.exp
@@ -17,7 +17,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 # Enable basic use of UTF-8.  LC_ALL gets reset for each testfile.  We
 # want this despite the program itself using Latin-1, as this test is
diff --git a/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp b/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp
index 4ab0ca54c63..19ddc7959ad 100644
--- a/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp
+++ b/gdb/testsuite/gdb.ada/non-ascii-utf-8.exp
@@ -17,7 +17,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 # Enable basic use of UTF-8.  LC_ALL gets reset for each testfile.
 setenv LC_ALL C.UTF-8
diff --git a/gdb/testsuite/gdb.ada/notcplusplus.exp b/gdb/testsuite/gdb.ada/notcplusplus.exp
index 62542f81ac1..7968d053cb6 100644
--- a/gdb/testsuite/gdb.ada/notcplusplus.exp
+++ b/gdb/testsuite/gdb.ada/notcplusplus.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/null_array.exp b/gdb/testsuite/gdb.ada/null_array.exp
index e8b3b93446b..f7bf9d85707 100644
--- a/gdb/testsuite/gdb.ada/null_array.exp
+++ b/gdb/testsuite/gdb.ada/null_array.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/null_overload.exp b/gdb/testsuite/gdb.ada/null_overload.exp
index dc13acbd092..818942555fd 100644
--- a/gdb/testsuite/gdb.ada/null_overload.exp
+++ b/gdb/testsuite/gdb.ada/null_overload.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/null_record.exp b/gdb/testsuite/gdb.ada/null_record.exp
index 6b1775ad882..dce90e850b6 100644
--- a/gdb/testsuite/gdb.ada/null_record.exp
+++ b/gdb/testsuite/gdb.ada/null_record.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile null_record
 
diff --git a/gdb/testsuite/gdb.ada/operator_bp.exp b/gdb/testsuite/gdb.ada/operator_bp.exp
index e3928419ed6..b4964466569 100644
--- a/gdb/testsuite/gdb.ada/operator_bp.exp
+++ b/gdb/testsuite/gdb.ada/operator_bp.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile ops_test
 
diff --git a/gdb/testsuite/gdb.ada/operator_call.exp b/gdb/testsuite/gdb.ada/operator_call.exp
index c94844b49bb..f22e95750d4 100644
--- a/gdb/testsuite/gdb.ada/operator_call.exp
+++ b/gdb/testsuite/gdb.ada/operator_call.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile opcall
 
diff --git a/gdb/testsuite/gdb.ada/optim_drec.exp b/gdb/testsuite/gdb.ada/optim_drec.exp
index 51ad14d5a50..d5ba1595f40 100644
--- a/gdb/testsuite/gdb.ada/optim_drec.exp
+++ b/gdb/testsuite/gdb.ada/optim_drec.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp
index 621b04e179b..a07e498d113 100644
--- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp
+++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_o224_021
 
diff --git a/gdb/testsuite/gdb.ada/overload_menu_crash.exp b/gdb/testsuite/gdb.ada/overload_menu_crash.exp
index a6381a3a448..8e9a9fdbfa8 100644
--- a/gdb/testsuite/gdb.ada/overload_menu_crash.exp
+++ b/gdb/testsuite/gdb.ada/overload_menu_crash.exp
@@ -17,7 +17,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile main
 
diff --git a/gdb/testsuite/gdb.ada/packed_array.exp b/gdb/testsuite/gdb.ada/packed_array.exp
index e73298ec84c..51bfdf4c2a9 100644
--- a/gdb/testsuite/gdb.ada/packed_array.exp
+++ b/gdb/testsuite/gdb.ada/packed_array.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile pa
 
diff --git a/gdb/testsuite/gdb.ada/packed_array_assign.exp b/gdb/testsuite/gdb.ada/packed_array_assign.exp
index a0240fc17be..37824c843c2 100644
--- a/gdb/testsuite/gdb.ada/packed_array_assign.exp
+++ b/gdb/testsuite/gdb.ada/packed_array_assign.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile tester
 
diff --git a/gdb/testsuite/gdb.ada/packed_record.exp b/gdb/testsuite/gdb.ada/packed_record.exp
index d872907809f..28655078e00 100644
--- a/gdb/testsuite/gdb.ada/packed_record.exp
+++ b/gdb/testsuite/gdb.ada/packed_record.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile pr
 
diff --git a/gdb/testsuite/gdb.ada/packed_tagged.exp b/gdb/testsuite/gdb.ada/packed_tagged.exp
index bef491a54e9..5feac690e0d 100644
--- a/gdb/testsuite/gdb.ada/packed_tagged.exp
+++ b/gdb/testsuite/gdb.ada/packed_tagged.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile comp_bug
 
diff --git a/gdb/testsuite/gdb.ada/pckd_arr_ren.exp b/gdb/testsuite/gdb.ada/pckd_arr_ren.exp
index c02983857be..91092256b38 100644
--- a/gdb/testsuite/gdb.ada/pckd_arr_ren.exp
+++ b/gdb/testsuite/gdb.ada/pckd_arr_ren.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/pckd_neg.exp b/gdb/testsuite/gdb.ada/pckd_neg.exp
index fdcb1fed40d..e42b6c0162c 100644
--- a/gdb/testsuite/gdb.ada/pckd_neg.exp
+++ b/gdb/testsuite/gdb.ada/pckd_neg.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_o508_021
 
diff --git a/gdb/testsuite/gdb.ada/pkd_arr_elem.exp b/gdb/testsuite/gdb.ada/pkd_arr_elem.exp
index d4f235cb23f..769182f75b4 100644
--- a/gdb/testsuite/gdb.ada/pkd_arr_elem.exp
+++ b/gdb/testsuite/gdb.ada/pkd_arr_elem.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile failure
 
diff --git a/gdb/testsuite/gdb.ada/pp-rec-component.exp b/gdb/testsuite/gdb.ada/pp-rec-component.exp
index de6317fbf8c..940b9e77fb4 100644
--- a/gdb/testsuite/gdb.ada/pp-rec-component.exp
+++ b/gdb/testsuite/gdb.ada/pp-rec-component.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/print_chars.exp b/gdb/testsuite/gdb.ada/print_chars.exp
index b526212a819..9eb20364edf 100644
--- a/gdb/testsuite/gdb.ada/print_chars.exp
+++ b/gdb/testsuite/gdb.ada/print_chars.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/print_pc.exp b/gdb/testsuite/gdb.ada/print_pc.exp
index 0ecf6f9fc45..debc9f4a821 100644
--- a/gdb/testsuite/gdb.ada/print_pc.exp
+++ b/gdb/testsuite/gdb.ada/print_pc.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile dummy start
 
diff --git a/gdb/testsuite/gdb.ada/ptr_typedef.exp b/gdb/testsuite/gdb.ada/ptr_typedef.exp
index c9df5fdc4ed..0459d268dbd 100644
--- a/gdb/testsuite/gdb.ada/ptr_typedef.exp
+++ b/gdb/testsuite/gdb.ada/ptr_typedef.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/ptype_arith_binop.exp b/gdb/testsuite/gdb.ada/ptype_arith_binop.exp
index c806277f12f..66a2478ad34 100644
--- a/gdb/testsuite/gdb.ada/ptype_arith_binop.exp
+++ b/gdb/testsuite/gdb.ada/ptype_arith_binop.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 gdb_exit
 gdb_start
diff --git a/gdb/testsuite/gdb.ada/ptype_array.exp b/gdb/testsuite/gdb.ada/ptype_array.exp
index 5f7c8b6802a..a74e603c448 100644
--- a/gdb/testsuite/gdb.ada/ptype_array.exp
+++ b/gdb/testsuite/gdb.ada/ptype_array.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/ptype_field.exp b/gdb/testsuite/gdb.ada/ptype_field.exp
index 25147a88743..bc92957b747 100644
--- a/gdb/testsuite/gdb.ada/ptype_field.exp
+++ b/gdb/testsuite/gdb.ada/ptype_field.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/ptype_tagged_param.exp b/gdb/testsuite/gdb.ada/ptype_tagged_param.exp
index 116748ab184..390d2f7605d 100644
--- a/gdb/testsuite/gdb.ada/ptype_tagged_param.exp
+++ b/gdb/testsuite/gdb.ada/ptype_tagged_param.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/ptype_union.exp b/gdb/testsuite/gdb.ada/ptype_union.exp
index 126972f8e5f..eb093e7ea0a 100644
--- a/gdb/testsuite/gdb.ada/ptype_union.exp
+++ b/gdb/testsuite/gdb.ada/ptype_union.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.ada/py_range.exp b/gdb/testsuite/gdb.ada/py_range.exp
index c7ec569a9b1..26ef532d7da 100644
--- a/gdb/testsuite/gdb.ada/py_range.exp
+++ b/gdb/testsuite/gdb.ada/py_range.exp
@@ -16,7 +16,7 @@
 load_lib "ada.exp"
 load_lib gdb-python.exp
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/py_taft.exp b/gdb/testsuite/gdb.ada/py_taft.exp
index 6e1f859a5fd..6b8bb84a2ac 100644
--- a/gdb/testsuite/gdb.ada/py_taft.exp
+++ b/gdb/testsuite/gdb.ada/py_taft.exp
@@ -16,7 +16,7 @@
 load_lib "ada.exp"
 load_lib gdb-python.exp
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile main
 
diff --git a/gdb/testsuite/gdb.ada/rdv_wait.exp b/gdb/testsuite/gdb.ada/rdv_wait.exp
index b702fad1177..ca8952ba504 100644
--- a/gdb/testsuite/gdb.ada/rdv_wait.exp
+++ b/gdb/testsuite/gdb.ada/rdv_wait.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/rec_comp.exp b/gdb/testsuite/gdb.ada/rec_comp.exp
index 0c155bc6499..7fdbb39ed3c 100644
--- a/gdb/testsuite/gdb.ada/rec_comp.exp
+++ b/gdb/testsuite/gdb.ada/rec_comp.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile bar_o203_012
 
diff --git a/gdb/testsuite/gdb.ada/rec_ptype.exp b/gdb/testsuite/gdb.ada/rec_ptype.exp
index dfeb41e689a..16518a52501 100644
--- a/gdb/testsuite/gdb.ada/rec_ptype.exp
+++ b/gdb/testsuite/gdb.ada/rec_ptype.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile main
 
diff --git a/gdb/testsuite/gdb.ada/rec_return.exp b/gdb/testsuite/gdb.ada/rec_return.exp
index d06fae4c71a..b0b74b9f830 100644
--- a/gdb/testsuite/gdb.ada/rec_return.exp
+++ b/gdb/testsuite/gdb.ada/rec_return.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/ref_param.exp b/gdb/testsuite/gdb.ada/ref_param.exp
index 6f72c91684a..9d91cfea7fd 100644
--- a/gdb/testsuite/gdb.ada/ref_param.exp
+++ b/gdb/testsuite/gdb.ada/ref_param.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/ref_tick_size.exp b/gdb/testsuite/gdb.ada/ref_tick_size.exp
index 3feef4ace91..09a59f1af24 100644
--- a/gdb/testsuite/gdb.ada/ref_tick_size.exp
+++ b/gdb/testsuite/gdb.ada/ref_tick_size.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile p
 
diff --git a/gdb/testsuite/gdb.ada/rename_subscript_param.exp b/gdb/testsuite/gdb.ada/rename_subscript_param.exp
index 0c22cd7c164..7fd4daac117 100644
--- a/gdb/testsuite/gdb.ada/rename_subscript_param.exp
+++ b/gdb/testsuite/gdb.ada/rename_subscript_param.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 if { ![gnatmake_version_at_least 8] } {
     return -1
diff --git a/gdb/testsuite/gdb.ada/repeat_dyn.exp b/gdb/testsuite/gdb.ada/repeat_dyn.exp
index 91ae851059d..4c3a7118829 100644
--- a/gdb/testsuite/gdb.ada/repeat_dyn.exp
+++ b/gdb/testsuite/gdb.ada/repeat_dyn.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_oc22_002
 
diff --git a/gdb/testsuite/gdb.ada/same_component_name.exp b/gdb/testsuite/gdb.ada/same_component_name.exp
index e07d49db3b4..4bd6b5938e1 100644
--- a/gdb/testsuite/gdb.ada/same_component_name.exp
+++ b/gdb/testsuite/gdb.ada/same_component_name.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/same_enum.exp b/gdb/testsuite/gdb.ada/same_enum.exp
index 4fccd5f913b..59d34e5250a 100644
--- a/gdb/testsuite/gdb.ada/same_enum.exp
+++ b/gdb/testsuite/gdb.ada/same_enum.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile a
 
diff --git a/gdb/testsuite/gdb.ada/scalar_storage.exp b/gdb/testsuite/gdb.ada/scalar_storage.exp
index bfb2faca6f3..454878e77cc 100644
--- a/gdb/testsuite/gdb.ada/scalar_storage.exp
+++ b/gdb/testsuite/gdb.ada/scalar_storage.exp
@@ -18,7 +18,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile storage
 
diff --git a/gdb/testsuite/gdb.ada/scoped_watch.exp b/gdb/testsuite/gdb.ada/scoped_watch.exp
index 7b29389555e..f7740422686 100644
--- a/gdb/testsuite/gdb.ada/scoped_watch.exp
+++ b/gdb/testsuite/gdb.ada/scoped_watch.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_p708_025
 
diff --git a/gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp b/gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp
index e8c468e65b3..d1c92b58abf 100644
--- a/gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp
+++ b/gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/set_wstr.exp b/gdb/testsuite/gdb.ada/set_wstr.exp
index 6c19af39d99..27021d2163a 100644
--- a/gdb/testsuite/gdb.ada/set_wstr.exp
+++ b/gdb/testsuite/gdb.ada/set_wstr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile a
 
diff --git a/gdb/testsuite/gdb.ada/small_reg_param.exp b/gdb/testsuite/gdb.ada/small_reg_param.exp
index cac9a5a6184..e8b9d47c39e 100644
--- a/gdb/testsuite/gdb.ada/small_reg_param.exp
+++ b/gdb/testsuite/gdb.ada/small_reg_param.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/start.exp b/gdb/testsuite/gdb.ada/start.exp
index 63dcc619f1f..868a08fbe4b 100644
--- a/gdb/testsuite/gdb.ada/start.exp
+++ b/gdb/testsuite/gdb.ada/start.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 # This testcase verifies the behavior of the `start' command, which
 # does not work when we use the gdb stub...
diff --git a/gdb/testsuite/gdb.ada/str_binop_equal.exp b/gdb/testsuite/gdb.ada/str_binop_equal.exp
index 6fa874ee6ea..819a4a50055 100644
--- a/gdb/testsuite/gdb.ada/str_binop_equal.exp
+++ b/gdb/testsuite/gdb.ada/str_binop_equal.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_p211_061
 
diff --git a/gdb/testsuite/gdb.ada/str_ref_cmp.exp b/gdb/testsuite/gdb.ada/str_ref_cmp.exp
index a19a0c32792..ad9b6ef4131 100644
--- a/gdb/testsuite/gdb.ada/str_ref_cmp.exp
+++ b/gdb/testsuite/gdb.ada/str_ref_cmp.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/str_uninit.exp b/gdb/testsuite/gdb.ada/str_uninit.exp
index 30c7bfc34aa..5cac6fc39eb 100644
--- a/gdb/testsuite/gdb.ada/str_uninit.exp
+++ b/gdb/testsuite/gdb.ada/str_uninit.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile parse
 
diff --git a/gdb/testsuite/gdb.ada/sub_variant.exp b/gdb/testsuite/gdb.ada/sub_variant.exp
index c7e95c26f68..6d1cd63e8bb 100644
--- a/gdb/testsuite/gdb.ada/sub_variant.exp
+++ b/gdb/testsuite/gdb.ada/sub_variant.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile subv
 
diff --git a/gdb/testsuite/gdb.ada/sym_print_name.exp b/gdb/testsuite/gdb.ada/sym_print_name.exp
index 28e6e340ee6..5f5b8b176f8 100644
--- a/gdb/testsuite/gdb.ada/sym_print_name.exp
+++ b/gdb/testsuite/gdb.ada/sym_print_name.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/taft_type.exp b/gdb/testsuite/gdb.ada/taft_type.exp
index e9210cd9448..7a2c40c175a 100644
--- a/gdb/testsuite/gdb.ada/taft_type.exp
+++ b/gdb/testsuite/gdb.ada/taft_type.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile p
 
diff --git a/gdb/testsuite/gdb.ada/tagged.exp b/gdb/testsuite/gdb.ada/tagged.exp
index 6fb8a418149..7de8cf331e7 100644
--- a/gdb/testsuite/gdb.ada/tagged.exp
+++ b/gdb/testsuite/gdb.ada/tagged.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 if {![gnat_runtime_has_debug_info]} {
     untested "GNAT runtime debuginfo required for this test"
diff --git a/gdb/testsuite/gdb.ada/tagged_access.exp b/gdb/testsuite/gdb.ada/tagged_access.exp
index 3649c5474a7..26be69f0d4b 100644
--- a/gdb/testsuite/gdb.ada/tagged_access.exp
+++ b/gdb/testsuite/gdb.ada/tagged_access.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 if {![gnat_runtime_has_debug_info]} {
     untested "GNAT runtime debuginfo required for this test"
diff --git a/gdb/testsuite/gdb.ada/tagged_not_init.exp b/gdb/testsuite/gdb.ada/tagged_not_init.exp
index 2bf5bba6dfe..3e7dec0dccb 100644
--- a/gdb/testsuite/gdb.ada/tagged_not_init.exp
+++ b/gdb/testsuite/gdb.ada/tagged_not_init.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/task_bp.exp b/gdb/testsuite/gdb.ada/task_bp.exp
index 5957d980250..f6df8f8e000 100644
--- a/gdb/testsuite/gdb.ada/task_bp.exp
+++ b/gdb/testsuite/gdb.ada/task_bp.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/task_switch_in_core.exp b/gdb/testsuite/gdb.ada/task_switch_in_core.exp
index 7a56693e656..a344f34202b 100644
--- a/gdb/testsuite/gdb.ada/task_switch_in_core.exp
+++ b/gdb/testsuite/gdb.ada/task_switch_in_core.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile crash
 
diff --git a/gdb/testsuite/gdb.ada/task_watch.exp b/gdb/testsuite/gdb.ada/task_watch.exp
index 697074ac164..295efd5b010 100644
--- a/gdb/testsuite/gdb.ada/task_watch.exp
+++ b/gdb/testsuite/gdb.ada/task_watch.exp
@@ -17,7 +17,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 if { [skip_hw_watchpoint_tests] } { return -1 }
 
diff --git a/gdb/testsuite/gdb.ada/tasks.exp b/gdb/testsuite/gdb.ada/tasks.exp
index 2ca03396d7c..ef8ae4bf52a 100644
--- a/gdb/testsuite/gdb.ada/tasks.exp
+++ b/gdb/testsuite/gdb.ada/tasks.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/tick_last_segv.exp b/gdb/testsuite/gdb.ada/tick_last_segv.exp
index 5d2795ef502..7db8bcfa8d3 100644
--- a/gdb/testsuite/gdb.ada/tick_last_segv.exp
+++ b/gdb/testsuite/gdb.ada/tick_last_segv.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp b/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp
index e797a71534f..49b5ac9c560 100644
--- a/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp
+++ b/gdb/testsuite/gdb.ada/tick_length_array_enum_idx.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_n207_004
 
diff --git a/gdb/testsuite/gdb.ada/type_coercion.exp b/gdb/testsuite/gdb.ada/type_coercion.exp
index 5b6d9be7e36..d27c9168dbb 100644
--- a/gdb/testsuite/gdb.ada/type_coercion.exp
+++ b/gdb/testsuite/gdb.ada/type_coercion.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile assign
 
diff --git a/gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec.exp b/gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec.exp
index a11a90ed32c..3031b301901 100644
--- a/gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec.exp
+++ b/gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/unchecked_union.exp b/gdb/testsuite/gdb.ada/unchecked_union.exp
index a1ba4f420c7..928f4e2304f 100644
--- a/gdb/testsuite/gdb.ada/unchecked_union.exp
+++ b/gdb/testsuite/gdb.ada/unchecked_union.exp
@@ -17,7 +17,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile unchecked_union
 
diff --git a/gdb/testsuite/gdb.ada/uninitialized_vars.exp b/gdb/testsuite/gdb.ada/uninitialized_vars.exp
index 20c6523afab..893bad82fbc 100644
--- a/gdb/testsuite/gdb.ada/uninitialized_vars.exp
+++ b/gdb/testsuite/gdb.ada/uninitialized_vars.exp
@@ -18,7 +18,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile parse
 
diff --git a/gdb/testsuite/gdb.ada/unsigned_last.exp b/gdb/testsuite/gdb.ada/unsigned_last.exp
index f07d9483bbd..c4cb7f9f1af 100644
--- a/gdb/testsuite/gdb.ada/unsigned_last.exp
+++ b/gdb/testsuite/gdb.ada/unsigned_last.exp
@@ -18,7 +18,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile main
 
diff --git a/gdb/testsuite/gdb.ada/unsigned_range.exp b/gdb/testsuite/gdb.ada/unsigned_range.exp
index afcb095b405..bcabe588fdc 100644
--- a/gdb/testsuite/gdb.ada/unsigned_range.exp
+++ b/gdb/testsuite/gdb.ada/unsigned_range.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/var_arr_attrs.exp b/gdb/testsuite/gdb.ada/var_arr_attrs.exp
index 37ed721a5ee..934a9237d8b 100644
--- a/gdb/testsuite/gdb.ada/var_arr_attrs.exp
+++ b/gdb/testsuite/gdb.ada/var_arr_attrs.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_o115_002
 
diff --git a/gdb/testsuite/gdb.ada/var_arr_typedef.exp b/gdb/testsuite/gdb.ada/var_arr_typedef.exp
index dc2eee0a21e..e2592664136 100644
--- a/gdb/testsuite/gdb.ada/var_arr_typedef.exp
+++ b/gdb/testsuite/gdb.ada/var_arr_typedef.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile var_arr_typedef
 
diff --git a/gdb/testsuite/gdb.ada/var_rec_arr.exp b/gdb/testsuite/gdb.ada/var_rec_arr.exp
index 030f63048cb..71180a36589 100644
--- a/gdb/testsuite/gdb.ada/var_rec_arr.exp
+++ b/gdb/testsuite/gdb.ada/var_rec_arr.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_na09_042
 
diff --git a/gdb/testsuite/gdb.ada/variant-record.exp b/gdb/testsuite/gdb.ada/variant-record.exp
index f3e09f234e1..2c6cbd6e491 100644
--- a/gdb/testsuite/gdb.ada/variant-record.exp
+++ b/gdb/testsuite/gdb.ada/variant-record.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile proc
 
diff --git a/gdb/testsuite/gdb.ada/variant.exp b/gdb/testsuite/gdb.ada/variant.exp
index 828f7c3a030..c03f39b95d7 100644
--- a/gdb/testsuite/gdb.ada/variant.exp
+++ b/gdb/testsuite/gdb.ada/variant.exp
@@ -16,7 +16,7 @@
 load_lib "ada.exp"
 load_lib "gdb-python.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile pkg
 
diff --git a/gdb/testsuite/gdb.ada/variant_record_packed_array.exp b/gdb/testsuite/gdb.ada/variant_record_packed_array.exp
index b611b6fedfc..c2aaf3ed543 100644
--- a/gdb/testsuite/gdb.ada/variant_record_packed_array.exp
+++ b/gdb/testsuite/gdb.ada/variant_record_packed_array.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/varsize_limit.exp b/gdb/testsuite/gdb.ada/varsize_limit.exp
index 45ab865ff3d..7ee681660da 100644
--- a/gdb/testsuite/gdb.ada/varsize_limit.exp
+++ b/gdb/testsuite/gdb.ada/varsize_limit.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile vsizelim
 
diff --git a/gdb/testsuite/gdb.ada/vla.exp b/gdb/testsuite/gdb.ada/vla.exp
index 8eb3712bcee..d36e1e35d0a 100644
--- a/gdb/testsuite/gdb.ada/vla.exp
+++ b/gdb/testsuite/gdb.ada/vla.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile vla
 
diff --git a/gdb/testsuite/gdb.ada/voidctx.exp b/gdb/testsuite/gdb.ada/voidctx.exp
index d2d0f0113e5..05494c0debb 100644
--- a/gdb/testsuite/gdb.ada/voidctx.exp
+++ b/gdb/testsuite/gdb.ada/voidctx.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile voidctx
 
diff --git a/gdb/testsuite/gdb.ada/watch_arg.exp b/gdb/testsuite/gdb.ada/watch_arg.exp
index fdada6aaa7d..afa9775c1ad 100644
--- a/gdb/testsuite/gdb.ada/watch_arg.exp
+++ b/gdb/testsuite/gdb.ada/watch_arg.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile watch
 
diff --git a/gdb/testsuite/gdb.ada/watch_minus_l.exp b/gdb/testsuite/gdb.ada/watch_minus_l.exp
index fc4d33332fb..3189f48f2d3 100644
--- a/gdb/testsuite/gdb.ada/watch_minus_l.exp
+++ b/gdb/testsuite/gdb.ada/watch_minus_l.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo_ra10_006
 
diff --git a/gdb/testsuite/gdb.ada/whatis_array_val.exp b/gdb/testsuite/gdb.ada/whatis_array_val.exp
index 27febfcea54..41a0a4b7a47 100644
--- a/gdb/testsuite/gdb.ada/whatis_array_val.exp
+++ b/gdb/testsuite/gdb.ada/whatis_array_val.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/widewide.exp b/gdb/testsuite/gdb.ada/widewide.exp
index 9db40481657..53d1cea133c 100644
--- a/gdb/testsuite/gdb.ada/widewide.exp
+++ b/gdb/testsuite/gdb.ada/widewide.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/win_fu_syms.exp b/gdb/testsuite/gdb.ada/win_fu_syms.exp
index 2b1101497eb..4bb932c33c1 100644
--- a/gdb/testsuite/gdb.ada/win_fu_syms.exp
+++ b/gdb/testsuite/gdb.ada/win_fu_syms.exp
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-if { [skip_ada_tests] } { return -1 }
+require !skip_ada_tests
 
 standard_ada_testfile foo
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 15/46] Use require skip_go_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (13 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 14/46] Use require skip_ada_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 16/46] Use require skip_d_tests Tom Tromey
                   ` (32 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_go_tests".
---
 gdb/testsuite/gdb.go/basic-types.exp             | 2 +-
 gdb/testsuite/gdb.go/chan.exp                    | 2 +-
 gdb/testsuite/gdb.go/global-local-var-shadow.exp | 2 +-
 gdb/testsuite/gdb.go/handcall.exp                | 2 +-
 gdb/testsuite/gdb.go/hello.exp                   | 2 +-
 gdb/testsuite/gdb.go/integers.exp                | 2 +-
 gdb/testsuite/gdb.go/max-depth.exp               | 2 +-
 gdb/testsuite/gdb.go/methods.exp                 | 2 +-
 gdb/testsuite/gdb.go/package.exp                 | 2 +-
 gdb/testsuite/gdb.go/print.exp                   | 2 +-
 gdb/testsuite/gdb.go/strings.exp                 | 2 +-
 gdb/testsuite/gdb.go/types.exp                   | 2 +-
 gdb/testsuite/gdb.go/unsafe.exp                  | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/gdb/testsuite/gdb.go/basic-types.exp b/gdb/testsuite/gdb.go/basic-types.exp
index 107e2220431..2093862a16b 100644
--- a/gdb/testsuite/gdb.go/basic-types.exp
+++ b/gdb/testsuite/gdb.go/basic-types.exp
@@ -20,7 +20,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 
 proc test_integer_literal_types_accepted {} {
     # Test various decimal values.
diff --git a/gdb/testsuite/gdb.go/chan.exp b/gdb/testsuite/gdb.go/chan.exp
index 561cf846225..90872705c3c 100644
--- a/gdb/testsuite/gdb.go/chan.exp
+++ b/gdb/testsuite/gdb.go/chan.exp
@@ -20,7 +20,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 if { [support_go_compile] == 0 } { continue }
 
 standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/global-local-var-shadow.exp b/gdb/testsuite/gdb.go/global-local-var-shadow.exp
index 9b83591a424..c093af5ed63 100644
--- a/gdb/testsuite/gdb.go/global-local-var-shadow.exp
+++ b/gdb/testsuite/gdb.go/global-local-var-shadow.exp
@@ -19,7 +19,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 if { [support_go_compile] == 0 } { continue }
 
 standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/handcall.exp b/gdb/testsuite/gdb.go/handcall.exp
index c7c1030f705..f19601a32c6 100644
--- a/gdb/testsuite/gdb.go/handcall.exp
+++ b/gdb/testsuite/gdb.go/handcall.exp
@@ -19,7 +19,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 if { [support_go_compile] == 0 } { continue }
 
 standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/hello.exp b/gdb/testsuite/gdb.go/hello.exp
index 925a05d0409..9a9ae861494 100644
--- a/gdb/testsuite/gdb.go/hello.exp
+++ b/gdb/testsuite/gdb.go/hello.exp
@@ -19,7 +19,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 if { [support_go_compile] == 0 } { continue }
 
 standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/integers.exp b/gdb/testsuite/gdb.go/integers.exp
index f5a9b1909ba..a68a1f905fd 100644
--- a/gdb/testsuite/gdb.go/integers.exp
+++ b/gdb/testsuite/gdb.go/integers.exp
@@ -19,7 +19,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 if { [support_go_compile] == 0 } { continue }
 
 standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/max-depth.exp b/gdb/testsuite/gdb.go/max-depth.exp
index ad00e8fa3d0..b08cb139020 100644
--- a/gdb/testsuite/gdb.go/max-depth.exp
+++ b/gdb/testsuite/gdb.go/max-depth.exp
@@ -19,7 +19,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 if { [support_go_compile] == 0 } { continue }
 
 standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/methods.exp b/gdb/testsuite/gdb.go/methods.exp
index d50fbde122c..35cfc00dd34 100644
--- a/gdb/testsuite/gdb.go/methods.exp
+++ b/gdb/testsuite/gdb.go/methods.exp
@@ -19,7 +19,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 if { [support_go_compile] == 0 } { continue }
 
 standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/package.exp b/gdb/testsuite/gdb.go/package.exp
index 6893dd99a2a..18b3704e891 100644
--- a/gdb/testsuite/gdb.go/package.exp
+++ b/gdb/testsuite/gdb.go/package.exp
@@ -19,7 +19,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 if { [support_go_compile] == 0 } { continue }
 
 standard_testfile package1.go package2.go
diff --git a/gdb/testsuite/gdb.go/print.exp b/gdb/testsuite/gdb.go/print.exp
index 03d8ef38905..5792aa14e29 100644
--- a/gdb/testsuite/gdb.go/print.exp
+++ b/gdb/testsuite/gdb.go/print.exp
@@ -20,7 +20,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 
 proc test_float_accepted {} {
     global gdb_prompt
diff --git a/gdb/testsuite/gdb.go/strings.exp b/gdb/testsuite/gdb.go/strings.exp
index 3075ea9dea1..f8417f69c0d 100644
--- a/gdb/testsuite/gdb.go/strings.exp
+++ b/gdb/testsuite/gdb.go/strings.exp
@@ -17,7 +17,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 if { [support_go_compile] == 0 } { continue }
 
 standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/types.exp b/gdb/testsuite/gdb.go/types.exp
index f651e9c8e66..5a8d74b2830 100644
--- a/gdb/testsuite/gdb.go/types.exp
+++ b/gdb/testsuite/gdb.go/types.exp
@@ -19,7 +19,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 if { [support_go_compile] == 0 } { continue }
 
 standard_testfile .go
diff --git a/gdb/testsuite/gdb.go/unsafe.exp b/gdb/testsuite/gdb.go/unsafe.exp
index 7ed49e82b26..fd25663a6a9 100644
--- a/gdb/testsuite/gdb.go/unsafe.exp
+++ b/gdb/testsuite/gdb.go/unsafe.exp
@@ -19,7 +19,7 @@
 
 load_lib "go.exp"
 
-if { [skip_go_tests] } { continue }
+require !skip_go_tests
 if { [support_go_compile] == 0 } { continue }
 
 standard_testfile .go
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 16/46] Use require skip_d_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (14 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 15/46] Use require skip_go_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 17/46] Use require skip_ctf_tests Tom Tromey
                   ` (31 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_d_tests".
---
 gdb/testsuite/gdb.dlang/debug-expr.exp      | 2 +-
 gdb/testsuite/gdb.dlang/demangle.exp        | 2 +-
 gdb/testsuite/gdb.dlang/expression.exp      | 2 +-
 gdb/testsuite/gdb.dlang/primitive-types.exp | 2 +-
 gdb/testsuite/gdb.dlang/properties.exp      | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/testsuite/gdb.dlang/debug-expr.exp b/gdb/testsuite/gdb.dlang/debug-expr.exp
index e576b29fbc0..31f8af66c76 100644
--- a/gdb/testsuite/gdb.dlang/debug-expr.exp
+++ b/gdb/testsuite/gdb.dlang/debug-expr.exp
@@ -15,7 +15,7 @@
 
 # Test "set debug expr 1" on d expressions.
 
-if { [skip_d_tests] } { return -1 }
+require !skip_d_tests
 
 gdb_start
 gdb_test_no_output "set language d"
diff --git a/gdb/testsuite/gdb.dlang/demangle.exp b/gdb/testsuite/gdb.dlang/demangle.exp
index d45437c72cf..753687846b6 100644
--- a/gdb/testsuite/gdb.dlang/demangle.exp
+++ b/gdb/testsuite/gdb.dlang/demangle.exp
@@ -19,7 +19,7 @@
 
 load_lib "d-support.exp"
 
-if { [skip_d_tests] } { continue }
+require !skip_d_tests
 
 ### Utility function for test_demangling and test_demangling_exact.
 proc test_demangling {test result} {
diff --git a/gdb/testsuite/gdb.dlang/expression.exp b/gdb/testsuite/gdb.dlang/expression.exp
index 6173dca713b..beb480beed1 100644
--- a/gdb/testsuite/gdb.dlang/expression.exp
+++ b/gdb/testsuite/gdb.dlang/expression.exp
@@ -18,7 +18,7 @@
 
 load_lib "d-support.exp"
 
-if { [skip_d_tests] } { continue }
+require !skip_d_tests
 
 proc test_d_integer_literals {} {
     # Test valid D integer literals are accepted.
diff --git a/gdb/testsuite/gdb.dlang/primitive-types.exp b/gdb/testsuite/gdb.dlang/primitive-types.exp
index cf9417b47dc..886cb3aa1f7 100644
--- a/gdb/testsuite/gdb.dlang/primitive-types.exp
+++ b/gdb/testsuite/gdb.dlang/primitive-types.exp
@@ -18,7 +18,7 @@
 
 load_lib "d-support.exp"
 
-if { [skip_d_tests] } { continue }
+require !skip_d_tests
 
 proc test_builtin_d_types_accepted {} {
     # Test types are recognised.
diff --git a/gdb/testsuite/gdb.dlang/properties.exp b/gdb/testsuite/gdb.dlang/properties.exp
index dc6c4e857c3..7ed3e271c27 100644
--- a/gdb/testsuite/gdb.dlang/properties.exp
+++ b/gdb/testsuite/gdb.dlang/properties.exp
@@ -18,7 +18,7 @@
 
 load_lib "d-support.exp"
 
-if { [skip_d_tests] } { continue }
+require !skip_d_tests
 
 proc test_d_sizeof {} {
     # Test use of .sizeof with types and expressions.
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 17/46] Use require skip_ctf_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (15 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 16/46] Use require skip_d_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 18/46] Use require skip_hw_watchpoint_tests Tom Tromey
                   ` (30 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_ctf_tests".
---
 gdb/testsuite/gdb.base/ctf-constvars.exp  | 5 +----
 gdb/testsuite/gdb.base/ctf-ptype.exp      | 5 +----
 gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp | 5 +----
 gdb/testsuite/gdb.ctf/funcreturn.exp      | 5 +----
 gdb/testsuite/gdb.ctf/multi.exp           | 5 +----
 5 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/gdb/testsuite/gdb.base/ctf-constvars.exp b/gdb/testsuite/gdb.base/ctf-constvars.exp
index cd0198da154..bd518f0171f 100644
--- a/gdb/testsuite/gdb.base/ctf-constvars.exp
+++ b/gdb/testsuite/gdb.base/ctf-constvars.exp
@@ -24,10 +24,7 @@
 #            const pointers to const vars
 # with mixed types.
 
-if [skip_ctf_tests] {
-    unsupported "no CTF debug format support, or CTF disabled in GDB"
-    return 0
-}
+require !skip_ctf_tests
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.base/ctf-ptype.exp b/gdb/testsuite/gdb.base/ctf-ptype.exp
index 2e3b972ebe9..4302c53914e 100644
--- a/gdb/testsuite/gdb.base/ctf-ptype.exp
+++ b/gdb/testsuite/gdb.base/ctf-ptype.exp
@@ -15,10 +15,7 @@
 
 # This file is a subset of ptype.exp written by Rob Savoye. (rob@cygnus.com)
 
-if [skip_ctf_tests] {
-    unsupported "no CTF debug format support, or CTF disabled in GDB"
-    return 0
-}
+require !skip_ctf_tests
 
 # Some tests require GCC.
 set gcc_compiled [is_c_compiler_gcc]
diff --git a/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp b/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp
index ca11b739ed8..b945a80c035 100644
--- a/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp
+++ b/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp
@@ -15,10 +15,7 @@
 
 # This file is a subset of ptype.exp written by Rob Savoye. (rob@cygnus.com)
 
-if [skip_ctf_tests] {
-    unsupported "no CTF debug format support, or CTF disabled in GDB"
-    return 0
-}
+require !skip_ctf_tests
 
 standard_testfile cross-tu-cyclic-1.c  cross-tu-cyclic-2.c \
 	cross-tu-cyclic-3.c  cross-tu-cyclic-4.c
diff --git a/gdb/testsuite/gdb.ctf/funcreturn.exp b/gdb/testsuite/gdb.ctf/funcreturn.exp
index ab4aa21fa32..660d87fc366 100644
--- a/gdb/testsuite/gdb.ctf/funcreturn.exp
+++ b/gdb/testsuite/gdb.ctf/funcreturn.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if [skip_ctf_tests] {
-    unsupported "no CTF debug format support, or CTF disabled in GDB"
-    return 0
-}
+require !skip_ctf_tests
 
 if [target_info exists no_long_long] {
     set exec_opts [list debug additional_flags=-DNO_LONG_LONG]
diff --git a/gdb/testsuite/gdb.ctf/multi.exp b/gdb/testsuite/gdb.ctf/multi.exp
index 93fcbb660a2..e8d24eda24c 100644
--- a/gdb/testsuite/gdb.ctf/multi.exp
+++ b/gdb/testsuite/gdb.ctf/multi.exp
@@ -15,10 +15,7 @@
 
 # This file is a subset of ptype.exp written by Rob Savoye. (rob@cygnus.com)
 
-if [skip_ctf_tests] {
-    unsupported "no CTF debug format support, or CTF disabled in GDB"
-    return 0
-}
+require !skip_ctf_tests
 
 standard_testfile ctf-a.c ctf-b.c ctf-c.c
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 18/46] Use require skip_hw_watchpoint_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (16 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 17/46] Use require skip_ctf_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 19/46] Use require skip_ifunc_tests Tom Tromey
                   ` (29 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_hw_watchpoint_tests".
---
 gdb/testsuite/gdb.ada/task_watch.exp                        | 2 +-
 gdb/testsuite/gdb.base/pr11022.exp                          | 4 +---
 gdb/testsuite/gdb.base/watch-before-fork.exp                | 4 +---
 gdb/testsuite/gdb.base/watch-read.exp                       | 4 +---
 gdb/testsuite/gdb.base/watch_thread_num.exp                 | 4 +---
 gdb/testsuite/gdb.base/watchpoint-hw-attach.exp             | 4 +---
 gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp           | 4 +---
 gdb/testsuite/gdb.base/watchpoint-hw.exp                    | 4 +---
 gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp   | 4 +---
 gdb/testsuite/gdb.base/watchpoint-unaligned.exp             | 4 +---
 gdb/testsuite/gdb.mi/mi-watch-nonstop.exp                   | 4 +---
 gdb/testsuite/gdb.mi/pr11022.exp                            | 4 +---
 gdb/testsuite/gdb.multi/watchpoint-multi.exp                | 5 +----
 gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp      | 4 +---
 gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp | 4 +---
 gdb/testsuite/gdb.threads/watchthreads-reorder.exp          | 5 ++---
 gdb/testsuite/gdb.threads/watchthreads.exp                  | 4 +---
 gdb/testsuite/gdb.threads/watchthreads2.exp                 | 4 +---
 gdb/testsuite/gdb.threads/wp-replication.exp                | 4 +---
 19 files changed, 20 insertions(+), 56 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/task_watch.exp b/gdb/testsuite/gdb.ada/task_watch.exp
index 295efd5b010..a01d4c7c659 100644
--- a/gdb/testsuite/gdb.ada/task_watch.exp
+++ b/gdb/testsuite/gdb.ada/task_watch.exp
@@ -19,7 +19,7 @@ load_lib "ada.exp"
 
 require !skip_ada_tests
 
-if { [skip_hw_watchpoint_tests] } { return -1 }
+require !skip_hw_watchpoint_tests
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.base/pr11022.exp b/gdb/testsuite/gdb.base/pr11022.exp
index 56d26ccd132..d0b9c1f1aa0 100644
--- a/gdb/testsuite/gdb.base/pr11022.exp
+++ b/gdb/testsuite/gdb.base/pr11022.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_hw_watchpoint_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_tests
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.base/watch-before-fork.exp b/gdb/testsuite/gdb.base/watch-before-fork.exp
index 7c2a481e454..3993778035b 100644
--- a/gdb/testsuite/gdb.base/watch-before-fork.exp
+++ b/gdb/testsuite/gdb.base/watch-before-fork.exp
@@ -18,9 +18,7 @@
 # followed by a catchpoint hit.
 
 # This test uses "awatch".
-if {[skip_hw_watchpoint_access_tests]} {
-    return
-}
+require !skip_hw_watchpoint_access_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/watch-read.exp b/gdb/testsuite/gdb.base/watch-read.exp
index d73bc5c4ab3..1b856bb109b 100644
--- a/gdb/testsuite/gdb.base/watch-read.exp
+++ b/gdb/testsuite/gdb.base/watch-read.exp
@@ -24,9 +24,7 @@
 
 standard_testfile .c
 
-if {[skip_hw_watchpoint_access_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_access_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
diff --git a/gdb/testsuite/gdb.base/watch_thread_num.exp b/gdb/testsuite/gdb.base/watch_thread_num.exp
index da921a72346..8ec4dd3fe00 100644
--- a/gdb/testsuite/gdb.base/watch_thread_num.exp
+++ b/gdb/testsuite/gdb.base/watch_thread_num.exp
@@ -23,9 +23,7 @@
 # so the test is only meaningful on a system with hardware watchpoints.
 # More specifically, the implementation of this test uses access
 # watchpoints, so skip it when those are not available.
-if {[skip_hw_watchpoint_access_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_access_tests
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp b/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
index 456d5570fb2..ce9263ef37a 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
@@ -16,9 +16,7 @@
 # watchpoint-hw-attach.exp -- Test if hardware watchpoints are used
 # when attaching to a target.
 
-if {[skip_hw_watchpoint_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_tests
 
 if {![can_spawn_for_attach]} {
     return 0
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
index ebcd2eb29c7..b84de75b734 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_hw_watchpoint_access_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_access_tests
 
 set test watchpoint-hw-hit-once
 set srcfile ${test}.c
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw.exp b/gdb/testsuite/gdb.base/watchpoint-hw.exp
index d0fd1621efe..785f949efe9 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw.exp
@@ -18,9 +18,7 @@ if { [use_gdb_stub] } {
     return
 }
 
-if {[skip_hw_watchpoint_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp b/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp
index 0364591d745..7112a2db355 100644
--- a/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp
@@ -71,9 +71,7 @@
 standard_testfile
 
 # No use testing this if we can't use hardware watchpoints.
-if {[skip_hw_watchpoint_tests]} {
-    return -1
-}
+require !skip_hw_watchpoint_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
index 00c6ebcf4eb..c25233e1a1b 100644
--- a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
@@ -17,9 +17,7 @@
 
 # Test inserting read watchpoints on unaligned addresses.
 
-if {[skip_hw_watchpoint_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_tests
 
 standard_testfile
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
diff --git a/gdb/testsuite/gdb.mi/mi-watch-nonstop.exp b/gdb/testsuite/gdb.mi/mi-watch-nonstop.exp
index 9648d7ee41c..e3b9b23c109 100644
--- a/gdb/testsuite/gdb.mi/mi-watch-nonstop.exp
+++ b/gdb/testsuite/gdb.mi/mi-watch-nonstop.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if [skip_hw_watchpoint_tests] {
-    return -1
-}
+require !skip_hw_watchpoint_tests
 
 if { ![support_displaced_stepping] } { 
     unsupported "displaced stepping"
diff --git a/gdb/testsuite/gdb.mi/pr11022.exp b/gdb/testsuite/gdb.mi/pr11022.exp
index cdb39e7b65f..9fc47ce7215 100644
--- a/gdb/testsuite/gdb.mi/pr11022.exp
+++ b/gdb/testsuite/gdb.mi/pr11022.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[skip_hw_watchpoint_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_tests
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.exp b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
index 0fc1bee762f..121d1e8a660 100644
--- a/gdb/testsuite/gdb.multi/watchpoint-multi.exp
+++ b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
@@ -25,10 +25,7 @@ if [use_gdb_stub] {
 
 # Do not use simple hardware watchpoints ("watch") as its false hit may be
 # unnoticed by GDB if it reads it still has the same value.
-if [skip_hw_watchpoint_access_tests] {
-    untested "${testfile} (no hardware access watchpoints)"
-    return
-}
+require !skip_hw_watchpoint_access_tests
 
 if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     untested "failed to compile"
diff --git a/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp b/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp
index 9ddcd589226..18cd7e9f8ae 100644
--- a/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp
+++ b/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp
@@ -19,9 +19,7 @@
 # thread other than the thread the local watchpoint was set in stops
 # for a breakpoint.
 
-if {[skip_hw_watchpoint_multi_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_multi_tests
 
 standard_testfile
 if {[gdb_compile_pthreads \
diff --git a/gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp b/gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp
index 332ec9a03fd..b5c85c1b245 100644
--- a/gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp
+++ b/gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp
@@ -22,9 +22,7 @@ set executable ${testfile}
 # This test verifies that a watchpoint is detected in a multithreaded
 # program so the test is only meaningful on a system with hardware
 # watchpoints.
-if {[skip_hw_watchpoint_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_tests
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
 	 executable [list debug "incdir=${objdir}"]] != "" } {
diff --git a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
index 3f9467c795e..b2be631420a 100644
--- a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
+++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
@@ -25,9 +25,8 @@
 # could be assigned during continuation of a thread with pending SIGTRAP to the
 # different/new watchpoint, just based on the watchpoint/debug register number.
 
-if {[skip_hw_watchpoint_access_tests]
-    || [skip_hw_watchpoint_multi_tests]
-    || ![istarget *-*-linux*]} {
+require !skip_hw_watchpoint_access_tests !skip_hw_watchpoint_multi_tests
+if {![istarget *-*-linux*]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/watchthreads.exp b/gdb/testsuite/gdb.threads/watchthreads.exp
index 7fac8a3df80..3dde5458385 100644
--- a/gdb/testsuite/gdb.threads/watchthreads.exp
+++ b/gdb/testsuite/gdb.threads/watchthreads.exp
@@ -20,9 +20,7 @@
 
 # This test verifies that a watchpoint is detected in the proper thread
 # so the test is only meaningful on a system with hardware watchpoints.
-if {[skip_hw_watchpoint_multi_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_multi_tests
 
 proc target_no_stopped_data { } {
     return [istarget s390*-*-*]
diff --git a/gdb/testsuite/gdb.threads/watchthreads2.exp b/gdb/testsuite/gdb.threads/watchthreads2.exp
index 8b887f2a944..97f20b31619 100644
--- a/gdb/testsuite/gdb.threads/watchthreads2.exp
+++ b/gdb/testsuite/gdb.threads/watchthreads2.exp
@@ -24,9 +24,7 @@ set X_INCR_COUNT 10
 
 # This test verifies that a watchpoint is detected in the proper thread
 # so the test is only meaningful on a system with hardware watchpoints.
-if {[skip_hw_watchpoint_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_tests
 
 standard_testfile
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS -DX_INCR_COUNT=$X_INCR_COUNT"]] != "" } {
diff --git a/gdb/testsuite/gdb.threads/wp-replication.exp b/gdb/testsuite/gdb.threads/wp-replication.exp
index bec3d10fd67..d057513c46d 100644
--- a/gdb/testsuite/gdb.threads/wp-replication.exp
+++ b/gdb/testsuite/gdb.threads/wp-replication.exp
@@ -27,9 +27,7 @@ set NR_TRIGGERS_PER_THREAD 2
 # This test verifies that a hardware watchpoint gets replicated to
 # every existing thread and is detected properly.  This test is
 # only meaningful on a target with hardware watchpoint support.
-if {[skip_hw_watchpoint_tests]} {
-    return 0
-}
+require !skip_hw_watchpoint_tests
 
 standard_testfile
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS -DNR_TRIGGERS_PER_THREAD=$NR_TRIGGERS_PER_THREAD"]] != "" } {
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 19/46] Use require skip_ifunc_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (17 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 18/46] Use require skip_hw_watchpoint_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 20/46] Use require skip_aarch64_sve_tests Tom Tromey
                   ` (28 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_ifunc_tests".
---
 gdb/testsuite/gdb.base/gnu-ifunc.exp        | 6 +-----
 gdb/testsuite/gdb.compile/compile-ifunc.exp | 4 +---
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/gdb/testsuite/gdb.base/gnu-ifunc.exp b/gdb/testsuite/gdb.base/gnu-ifunc.exp
index f875443d830..5fc337217bd 100644
--- a/gdb/testsuite/gdb.base/gnu-ifunc.exp
+++ b/gdb/testsuite/gdb.base/gnu-ifunc.exp
@@ -13,11 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-require !skip_shlib_tests
-
-if {[skip_ifunc_tests]} {
-    return 0
-}
+require !skip_shlib_tests !skip_ifunc_tests
 
 standard_testfile .c
 set staticexecutable ${testfile}-static
diff --git a/gdb/testsuite/gdb.compile/compile-ifunc.exp b/gdb/testsuite/gdb.compile/compile-ifunc.exp
index 5c51dd173c5..f4ad9292295 100644
--- a/gdb/testsuite/gdb.compile/compile-ifunc.exp
+++ b/gdb/testsuite/gdb.compile/compile-ifunc.exp
@@ -15,9 +15,7 @@
 
 load_lib compile-support.exp
 
-if {[skip_ifunc_tests]} {
-    return 0
-}
+require !skip_ifunc_tests
 
 standard_testfile
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 20/46] Use require skip_aarch64_sve_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (18 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 19/46] Use require skip_ifunc_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-19 10:50   ` Luis Machado
  2022-12-17  0:07 ` [PATCH 21/46] Use require skip_btrace_tests Tom Tromey
                   ` (27 subsequent siblings)
  47 siblings, 1 reply; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_aarch64_sve_tests".
---
 gdb/testsuite/gdb.arch/aarch64-sve.exp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/aarch64-sve.exp b/gdb/testsuite/gdb.arch/aarch64-sve.exp
index 803aae5fdfb..56793cec44e 100644
--- a/gdb/testsuite/gdb.arch/aarch64-sve.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-sve.exp
@@ -15,10 +15,7 @@
 
 # Test a binary that uses SVE and exercise changing the SVE vector length.
 
-if {[skip_aarch64_sve_tests]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require !skip_aarch64_sve_tests
 
 standard_testfile
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 21/46] Use require skip_btrace_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (19 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 20/46] Use require skip_aarch64_sve_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  1:15   ` Enze Li
  2022-12-17  0:07 ` [PATCH 22/46] " Tom Tromey
                   ` (26 subsequent siblings)
  47 siblings, 1 reply; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_btrace_tests" and
"require skip_tsx_tests".
---
 gdb/testsuite/gdb.btrace/tsx.exp | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/gdb/testsuite/gdb.btrace/tsx.exp b/gdb/testsuite/gdb.btrace/tsx.exp
index c055b0ae409..81b71b1fef9 100644
--- a/gdb/testsuite/gdb.btrace/tsx.exp
+++ b/gdb/testsuite/gdb.btrace/tsx.exp
@@ -15,15 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_pt_tests] } {
-    unsupported "target does not support PT"
-    return -1
-}
-
-if { [skip_tsx_tests] } {
-    unsupported "target does not support TSX"
-    return -1
-}
+require !skip_btrace_pt_tests !skip_tsx_tests
 
 standard_testfile .c x86-tsx.S
 if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 22/46] Use require skip_btrace_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (20 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 21/46] Use require skip_btrace_tests Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  9:22   ` Metzger, Markus T
  2022-12-17  0:07 ` [PATCH 23/46] Use require skip_avx_* Tom Tromey
                   ` (25 subsequent siblings)
  47 siblings, 1 reply; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_btrace_tests".
---
 gdb/testsuite/gdb.btrace/buffer-size.exp              | 5 +----
 gdb/testsuite/gdb.btrace/data.exp                     | 5 +----
 gdb/testsuite/gdb.btrace/delta.exp                    | 5 +----
 gdb/testsuite/gdb.btrace/enable-new-thread.exp        | 5 +----
 gdb/testsuite/gdb.btrace/enable-running.exp           | 5 +----
 gdb/testsuite/gdb.btrace/enable.exp                   | 5 +----
 gdb/testsuite/gdb.btrace/exception.exp                | 5 +----
 gdb/testsuite/gdb.btrace/function_call_history.exp    | 5 +----
 gdb/testsuite/gdb.btrace/gcore.exp                    | 5 +----
 gdb/testsuite/gdb.btrace/instruction_history.exp      | 5 +----
 gdb/testsuite/gdb.btrace/multi-inferior.exp           | 5 +----
 gdb/testsuite/gdb.btrace/multi-thread-step.exp        | 5 +----
 gdb/testsuite/gdb.btrace/nohist.exp                   | 5 +----
 gdb/testsuite/gdb.btrace/non-stop.exp                 | 5 +----
 gdb/testsuite/gdb.btrace/reconnect.exp                | 5 +----
 gdb/testsuite/gdb.btrace/record_goto-step.exp         | 5 +----
 gdb/testsuite/gdb.btrace/record_goto.exp              | 5 +----
 gdb/testsuite/gdb.btrace/rn-dl-bind.exp               | 5 +----
 gdb/testsuite/gdb.btrace/segv.exp                     | 5 +----
 gdb/testsuite/gdb.btrace/step.exp                     | 5 +----
 gdb/testsuite/gdb.btrace/stepi.exp                    | 5 +----
 gdb/testsuite/gdb.btrace/tailcall-only.exp            | 5 +----
 gdb/testsuite/gdb.btrace/tailcall.exp                 | 5 +----
 gdb/testsuite/gdb.btrace/unknown_functions.exp        | 5 +----
 gdb/testsuite/gdb.btrace/vdso.exp                     | 5 +----
 gdb/testsuite/gdb.python/py-record-btrace-threads.exp | 5 +----
 gdb/testsuite/gdb.python/py-record-btrace.exp         | 5 +----
 27 files changed, 27 insertions(+), 108 deletions(-)

diff --git a/gdb/testsuite/gdb.btrace/buffer-size.exp b/gdb/testsuite/gdb.btrace/buffer-size.exp
index f1185050b40..fc784070cca 100644
--- a/gdb/testsuite/gdb.btrace/buffer-size.exp
+++ b/gdb/testsuite/gdb.btrace/buffer-size.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/data.exp b/gdb/testsuite/gdb.btrace/data.exp
index bb1f80cc629..7afbcd4af3b 100644
--- a/gdb/testsuite/gdb.btrace/data.exp
+++ b/gdb/testsuite/gdb.btrace/data.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/delta.exp b/gdb/testsuite/gdb.btrace/delta.exp
index e2a69ad6e33..4dfceff1561 100644
--- a/gdb/testsuite/gdb.btrace/delta.exp
+++ b/gdb/testsuite/gdb.btrace/delta.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/enable-new-thread.exp b/gdb/testsuite/gdb.btrace/enable-new-thread.exp
index 39b3455fbd2..73fe4a40eb6 100644
--- a/gdb/testsuite/gdb.btrace/enable-new-thread.exp
+++ b/gdb/testsuite/gdb.btrace/enable-new-thread.exp
@@ -17,10 +17,7 @@
 
 # Test that new threads of recorded inferiors also get recorded.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] {
diff --git a/gdb/testsuite/gdb.btrace/enable-running.exp b/gdb/testsuite/gdb.btrace/enable-running.exp
index d2e010708c0..35b56444262 100644
--- a/gdb/testsuite/gdb.btrace/enable-running.exp
+++ b/gdb/testsuite/gdb.btrace/enable-running.exp
@@ -15,10 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
diff --git a/gdb/testsuite/gdb.btrace/enable.exp b/gdb/testsuite/gdb.btrace/enable.exp
index 0a7fae778b5..99f6b2eba92 100644
--- a/gdb/testsuite/gdb.btrace/enable.exp
+++ b/gdb/testsuite/gdb.btrace/enable.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # start fresh - without an executable
 gdb_exit
diff --git a/gdb/testsuite/gdb.btrace/exception.exp b/gdb/testsuite/gdb.btrace/exception.exp
index 8533ee875bf..798fb5a137f 100755
--- a/gdb/testsuite/gdb.btrace/exception.exp
+++ b/gdb/testsuite/gdb.btrace/exception.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # We expect a specific function call history.  This gets messed up with
 # PIE on 32-bit.
diff --git a/gdb/testsuite/gdb.btrace/function_call_history.exp b/gdb/testsuite/gdb.btrace/function_call_history.exp
index 9ff8bf93736..5d81bc097e9 100644
--- a/gdb/testsuite/gdb.btrace/function_call_history.exp
+++ b/gdb/testsuite/gdb.btrace/function_call_history.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # We expect a specific function call history.  This gets messed up with
 # PIE on 32-bit.
diff --git a/gdb/testsuite/gdb.btrace/gcore.exp b/gdb/testsuite/gdb.btrace/gcore.exp
index 08ad8d53356..9284f3633f3 100644
--- a/gdb/testsuite/gdb.btrace/gcore.exp
+++ b/gdb/testsuite/gdb.btrace/gcore.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/instruction_history.exp b/gdb/testsuite/gdb.btrace/instruction_history.exp
index 415bcf8e308..5559922bb03 100644
--- a/gdb/testsuite/gdb.btrace/instruction_history.exp
+++ b/gdb/testsuite/gdb.btrace/instruction_history.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile .c .S
 if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
diff --git a/gdb/testsuite/gdb.btrace/multi-inferior.exp b/gdb/testsuite/gdb.btrace/multi-inferior.exp
index e10fda32fba..1354ae10819 100644
--- a/gdb/testsuite/gdb.btrace/multi-inferior.exp
+++ b/gdb/testsuite/gdb.btrace/multi-inferior.exp
@@ -22,10 +22,7 @@
 #
 # Each inferior can be recorded separately.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 if { [use_gdb_stub] } {
     unsupported "test creates multiple inferiors"
diff --git a/gdb/testsuite/gdb.btrace/multi-thread-step.exp b/gdb/testsuite/gdb.btrace/multi-thread-step.exp
index 2fdd7c2c6ca..34d4a0f9046 100644
--- a/gdb/testsuite/gdb.btrace/multi-thread-step.exp
+++ b/gdb/testsuite/gdb.btrace/multi-thread-step.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
diff --git a/gdb/testsuite/gdb.btrace/nohist.exp b/gdb/testsuite/gdb.btrace/nohist.exp
index 4d6e5814638..2651bb7ac0e 100644
--- a/gdb/testsuite/gdb.btrace/nohist.exp
+++ b/gdb/testsuite/gdb.btrace/nohist.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/non-stop.exp b/gdb/testsuite/gdb.btrace/non-stop.exp
index 40dfd54f640..1b76ec41a60 100644
--- a/gdb/testsuite/gdb.btrace/non-stop.exp
+++ b/gdb/testsuite/gdb.btrace/non-stop.exp
@@ -15,10 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
diff --git a/gdb/testsuite/gdb.btrace/reconnect.exp b/gdb/testsuite/gdb.btrace/reconnect.exp
index cc55f73cd17..4b9e7d7c921 100644
--- a/gdb/testsuite/gdb.btrace/reconnect.exp
+++ b/gdb/testsuite/gdb.btrace/reconnect.exp
@@ -19,10 +19,7 @@
 
 load_lib gdbserver-support.exp
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 if { [skip_gdbserver_tests] } {
     unsupported "target does not support gdbserver"
     return -1
diff --git a/gdb/testsuite/gdb.btrace/record_goto-step.exp b/gdb/testsuite/gdb.btrace/record_goto-step.exp
index 8c4ac1bdfc8..422145fb138 100644
--- a/gdb/testsuite/gdb.btrace/record_goto-step.exp
+++ b/gdb/testsuite/gdb.btrace/record_goto-step.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/record_goto.exp b/gdb/testsuite/gdb.btrace/record_goto.exp
index b6db2a709c8..c65a5fe6131 100644
--- a/gdb/testsuite/gdb.btrace/record_goto.exp
+++ b/gdb/testsuite/gdb.btrace/record_goto.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # The "record goto" command jumps to a specific instruction in the execution
 # trace.  To guarantee that we always get the same execution trace, we use
diff --git a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
index eb486b33124..efea6e51398 100644
--- a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
+++ b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
@@ -21,10 +21,7 @@
 # Test that we can reverse-next over the dynamic linker's symbol
 # lookup code.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile $srcfile \
diff --git a/gdb/testsuite/gdb.btrace/segv.exp b/gdb/testsuite/gdb.btrace/segv.exp
index 4e66444475d..e18cf8ff5e3 100644
--- a/gdb/testsuite/gdb.btrace/segv.exp
+++ b/gdb/testsuite/gdb.btrace/segv.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/step.exp b/gdb/testsuite/gdb.btrace/step.exp
index e372b2ee631..942cb51c530 100644
--- a/gdb/testsuite/gdb.btrace/step.exp
+++ b/gdb/testsuite/gdb.btrace/step.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/stepi.exp b/gdb/testsuite/gdb.btrace/stepi.exp
index a8c3f8c511e..33b788c10d3 100644
--- a/gdb/testsuite/gdb.btrace/stepi.exp
+++ b/gdb/testsuite/gdb.btrace/stepi.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # This test is stepping on instruction level.  To guarantee that we always
 # get the same execution trace, we use an assembly source file.
diff --git a/gdb/testsuite/gdb.btrace/tailcall-only.exp b/gdb/testsuite/gdb.btrace/tailcall-only.exp
index 6cd4afa4fe9..e2163ea1577 100644
--- a/gdb/testsuite/gdb.btrace/tailcall-only.exp
+++ b/gdb/testsuite/gdb.btrace/tailcall-only.exp
@@ -20,10 +20,7 @@
 # calls.  This used to cause a crash in get_frame_type.
 #
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # This test requires the compiler to generate a tail call.  To guarantee that
 # we always get one, we use an assembly source file.
diff --git a/gdb/testsuite/gdb.btrace/tailcall.exp b/gdb/testsuite/gdb.btrace/tailcall.exp
index 63a57c8772b..e6cf0fea450 100644
--- a/gdb/testsuite/gdb.btrace/tailcall.exp
+++ b/gdb/testsuite/gdb.btrace/tailcall.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # This test requires the compiler to generate a tail call.  To guarantee that
 # we always get one, we use an assembly source file.
diff --git a/gdb/testsuite/gdb.btrace/unknown_functions.exp b/gdb/testsuite/gdb.btrace/unknown_functions.exp
index 798bd7cb07a..5ae612e4c28 100644
--- a/gdb/testsuite/gdb.btrace/unknown_functions.exp
+++ b/gdb/testsuite/gdb.btrace/unknown_functions.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.btrace/vdso.exp b/gdb/testsuite/gdb.btrace/vdso.exp
index 39789598cf5..a334318301a 100644
--- a/gdb/testsuite/gdb.btrace/vdso.exp
+++ b/gdb/testsuite/gdb.btrace/vdso.exp
@@ -20,10 +20,7 @@
 #
 # Test that we can access the vdso memory during replay for stepping.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.python/py-record-btrace-threads.exp b/gdb/testsuite/gdb.python/py-record-btrace-threads.exp
index 7827e5aaee8..a6160a5caf1 100644
--- a/gdb/testsuite/gdb.python/py-record-btrace-threads.exp
+++ b/gdb/testsuite/gdb.python/py-record-btrace-threads.exp
@@ -17,10 +17,7 @@
 
 # Skip this test if btrace is disabled.
 
-if { [skip_btrace_tests] } {
-    untested "skipping btrace tests"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.python/py-record-btrace.exp b/gdb/testsuite/gdb.python/py-record-btrace.exp
index bbaf268c86a..f95044a8dc6 100644
--- a/gdb/testsuite/gdb.python/py-record-btrace.exp
+++ b/gdb/testsuite/gdb.python/py-record-btrace.exp
@@ -17,10 +17,7 @@
 
 # Skip this test if btrace is disabled.
 
-if { [skip_btrace_tests] } {
-    untested "skipping btrace tests"
-    return -1
-}
+require !skip_btrace_tests
 
 load_lib gdb-python.exp
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 23/46] Use require skip_avx_*
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (21 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 22/46] " Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 24/46] Use require support_displaced_stepping Tom Tromey
                   ` (24 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require" with skip_avx_*.
---
 gdb/testsuite/gdb.arch/x86-avx512bf16.exp     | 5 +----
 gdb/testsuite/gdb.arch/x86-avx512fp16-abi.exp | 5 +----
 gdb/testsuite/gdb.arch/x86-avx512fp16.exp     | 5 +----
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/x86-avx512bf16.exp b/gdb/testsuite/gdb.arch/x86-avx512bf16.exp
index 0f2fd15e6a2..3db86a0ec3d 100644
--- a/gdb/testsuite/gdb.arch/x86-avx512bf16.exp
+++ b/gdb/testsuite/gdb.arch/x86-avx512bf16.exp
@@ -18,10 +18,7 @@
 
 # Test bfloat16 support in AVX512 registers
 
-if { [skip_avx512bf16_tests] } {
-    unsupported "target does not support AVX512BF16"
-    return -1
-}
+require !skip_avx512bf16_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.arch/x86-avx512fp16-abi.exp b/gdb/testsuite/gdb.arch/x86-avx512fp16-abi.exp
index bbf7e738a25..0046ce65d5e 100644
--- a/gdb/testsuite/gdb.arch/x86-avx512fp16-abi.exp
+++ b/gdb/testsuite/gdb.arch/x86-avx512fp16-abi.exp
@@ -15,10 +15,7 @@
 
 # Test support for _Float16 parameters and return values.
 
-if { [skip_avx512fp16_tests] } {
-    unsupported "target does not support AVX512fp16"
-    return -1
-}
+require !skip_avx512fp16_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.arch/x86-avx512fp16.exp b/gdb/testsuite/gdb.arch/x86-avx512fp16.exp
index 6e6a828c825..3fb3efc353e 100644
--- a/gdb/testsuite/gdb.arch/x86-avx512fp16.exp
+++ b/gdb/testsuite/gdb.arch/x86-avx512fp16.exp
@@ -15,10 +15,7 @@
 
 # Test fp16 support in AVX512 registers.
 
-if { [skip_avx512fp16_tests] } {
-    unsupported "target does not support AVX512fp16"
-    return -1
-}
+require !skip_avx512fp16_tests
 
 standard_testfile
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 24/46] Use require support_displaced_stepping
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (22 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 23/46] Use require skip_avx_* Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:07 ` [PATCH 25/46] Use require is_aarch64_target Tom Tromey
                   ` (23 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require support_displaced_stepping".
---
 gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp | 5 +----
 gdb/testsuite/gdb.base/async-shell.exp          | 5 +----
 gdb/testsuite/gdb.base/inferior-died.exp        | 5 +----
 gdb/testsuite/gdb.base/moribund-step.exp        | 5 +----
 gdb/testsuite/gdb.mi/mi-nonstop-exit.exp        | 5 +----
 gdb/testsuite/gdb.mi/mi-nonstop.exp             | 5 +----
 gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp   | 5 +----
 gdb/testsuite/gdb.mi/mi-nsintrall.exp           | 5 +----
 gdb/testsuite/gdb.mi/mi-nsmoribund.exp          | 5 +----
 gdb/testsuite/gdb.mi/mi-nsthrexec.exp           | 5 +----
 gdb/testsuite/gdb.mi/mi-watch-nonstop.exp       | 7 +------
 gdb/testsuite/gdb.python/py-evthreads.exp       | 5 +----
 12 files changed, 12 insertions(+), 50 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp b/gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp
index a7676bdadc0..5e8e57a51e1 100644
--- a/gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp
+++ b/gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp
@@ -16,10 +16,7 @@ standard_testfile insn-reloc.c
 set executable $testfile
 set expfile $testfile.exp
 
-if { ![support_displaced_stepping] } {
-    unsupported "displaced stepping"
-    return -1
-}
+require support_displaced_stepping
 
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
diff --git a/gdb/testsuite/gdb.base/async-shell.exp b/gdb/testsuite/gdb.base/async-shell.exp
index 2c09863ad59..b66f70909ae 100644
--- a/gdb/testsuite/gdb.base/async-shell.exp
+++ b/gdb/testsuite/gdb.base/async-shell.exp
@@ -15,10 +15,7 @@
 
 standard_testfile
 
-if { ![support_displaced_stepping] } { 
-    unsupported "displaced stepping"
-    return -1
-}
+require support_displaced_stepping
 
 # The testfile uses "run".  The real bug happened only for ![is_remote target].
 if [use_gdb_stub] {
diff --git a/gdb/testsuite/gdb.base/inferior-died.exp b/gdb/testsuite/gdb.base/inferior-died.exp
index fc0a722d4b4..f301546a0da 100644
--- a/gdb/testsuite/gdb.base/inferior-died.exp
+++ b/gdb/testsuite/gdb.base/inferior-died.exp
@@ -21,10 +21,7 @@ if {![istarget "*-*-linux*"]} {
     return
 }
 
-if { ![support_displaced_stepping] } {
-    unsupported "inferior-died.exp"
-    return -1
-}
+require support_displaced_stepping
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.base/moribund-step.exp b/gdb/testsuite/gdb.base/moribund-step.exp
index caaa8ed5672..ad3185e00f0 100644
--- a/gdb/testsuite/gdb.base/moribund-step.exp
+++ b/gdb/testsuite/gdb.base/moribund-step.exp
@@ -15,10 +15,7 @@
 
 standard_testfile start.c
 
-if { ![support_displaced_stepping] } {
-    unsupported "displaced stepping"
-    return -1
-}
+require support_displaced_stepping
 
 save_vars { GDBFLAGS } {
     set GDBFLAGS "$GDBFLAGS -ex \"set non-stop on\""
diff --git a/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp b/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp
index 9e650b82534..07ce0b378c6 100644
--- a/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp
+++ b/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { ![support_displaced_stepping] } { 
-    unsupported "displaced stepping"
-    return -1
-}
+require support_displaced_stepping
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.mi/mi-nonstop.exp b/gdb/testsuite/gdb.mi/mi-nonstop.exp
index 12cfab2619f..75d26a0dcf4 100644
--- a/gdb/testsuite/gdb.mi/mi-nonstop.exp
+++ b/gdb/testsuite/gdb.mi/mi-nonstop.exp
@@ -14,10 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-if { ![support_displaced_stepping] } { 
-    unsupported "displaced stepping"
-    return -1
-}
+require support_displaced_stepping
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp b/gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp
index 847e28b1985..dc68b150009 100644
--- a/gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp
+++ b/gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp
@@ -16,10 +16,7 @@
 # Regression test for PR11557.  Make sure we don't end up with a stale
 # register cache just after resuming a thread.
 
-if { ![support_displaced_stepping] } { 
-    unsupported "displaced stepping"
-    return -1
-}
+require support_displaced_stepping
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.mi/mi-nsintrall.exp b/gdb/testsuite/gdb.mi/mi-nsintrall.exp
index b8184f9bba7..98d3a6660b3 100644
--- a/gdb/testsuite/gdb.mi/mi-nsintrall.exp
+++ b/gdb/testsuite/gdb.mi/mi-nsintrall.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { ![support_displaced_stepping] } { 
-    unsupported "displaced stepping"
-    return -1
-}
+require support_displaced_stepping
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
index db6e6ec3633..1947de86211 100644
--- a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
+++ b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { ![support_displaced_stepping] } { 
-    unsupported "displaced stepping"
-    return -1
-}
+require support_displaced_stepping
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.mi/mi-nsthrexec.exp b/gdb/testsuite/gdb.mi/mi-nsthrexec.exp
index fa106fa9efa..837a9d4879d 100644
--- a/gdb/testsuite/gdb.mi/mi-nsthrexec.exp
+++ b/gdb/testsuite/gdb.mi/mi-nsthrexec.exp
@@ -18,10 +18,7 @@
 # the main thread doesn't just silently stop at the first internal
 # breakpoint (usually the _dl_debug_state breakpoint).
 
-if { ![support_displaced_stepping] } { 
-    unsupported "displaced stepping"
-    return -1
-}
+require support_displaced_stepping
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.mi/mi-watch-nonstop.exp b/gdb/testsuite/gdb.mi/mi-watch-nonstop.exp
index e3b9b23c109..fa5a56c34b2 100644
--- a/gdb/testsuite/gdb.mi/mi-watch-nonstop.exp
+++ b/gdb/testsuite/gdb.mi/mi-watch-nonstop.exp
@@ -13,12 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-require !skip_hw_watchpoint_tests
-
-if { ![support_displaced_stepping] } { 
-    unsupported "displaced stepping"
-    return -1
-}
+require !skip_hw_watchpoint_tests support_displaced_stepping
 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
diff --git a/gdb/testsuite/gdb.python/py-evthreads.exp b/gdb/testsuite/gdb.python/py-evthreads.exp
index 76896ddf14a..44d9a559f18 100644
--- a/gdb/testsuite/gdb.python/py-evthreads.exp
+++ b/gdb/testsuite/gdb.python/py-evthreads.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { ![support_displaced_stepping] } { 
-    unsupported "displaced stepping"
-    return -1
-}
+require support_displaced_stepping
 
 load_lib gdb-python.exp
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 25/46] Use require is_aarch64_target
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (23 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 24/46] Use require support_displaced_stepping Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-19 10:46   ` Luis Machado
  2022-12-17  0:07 ` [PATCH 26/46] Use require is_aarch32_target Tom Tromey
                   ` (22 subsequent siblings)
  47 siblings, 1 reply; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require is_aarch64_target".
---
 gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp     | 5 +----
 gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp    | 5 +----
 gdb/testsuite/gdb.arch/aarch64-dbreg-contents.exp  | 5 +----
 gdb/testsuite/gdb.arch/aarch64-fp.exp              | 5 +----
 gdb/testsuite/gdb.arch/aarch64-mte-core.exp        | 5 +----
 gdb/testsuite/gdb.arch/aarch64-mte.exp             | 5 +----
 gdb/testsuite/gdb.arch/aarch64-pauth.exp           | 5 +----
 gdb/testsuite/gdb.arch/aarch64-prologue.exp        | 5 +----
 gdb/testsuite/gdb.arch/aarch64-sighandler-regs.exp | 5 +----
 gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp  | 5 +----
 gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp       | 5 +----
 gdb/testsuite/gdb.arch/aarch64-w-registers.exp     | 5 +----
 12 files changed, 12 insertions(+), 48 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp b/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
index 18843d341e1..a72210ffa68 100644
--- a/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
@@ -18,10 +18,7 @@
 # Test single stepping through atomic sequences beginning with
 # a ldxr instruction and ending with a stxr instruction.
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch64_target
 
 standard_testfile
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
diff --git a/gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp b/gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp
index f4ecc554379..9e1f7d6f8a6 100644
--- a/gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp
@@ -18,10 +18,7 @@
 # Test if GDB stops at various BRK instruction patterns inserted into
 # the code.
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch64_target
 
 standard_testfile
 if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
diff --git a/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.exp b/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.exp
index add1234e606..f8606e219ad 100644
--- a/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.exp
@@ -21,10 +21,7 @@
 #
 # See PR breakpoints/21870.
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch64_target
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.arch/aarch64-fp.exp b/gdb/testsuite/gdb.arch/aarch64-fp.exp
index 41c162b4d50..48c39951e4f 100644
--- a/gdb/testsuite/gdb.arch/aarch64-fp.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-fp.exp
@@ -18,10 +18,7 @@
 # PR server/17457
 # Test aarch64 floating point registers q0, q1, v0, v1, fpsr, fpcr
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch64_target
 
 standard_testfile
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
diff --git a/gdb/testsuite/gdb.arch/aarch64-mte-core.exp b/gdb/testsuite/gdb.arch/aarch64-mte-core.exp
index 904364d027c..5ebc6d7d1ee 100644
--- a/gdb/testsuite/gdb.arch/aarch64-mte-core.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-mte-core.exp
@@ -164,10 +164,7 @@ proc test_mode { mode } {
 
 }
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch64_target
 
 # Run tests
 foreach_with_prefix mode {"sync" "async"} {
diff --git a/gdb/testsuite/gdb.arch/aarch64-mte.exp b/gdb/testsuite/gdb.arch/aarch64-mte.exp
index 4aaf1844f24..a4a8a20d8aa 100644
--- a/gdb/testsuite/gdb.arch/aarch64-mte.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-mte.exp
@@ -43,10 +43,7 @@ proc get_ltag_from_ptr { ptr } {
 		      "fetch tag from pointer ${ptr}"]
 }
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch64_target
 
 standard_testfile
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
diff --git a/gdb/testsuite/gdb.arch/aarch64-pauth.exp b/gdb/testsuite/gdb.arch/aarch64-pauth.exp
index 901eb8212c9..54bf16c5f67 100644
--- a/gdb/testsuite/gdb.arch/aarch64-pauth.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-pauth.exp
@@ -17,10 +17,7 @@
 # supports pauth instructions.  On non pauth systems, all pauth instructions
 # are treated as nops.
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch64_target
 
 # Build program with address signing forced on.
 standard_testfile
diff --git a/gdb/testsuite/gdb.arch/aarch64-prologue.exp b/gdb/testsuite/gdb.arch/aarch64-prologue.exp
index d17dc668873..588bc269336 100644
--- a/gdb/testsuite/gdb.arch/aarch64-prologue.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-prologue.exp
@@ -15,10 +15,7 @@
 
 # This file is part of the gdb testsuite.
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return 1
-}
+require is_aarch64_target
 
 standard_testfile
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}]} {
diff --git a/gdb/testsuite/gdb.arch/aarch64-sighandler-regs.exp b/gdb/testsuite/gdb.arch/aarch64-sighandler-regs.exp
index 7cb3adad076..1175e8d6b4f 100644
--- a/gdb/testsuite/gdb.arch/aarch64-sighandler-regs.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-sighandler-regs.exp
@@ -15,10 +15,7 @@
 #
 # This file is part of the gdb testsuite.
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return -1
-}
+require is_aarch64_target
 
 set compile_flags {debug}
 
diff --git a/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp b/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp
index 6e94a8fc11a..8faf92bee8d 100644
--- a/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp
@@ -15,10 +15,7 @@
 #
 # This file is part of the gdb testsuite.
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch64_target
 
 standard_testfile
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
diff --git a/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp b/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp
index a6d549a9830..9e9613aa3f9 100644
--- a/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp
@@ -17,10 +17,7 @@
 
 # Test explicitly unwinding the PC DWARF register on aarch64
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch64_target
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.arch/aarch64-w-registers.exp b/gdb/testsuite/gdb.arch/aarch64-w-registers.exp
index 72711fe660f..7e4fc24c3cb 100644
--- a/gdb/testsuite/gdb.arch/aarch64-w-registers.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-w-registers.exp
@@ -16,10 +16,7 @@
 # Check if the W registers have the expected size and if setting/fetching
 # values from W registers works correctly for both big and little endian.
 
-if {![is_aarch64_target]} {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch64_target
 
 standard_testfile
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}]} {
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 26/46] Use require is_aarch32_target
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (24 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 25/46] Use require is_aarch64_target Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-19 10:46   ` Luis Machado
  2022-12-17  0:07 ` [PATCH 27/46] Use require is_amd64_regs_target Tom Tromey
                   ` (21 subsequent siblings)
  47 siblings, 1 reply; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require is_aarch32_target".
---
 gdb/testsuite/gdb.arch/arm-bl-branch-dest.exp            | 5 +----
 gdb/testsuite/gdb.arch/arm-disp-step.exp                 | 5 +----
 gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp | 5 +----
 gdb/testsuite/gdb.arch/pr25124.exp                       | 5 +----
 gdb/testsuite/gdb.arch/thumb-bx-pc.exp                   | 5 +----
 gdb/testsuite/gdb.arch/thumb-prologue.exp                | 5 +----
 gdb/testsuite/gdb.arch/thumb-singlestep.exp              | 5 +----
 7 files changed, 7 insertions(+), 28 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/arm-bl-branch-dest.exp b/gdb/testsuite/gdb.arch/arm-bl-branch-dest.exp
index 34d98aec96e..37710649005 100644
--- a/gdb/testsuite/gdb.arch/arm-bl-branch-dest.exp
+++ b/gdb/testsuite/gdb.arch/arm-bl-branch-dest.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { ![is_aarch32_target] } {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch32_target
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.arch/arm-disp-step.exp b/gdb/testsuite/gdb.arch/arm-disp-step.exp
index ec6578257b3..0eb1707bb6c 100644
--- a/gdb/testsuite/gdb.arch/arm-disp-step.exp
+++ b/gdb/testsuite/gdb.arch/arm-disp-step.exp
@@ -17,10 +17,7 @@
 
 # Test arm displaced stepping.
 
-if {![is_aarch32_target]} {
-    verbose "Skipping arm displaced stepping tests."
-    return
-}
+require is_aarch32_target
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp b/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp
index c3544b16a0b..22a2559b271 100644
--- a/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp
+++ b/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { ![is_aarch32_target] } {
-    verbose "Skipping ${gdb_test_file_name}."
-    return
-}
+require is_aarch32_target
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.arch/pr25124.exp b/gdb/testsuite/gdb.arch/pr25124.exp
index a68a3d1b7df..95636bd1ed8 100644
--- a/gdb/testsuite/gdb.arch/pr25124.exp
+++ b/gdb/testsuite/gdb.arch/pr25124.exp
@@ -16,10 +16,7 @@
 # Test proper disassembling of ARM thumb instructions when reloading a symbol
 # file.
 
-if {![is_aarch32_target]} {
-    verbose "Skipping ARM tests."
-    return
-}
+require is_aarch32_target
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.arch/thumb-bx-pc.exp b/gdb/testsuite/gdb.arch/thumb-bx-pc.exp
index ccc6fbfdca7..6989d79c6d6 100644
--- a/gdb/testsuite/gdb.arch/thumb-bx-pc.exp
+++ b/gdb/testsuite/gdb.arch/thumb-bx-pc.exp
@@ -15,10 +15,7 @@
 
 # Test PC adjustment from Thumb-mode "bx pc" instruction.
 
-if {![is_aarch32_target]} {
-    verbose "Skipping ARM tests."
-    return
-}
+require is_aarch32_target
 
 set testfile "thumb-bx-pc"
 set srcfile ${testfile}.S
diff --git a/gdb/testsuite/gdb.arch/thumb-prologue.exp b/gdb/testsuite/gdb.arch/thumb-prologue.exp
index 0cb14572345..8e83bd3c009 100644
--- a/gdb/testsuite/gdb.arch/thumb-prologue.exp
+++ b/gdb/testsuite/gdb.arch/thumb-prologue.exp
@@ -15,10 +15,7 @@
 
 # Test ARM/Thumb prologue analyzer.
 
-if {![is_aarch32_target]} {
-    verbose "Skipping ARM prologue tests."
-    return
-}
+require is_aarch32_target
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.arch/thumb-singlestep.exp b/gdb/testsuite/gdb.arch/thumb-singlestep.exp
index 289bdf52463..c3b7999036e 100644
--- a/gdb/testsuite/gdb.arch/thumb-singlestep.exp
+++ b/gdb/testsuite/gdb.arch/thumb-singlestep.exp
@@ -15,10 +15,7 @@
 
 # Test single-stepping into incorrectly marked Thumb routine
 
-if {![is_aarch32_target]} {
-    verbose "Skipping ARM tests."
-    return
-}
+require is_aarch32_target
 
 set testfile "thumb-singlestep"
 set srcfile ${testfile}.S
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 27/46] Use require is_amd64_regs_target
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (25 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 26/46] Use require is_aarch32_target Tom Tromey
@ 2022-12-17  0:07 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 28/46] Use require is_elf_target Tom Tromey
                   ` (20 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:07 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require is_amd64_regs_target".
---
 gdb/testsuite/gdb.arch/amd64-gs_base.exp         | 5 +----
 gdb/testsuite/gdb.arch/amd64-init-x87-values.exp | 4 +---
 gdb/testsuite/gdb.base/disasm-optim.exp          | 4 +---
 gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp | 5 +----
 4 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/amd64-gs_base.exp b/gdb/testsuite/gdb.arch/amd64-gs_base.exp
index f0a1013f2b2..bce7386d7ef 100644
--- a/gdb/testsuite/gdb.arch/amd64-gs_base.exp
+++ b/gdb/testsuite/gdb.arch/amd64-gs_base.exp
@@ -15,10 +15,7 @@
 
 standard_testfile
 
-if {![is_amd64_regs_target]} {
-    verbose "Untested x86_64 fs_base and gs_base tests."
-    return
-}
+require is_amd64_regs_target
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
      [list debug nowarnings]] } {
diff --git a/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp b/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp
index 6a99afb4725..6126a08b3b3 100644
--- a/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp
+++ b/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp
@@ -18,9 +18,7 @@
 # Test initial values of x87 control registers, before any x87
 # instructions have been executed in the inferior.
 
-if {![is_amd64_regs_target]} {
-    return
-}
+require is_amd64_regs_target
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.base/disasm-optim.exp b/gdb/testsuite/gdb.base/disasm-optim.exp
index aa7150815ff..94f177297ce 100644
--- a/gdb/testsuite/gdb.base/disasm-optim.exp
+++ b/gdb/testsuite/gdb.base/disasm-optim.exp
@@ -15,9 +15,7 @@
 
 # This test exercises disassemble /s with optimized and inlined code.
 
-if { ![is_amd64_regs_target] } {
-    return
-}
+require is_amd64_regs_target
 
 standard_testfile .S
 
diff --git a/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp b/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp
index ec5c991e6cb..f354fcdf400 100644
--- a/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp
+++ b/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp
@@ -12,10 +12,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { ! [is_amd64_regs_target] } {
-    verbose "Skipping tfile AVX test (target is not x86_64)."
-    return
-}
+require is_amd64_regs_target
 
 load_lib "trace-support.exp"
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 28/46] Use require is_elf_target
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (26 preceding siblings ...)
  2022-12-17  0:07 ` [PATCH 27/46] Use require is_amd64_regs_target Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 29/46] Use require can_single_step_to_signal_handler Tom Tromey
                   ` (19 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require is_elf_target".
---
 gdb/testsuite/gdb.base/rtld-step.exp | 4 +---
 gdb/testsuite/gdb.base/sym-file.exp  | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.base/rtld-step.exp b/gdb/testsuite/gdb.base/rtld-step.exp
index 0aa2ab0fe1f..a4c53fae92b 100644
--- a/gdb/testsuite/gdb.base/rtld-step.exp
+++ b/gdb/testsuite/gdb.base/rtld-step.exp
@@ -35,9 +35,7 @@
 # or for non-ELF targets.  (We're not really testing or building
 # shared libraries here, but having a RTLD implies having shared
 # libraries on the target.)
-if { [skip_shlib_tests] || ![is_elf_target] } {
-    return 0
-}
+require !skip_shlib_tests is_elf_target
 
 # (Pretend) RTLD file names and flags:
 set rtld_basename ${::gdb_test_file_name}-rtld
diff --git a/gdb/testsuite/gdb.base/sym-file.exp b/gdb/testsuite/gdb.base/sym-file.exp
index b93e99ed9a3..81414f2b36b 100644
--- a/gdb/testsuite/gdb.base/sym-file.exp
+++ b/gdb/testsuite/gdb.base/sym-file.exp
@@ -29,9 +29,7 @@
 # 13) Check that the execution can continue without error.
 # 14) Regression test for a stale breakpoints bug.
 
-if {![is_elf_target]} {
-    return 0
-}
+require is_elf_target
 
 require !skip_shlib_tests
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 29/46] Use require can_single_step_to_signal_handler
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (27 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 28/46] Use require is_elf_target Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 30/46] Use require supports_get_siginfo_type Tom Tromey
                   ` (18 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require can_single_step_to_signal_handler".
---
 gdb/testsuite/gdb.base/kill-after-signal.exp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.base/kill-after-signal.exp b/gdb/testsuite/gdb.base/kill-after-signal.exp
index bdb2a159bfa..ffd5a9f4ce7 100644
--- a/gdb/testsuite/gdb.base/kill-after-signal.exp
+++ b/gdb/testsuite/gdb.base/kill-after-signal.exp
@@ -15,10 +15,7 @@
 
 standard_testfile .c
 
-if { ![can_single_step_to_signal_handler] } {
-    untested "cannot single-step to signal handler"
-    return
-}
+require can_single_step_to_signal_handler
 
 if [target_info exists gdb,nosignals] {
     verbose "Skipping kill-after-signal.exp because of nosignals."
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 30/46] Use require supports_get_siginfo_type
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (28 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 29/46] Use require can_single_step_to_signal_handler Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 31/46] Use require support_go_compile Tom Tromey
                   ` (17 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require supports_get_siginfo_type".
---
 gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp | 5 +----
 gdb/testsuite/gdb.base/siginfo-obj.exp               | 5 +----
 gdb/testsuite/gdb.base/siginfo-thread.exp            | 5 +----
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp b/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp
index c18c5fb0cb8..78b60900914 100644
--- a/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp
+++ b/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp
@@ -30,10 +30,7 @@ if [target_info exists gdb,nosignals] {
     return -1
 }
 
-if { ![supports_get_siginfo_type] } {
-    verbose "Skipping catch-signal-siginfo-cond.exp because of lack of support."
-    return -1
-}
+require supports_get_siginfo_type
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/siginfo-obj.exp b/gdb/testsuite/gdb.base/siginfo-obj.exp
index 5efff68d721..af0dd315f63 100644
--- a/gdb/testsuite/gdb.base/siginfo-obj.exp
+++ b/gdb/testsuite/gdb.base/siginfo-obj.exp
@@ -26,10 +26,7 @@ if [target_info exists gdb,nosignals] {
     return
 }
 
-if { ![supports_get_siginfo_type] } {
-    verbose "Skipping siginfo-obj.exp because of lack of support."
-    return
-}
+require supports_get_siginfo_type
 
 
 standard_testfile
diff --git a/gdb/testsuite/gdb.base/siginfo-thread.exp b/gdb/testsuite/gdb.base/siginfo-thread.exp
index abd328a2a78..559c999b978 100644
--- a/gdb/testsuite/gdb.base/siginfo-thread.exp
+++ b/gdb/testsuite/gdb.base/siginfo-thread.exp
@@ -21,10 +21,7 @@ if [target_info exists gdb,nosignals] {
     return
 }
 
-if { ![supports_get_siginfo_type] } {
-    verbose "Skipping siginfo-thread.exp because of lack of support."
-    return
-}
+require supports_get_siginfo_type
 
 standard_testfile .c
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 31/46] Use require support_go_compile
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (29 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 30/46] Use require supports_get_siginfo_type Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 32/46] Use require use_gdb_stub Tom Tromey
                   ` (16 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require support_go_compile".
---
 gdb/testsuite/gdb.go/chan.exp                    | 3 +--
 gdb/testsuite/gdb.go/global-local-var-shadow.exp | 3 +--
 gdb/testsuite/gdb.go/handcall.exp                | 3 +--
 gdb/testsuite/gdb.go/hello.exp                   | 3 +--
 gdb/testsuite/gdb.go/integers.exp                | 3 +--
 gdb/testsuite/gdb.go/max-depth.exp               | 3 +--
 gdb/testsuite/gdb.go/methods.exp                 | 3 +--
 gdb/testsuite/gdb.go/package.exp                 | 3 +--
 gdb/testsuite/gdb.go/strings.exp                 | 3 +--
 gdb/testsuite/gdb.go/types.exp                   | 3 +--
 gdb/testsuite/gdb.go/unsafe.exp                  | 3 +--
 11 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/gdb/testsuite/gdb.go/chan.exp b/gdb/testsuite/gdb.go/chan.exp
index 90872705c3c..a9ccebc2fcc 100644
--- a/gdb/testsuite/gdb.go/chan.exp
+++ b/gdb/testsuite/gdb.go/chan.exp
@@ -20,8 +20,7 @@
 
 load_lib "go.exp"
 
-require !skip_go_tests
-if { [support_go_compile] == 0 } { continue }
+require !skip_go_tests support_go_compile
 
 standard_testfile .go
 
diff --git a/gdb/testsuite/gdb.go/global-local-var-shadow.exp b/gdb/testsuite/gdb.go/global-local-var-shadow.exp
index c093af5ed63..c926d0d13ae 100644
--- a/gdb/testsuite/gdb.go/global-local-var-shadow.exp
+++ b/gdb/testsuite/gdb.go/global-local-var-shadow.exp
@@ -19,8 +19,7 @@
 
 load_lib "go.exp"
 
-require !skip_go_tests
-if { [support_go_compile] == 0 } { continue }
+require !skip_go_tests support_go_compile
 
 standard_testfile .go
 
diff --git a/gdb/testsuite/gdb.go/handcall.exp b/gdb/testsuite/gdb.go/handcall.exp
index f19601a32c6..93d5f1def90 100644
--- a/gdb/testsuite/gdb.go/handcall.exp
+++ b/gdb/testsuite/gdb.go/handcall.exp
@@ -19,8 +19,7 @@
 
 load_lib "go.exp"
 
-require !skip_go_tests
-if { [support_go_compile] == 0 } { continue }
+require !skip_go_tests support_go_compile
 
 standard_testfile .go
 
diff --git a/gdb/testsuite/gdb.go/hello.exp b/gdb/testsuite/gdb.go/hello.exp
index 9a9ae861494..5879edb8df2 100644
--- a/gdb/testsuite/gdb.go/hello.exp
+++ b/gdb/testsuite/gdb.go/hello.exp
@@ -19,8 +19,7 @@
 
 load_lib "go.exp"
 
-require !skip_go_tests
-if { [support_go_compile] == 0 } { continue }
+require !skip_go_tests support_go_compile
 
 standard_testfile .go
 
diff --git a/gdb/testsuite/gdb.go/integers.exp b/gdb/testsuite/gdb.go/integers.exp
index a68a1f905fd..2e691b0ca46 100644
--- a/gdb/testsuite/gdb.go/integers.exp
+++ b/gdb/testsuite/gdb.go/integers.exp
@@ -19,8 +19,7 @@
 
 load_lib "go.exp"
 
-require !skip_go_tests
-if { [support_go_compile] == 0 } { continue }
+require !skip_go_tests support_go_compile
 
 standard_testfile .go
 
diff --git a/gdb/testsuite/gdb.go/max-depth.exp b/gdb/testsuite/gdb.go/max-depth.exp
index b08cb139020..5a17e488f28 100644
--- a/gdb/testsuite/gdb.go/max-depth.exp
+++ b/gdb/testsuite/gdb.go/max-depth.exp
@@ -19,8 +19,7 @@
 
 load_lib "go.exp"
 
-require !skip_go_tests
-if { [support_go_compile] == 0 } { continue }
+require !skip_go_tests support_go_compile
 
 standard_testfile .go
 
diff --git a/gdb/testsuite/gdb.go/methods.exp b/gdb/testsuite/gdb.go/methods.exp
index 35cfc00dd34..06e0c5a5034 100644
--- a/gdb/testsuite/gdb.go/methods.exp
+++ b/gdb/testsuite/gdb.go/methods.exp
@@ -19,8 +19,7 @@
 
 load_lib "go.exp"
 
-require !skip_go_tests
-if { [support_go_compile] == 0 } { continue }
+require !skip_go_tests support_go_compile
 
 standard_testfile .go
 
diff --git a/gdb/testsuite/gdb.go/package.exp b/gdb/testsuite/gdb.go/package.exp
index 18b3704e891..8779afbffb8 100644
--- a/gdb/testsuite/gdb.go/package.exp
+++ b/gdb/testsuite/gdb.go/package.exp
@@ -19,8 +19,7 @@
 
 load_lib "go.exp"
 
-require !skip_go_tests
-if { [support_go_compile] == 0 } { continue }
+require !skip_go_tests support_go_compile
 
 standard_testfile package1.go package2.go
 
diff --git a/gdb/testsuite/gdb.go/strings.exp b/gdb/testsuite/gdb.go/strings.exp
index f8417f69c0d..86abdfbc1eb 100644
--- a/gdb/testsuite/gdb.go/strings.exp
+++ b/gdb/testsuite/gdb.go/strings.exp
@@ -17,8 +17,7 @@
 
 load_lib "go.exp"
 
-require !skip_go_tests
-if { [support_go_compile] == 0 } { continue }
+require !skip_go_tests support_go_compile
 
 standard_testfile .go
 
diff --git a/gdb/testsuite/gdb.go/types.exp b/gdb/testsuite/gdb.go/types.exp
index 5a8d74b2830..1a9a987f0de 100644
--- a/gdb/testsuite/gdb.go/types.exp
+++ b/gdb/testsuite/gdb.go/types.exp
@@ -19,8 +19,7 @@
 
 load_lib "go.exp"
 
-require !skip_go_tests
-if { [support_go_compile] == 0 } { continue }
+require !skip_go_tests support_go_compile
 
 standard_testfile .go
 
diff --git a/gdb/testsuite/gdb.go/unsafe.exp b/gdb/testsuite/gdb.go/unsafe.exp
index fd25663a6a9..5ee571ed92f 100644
--- a/gdb/testsuite/gdb.go/unsafe.exp
+++ b/gdb/testsuite/gdb.go/unsafe.exp
@@ -19,8 +19,7 @@
 
 load_lib "go.exp"
 
-require !skip_go_tests
-if { [support_go_compile] == 0 } { continue }
+require !skip_go_tests support_go_compile
 
 standard_testfile .go
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 32/46] Use require use_gdb_stub
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (30 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 31/46] Use require support_go_compile Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 33/46] Use require can_spawn_for_attach Tom Tromey
                   ` (15 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require use_gdb_stub".
---
 gdb/testsuite/gdb.ada/exec_changed.exp                    | 5 +----
 gdb/testsuite/gdb.ada/start.exp                           | 5 +----
 gdb/testsuite/gdb.base/args.exp                           | 4 +---
 gdb/testsuite/gdb.base/async-shell.exp                    | 4 +---
 gdb/testsuite/gdb.base/attach-pie-misread.exp             | 3 ++-
 gdb/testsuite/gdb.base/attach-wait-input.exp              | 4 +---
 gdb/testsuite/gdb.base/break-entry.exp                    | 5 +----
 gdb/testsuite/gdb.base/break-interp.exp                   | 3 ++-
 gdb/testsuite/gdb.base/cached-source-file.exp             | 3 ++-
 gdb/testsuite/gdb.base/dprintf-detach.exp                 | 4 +---
 gdb/testsuite/gdb.base/fork-print-inferior-events.exp     | 5 +----
 gdb/testsuite/gdb.base/nostdlib.exp                       | 5 +----
 gdb/testsuite/gdb.base/reread-readsym.exp                 | 4 +---
 gdb/testsuite/gdb.base/run-control-while-bg-execution.exp | 5 +----
 gdb/testsuite/gdb.base/set-cwd.exp                        | 5 +----
 gdb/testsuite/gdb.base/share-env-with-gdbserver.exp       | 5 +----
 gdb/testsuite/gdb.base/solib-display.exp                  | 4 +---
 gdb/testsuite/gdb.base/solib-nodir.exp                    | 4 +---
 gdb/testsuite/gdb.base/start-cpp.exp                      | 5 +----
 gdb/testsuite/gdb.base/start.exp                          | 5 +----
 gdb/testsuite/gdb.base/startup-with-shell.exp             | 5 +----
 gdb/testsuite/gdb.base/testenv.exp                        | 4 +---
 gdb/testsuite/gdb.base/watchpoint-hw.exp                  | 5 +----
 gdb/testsuite/gdb.btrace/multi-inferior.exp               | 5 +----
 gdb/testsuite/gdb.dwarf2/main-subprogram.exp              | 5 +----
 gdb/testsuite/gdb.mi/mi-exec-run.exp                      | 5 +----
 gdb/testsuite/gdb.mi/mi-start.exp                         | 5 +----
 gdb/testsuite/gdb.mi/user-selected-context-sync.exp       | 5 +----
 gdb/testsuite/gdb.multi/attach-while-running.exp          | 5 +----
 gdb/testsuite/gdb.multi/dummy-frame-restore.exp           | 4 +---
 gdb/testsuite/gdb.multi/multi-arch-exec.exp               | 4 +---
 gdb/testsuite/gdb.multi/multi-arch.exp                    | 4 +---
 gdb/testsuite/gdb.multi/multi-exit.exp                    | 4 +---
 gdb/testsuite/gdb.multi/multi-kill.exp                    | 4 +---
 gdb/testsuite/gdb.multi/run-only-second-inf.exp           | 4 +---
 gdb/testsuite/gdb.multi/start-inferior-specific.exp       | 4 +---
 gdb/testsuite/gdb.multi/tids-gid-reset.exp                | 5 +----
 gdb/testsuite/gdb.multi/tids.exp                          | 5 +----
 gdb/testsuite/gdb.multi/watchpoint-multi.exp              | 5 +----
 gdb/testsuite/gdb.python/py-events.exp                    | 4 +---
 gdb/testsuite/gdb.threads/attach-into-signal.exp          | 4 ++--
 gdb/testsuite/gdb.threads/attach-slow-waitpid.exp         | 4 ++--
 gdb/testsuite/gdb.threads/attach-stopped.exp              | 4 ++--
 gdb/testsuite/gdb.threads/vfork-multi-inferior.exp        | 5 +----
 gdb/testsuite/gdb.tui/corefile-run.exp                    | 3 ++-
 45 files changed, 52 insertions(+), 146 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/exec_changed.exp b/gdb/testsuite/gdb.ada/exec_changed.exp
index 2d9b46a20a6..4a2b7b2ac0e 100644
--- a/gdb/testsuite/gdb.ada/exec_changed.exp
+++ b/gdb/testsuite/gdb.ada/exec_changed.exp
@@ -19,10 +19,7 @@ require !skip_ada_tests
 
 # This testcase verifies the behavior of the `start' command, which
 # does not work when we use the gdb stub...
-if [use_gdb_stub] {
-    untested "skipping tests due to use_gdb_stub"
-    return
-}
+require !use_gdb_stub
 
 standard_ada_testfile first
 
diff --git a/gdb/testsuite/gdb.ada/start.exp b/gdb/testsuite/gdb.ada/start.exp
index 868a08fbe4b..4f438833eb7 100644
--- a/gdb/testsuite/gdb.ada/start.exp
+++ b/gdb/testsuite/gdb.ada/start.exp
@@ -19,10 +19,7 @@ require !skip_ada_tests
 
 # This testcase verifies the behavior of the `start' command, which
 # does not work when we use the gdb stub...
-if [use_gdb_stub] {
-    untested "skipping test due to gdb stub"
-    return
-}
+require !use_gdb_stub
 
 standard_ada_testfile dummy
 
diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp
index bb99ac74ad0..f1e59b2b62c 100644
--- a/gdb/testsuite/gdb.base/args.exp
+++ b/gdb/testsuite/gdb.base/args.exp
@@ -22,9 +22,7 @@ if [target_info exists noargs] {
 
 # This test requires starting new inferior processes, skip it if the target
 # board is a stub.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/async-shell.exp b/gdb/testsuite/gdb.base/async-shell.exp
index b66f70909ae..ec260542969 100644
--- a/gdb/testsuite/gdb.base/async-shell.exp
+++ b/gdb/testsuite/gdb.base/async-shell.exp
@@ -18,9 +18,7 @@ standard_testfile
 require support_displaced_stepping
 
 # The testfile uses "run".  The real bug happened only for ![is_remote target].
-if [use_gdb_stub] {
-    return 0
-}
+require !use_gdb_stub
 
 save_vars { GDBFLAGS } {
     set GDBFLAGS "$GDBFLAGS -ex \"set non-stop on\""
diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.exp b/gdb/testsuite/gdb.base/attach-pie-misread.exp
index a97a69c0a0b..2049dd4bb88 100644
--- a/gdb/testsuite/gdb.base/attach-pie-misread.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
@@ -14,7 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-if { ![isnative] || [is_remote host] || [use_gdb_stub]
+require !use_gdb_stub
+if { ![isnative] || [is_remote host]
      || ![istarget *-linux*] || [skip_shlib_tests]} {
     return
 }
diff --git a/gdb/testsuite/gdb.base/attach-wait-input.exp b/gdb/testsuite/gdb.base/attach-wait-input.exp
index b4b19ac8592..1e3f9ad8294 100644
--- a/gdb/testsuite/gdb.base/attach-wait-input.exp
+++ b/gdb/testsuite/gdb.base/attach-wait-input.exp
@@ -29,9 +29,7 @@
 # simpler to do, so we test with both editing on and off.
 
 # The test uses the "attach" command.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/break-entry.exp b/gdb/testsuite/gdb.base/break-entry.exp
index 2d943045588..f6775bfe037 100644
--- a/gdb/testsuite/gdb.base/break-entry.exp
+++ b/gdb/testsuite/gdb.base/break-entry.exp
@@ -27,10 +27,7 @@
 
 standard_testfile start.c
 
-if [use_gdb_stub] {
-    untested "skipping tests due to use_gdb_stub"
-    return
-}
+require !use_gdb_stub
 
 if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile {additional_flags=-static}] } {
     return -1
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index 99371f1f6a1..3ec47628256 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -14,7 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-if { ![isnative] || [is_remote host] || [use_gdb_stub]
+require !use_gdb_stub
+if { ![isnative] || [is_remote host]
      || ![istarget *-linux*] || [skip_shlib_tests]} {
     return
 }
diff --git a/gdb/testsuite/gdb.base/cached-source-file.exp b/gdb/testsuite/gdb.base/cached-source-file.exp
index 75a13378691..e40f1de1ca5 100644
--- a/gdb/testsuite/gdb.base/cached-source-file.exp
+++ b/gdb/testsuite/gdb.base/cached-source-file.exp
@@ -24,7 +24,8 @@
 standard_testfile
 
 # Only run on native boards.
-if { [use_gdb_stub] || [target_info gdb_protocol] == "extended-remote" } {
+require !use_gdb_stub
+if { [target_info gdb_protocol] == "extended-remote" } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/dprintf-detach.exp b/gdb/testsuite/gdb.base/dprintf-detach.exp
index 6c71c61cba8..bd3b8c633a3 100644
--- a/gdb/testsuite/gdb.base/dprintf-detach.exp
+++ b/gdb/testsuite/gdb.base/dprintf-detach.exp
@@ -21,9 +21,7 @@
 load_lib gdbserver-support.exp
 
 # The test relies on "detach/attach".
-if {[use_gdb_stub]} {
-    return 0
-}
+require !use_gdb_stub
 
 standard_testfile
 set escapedbinfile [string_to_regexp ${binfile}]
diff --git a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
index 88d421bc250..7fdd6d43809 100644
--- a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
+++ b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
@@ -20,10 +20,7 @@
 # 'set detach-on-fork [on,off]' are the correct ones.
 
 # This test relies on "run", so it cannot run on target remote stubs.
-if { [use_gdb_stub] } {
-    untested "not supported on target remote stubs"
-    return
-}
+require !use_gdb_stub
 
 # Test relies on checking follow-fork output. Do not run if gdb debug is
 # enabled as it will be redirected to the log.
diff --git a/gdb/testsuite/gdb.base/nostdlib.exp b/gdb/testsuite/gdb.base/nostdlib.exp
index 6c31109ad68..535f72ff8ca 100644
--- a/gdb/testsuite/gdb.base/nostdlib.exp
+++ b/gdb/testsuite/gdb.base/nostdlib.exp
@@ -18,10 +18,7 @@ standard_testfile .c
 # If we're using a stub, breakpoints at the entry point will not trigger.
 # See also the comment in break-entry.exp.
 
-if [use_gdb_stub] {
-    untested "skipping tests due to use_gdb_stub"
-    return
-}
+require !use_gdb_stub
 
 # default_target_compile would otherwise add "-lm" making the testcase
 # dependent on whether the system libraries are already prelinked.
diff --git a/gdb/testsuite/gdb.base/reread-readsym.exp b/gdb/testsuite/gdb.base/reread-readsym.exp
index edda4524f02..d6561a7e61e 100644
--- a/gdb/testsuite/gdb.base/reread-readsym.exp
+++ b/gdb/testsuite/gdb.base/reread-readsym.exp
@@ -38,9 +38,7 @@ proc generate_cmd_file {gdbfile binfile} {
     close $ofd
 }
 
-if [use_gdb_stub] {
-    return 0
-}
+require !use_gdb_stub
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
diff --git a/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp b/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp
index 2f6dde06fa6..cddad2c178d 100644
--- a/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp
+++ b/gdb/testsuite/gdb.base/run-control-while-bg-execution.exp
@@ -21,10 +21,7 @@
 # again.  The test was expanded to test various combinations of
 # run-control-related actions done with an inferior running in background.
 
-if {[use_gdb_stub]} {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/set-cwd.exp b/gdb/testsuite/gdb.base/set-cwd.exp
index 172d603f734..4a66a75a21d 100644
--- a/gdb/testsuite/gdb.base/set-cwd.exp
+++ b/gdb/testsuite/gdb.base/set-cwd.exp
@@ -15,10 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [use_gdb_stub] } {
-    untested "skipping tests due to use_gdb_stub"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp b/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
index 8b2a3038e00..290b1cf7335 100644
--- a/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
+++ b/gdb/testsuite/gdb.base/share-env-with-gdbserver.exp
@@ -16,10 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test doesn't make sense on native-gdbserver.
-if { [use_gdb_stub] } {
-    untested "not supported"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/solib-display.exp b/gdb/testsuite/gdb.base/solib-display.exp
index 79e46865eba..eb20e35d27e 100644
--- a/gdb/testsuite/gdb.base/solib-display.exp
+++ b/gdb/testsuite/gdb.base/solib-display.exp
@@ -43,9 +43,7 @@ require !skip_shlib_tests
 # This is because the initial stop is done before the shared libraries are
 # loaded.
 
-if { [use_gdb_stub] } {
-    return 0
-}
+require !use_gdb_stub
 
 # Library file.
 set libname "solib-display-lib"
diff --git a/gdb/testsuite/gdb.base/solib-nodir.exp b/gdb/testsuite/gdb.base/solib-nodir.exp
index b97064911dd..80cc7f365b9 100644
--- a/gdb/testsuite/gdb.base/solib-nodir.exp
+++ b/gdb/testsuite/gdb.base/solib-nodir.exp
@@ -23,9 +23,7 @@ if [is_remote target] {
 # We need to be able to influence the target's environment and working
 # directory.  Can't do that if when we connect the inferior is already
 # running.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 set testfile "solib-nodir"
 # Arbitrary file, possibly not containing main, even an empty one.
diff --git a/gdb/testsuite/gdb.base/start-cpp.exp b/gdb/testsuite/gdb.base/start-cpp.exp
index 63b6ec006ca..4e77a23f196 100644
--- a/gdb/testsuite/gdb.base/start-cpp.exp
+++ b/gdb/testsuite/gdb.base/start-cpp.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [use_gdb_stub] } {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile .cc
 
diff --git a/gdb/testsuite/gdb.base/start.exp b/gdb/testsuite/gdb.base/start.exp
index a0c8c8c41c1..8560107b779 100644
--- a/gdb/testsuite/gdb.base/start.exp
+++ b/gdb/testsuite/gdb.base/start.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [use_gdb_stub] } {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp
index e99bfe47ee3..c33704ef939 100644
--- a/gdb/testsuite/gdb.base/startup-with-shell.exp
+++ b/gdb/testsuite/gdb.base/startup-with-shell.exp
@@ -16,10 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test doesn't make sense on native-gdbserver.
-if { [use_gdb_stub] } {
-    untested "not supported"
-    return
-}
+require !use_gdb_stub
 
 # There's no easy way to set environment variables on remote targets
 # (via dejagnu) yet.
diff --git a/gdb/testsuite/gdb.base/testenv.exp b/gdb/testsuite/gdb.base/testenv.exp
index 7f1e58fee31..c3d769a739d 100644
--- a/gdb/testsuite/gdb.base/testenv.exp
+++ b/gdb/testsuite/gdb.base/testenv.exp
@@ -20,9 +20,7 @@
 
 # Can't pass environment variables to the inferior if when we connect,
 # the inferior is already running.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw.exp b/gdb/testsuite/gdb.base/watchpoint-hw.exp
index 785f949efe9..09eaa341a54 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [use_gdb_stub] } {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 require !skip_hw_watchpoint_tests
 
diff --git a/gdb/testsuite/gdb.btrace/multi-inferior.exp b/gdb/testsuite/gdb.btrace/multi-inferior.exp
index 1354ae10819..90ab76d0d24 100644
--- a/gdb/testsuite/gdb.btrace/multi-inferior.exp
+++ b/gdb/testsuite/gdb.btrace/multi-inferior.exp
@@ -24,10 +24,7 @@
 
 require !skip_btrace_tests
 
-if { [use_gdb_stub] } {
-    unsupported "test creates multiple inferiors"
-    return -1
-}
+require !use_gdb_stub
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
diff --git a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
index ad714d2f29b..0ad0469e5f6 100644
--- a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
+++ b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
@@ -17,10 +17,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-4 and use gas.
 require dwarf2_support
 
-if { [use_gdb_stub] } {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.mi/mi-exec-run.exp b/gdb/testsuite/gdb.mi/mi-exec-run.exp
index 01f52e22578..d1b014574fa 100644
--- a/gdb/testsuite/gdb.mi/mi-exec-run.exp
+++ b/gdb/testsuite/gdb.mi/mi-exec-run.exp
@@ -28,10 +28,7 @@ set MIFLAGS "-i=mi"
 
 # The purpose of this testcase is to test the -exec-run command. If we
 # cannot use it, then there is no point in running this testcase.
-if [use_gdb_stub] {
-     untested "cannot use -exec-run command"
-     return -1
-}
+require !use_gdb_stub
 
 standard_testfile mi-start.c
 
diff --git a/gdb/testsuite/gdb.mi/mi-start.exp b/gdb/testsuite/gdb.mi/mi-start.exp
index 767ba2c19a6..322c2cced1f 100644
--- a/gdb/testsuite/gdb.mi/mi-start.exp
+++ b/gdb/testsuite/gdb.mi/mi-start.exp
@@ -19,10 +19,7 @@ set MIFLAGS "-i=mi"
 # The purpose of this testcase is to test the --start option of
 # the -exec-run command. If we cannot use the -exec-run command,
 # then there is no point in running this testcase...
-if [use_gdb_stub] {
-     untested "cannot use -exec-run command"
-     return -1
-}
+require !use_gdb_stub
 
 gdb_exit
 if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
index 9eec083068b..1ff35229741 100644
--- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
+++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
@@ -41,10 +41,7 @@ standard_testfile
 
 # Multiple inferiors are needed, therefore only native gdb and extended
 # gdbserver modes are supported.
-if [use_gdb_stub] {
-    untested "using gdb stub"
-    return
-}
+require !use_gdb_stub
 
 set compile_options "debug pthreads"
 if {[build_executable $testfile.exp $testfile ${srcfile} ${compile_options}] == -1} {
diff --git a/gdb/testsuite/gdb.multi/attach-while-running.exp b/gdb/testsuite/gdb.multi/attach-while-running.exp
index 276e1fdb661..a8890dca21f 100644
--- a/gdb/testsuite/gdb.multi/attach-while-running.exp
+++ b/gdb/testsuite/gdb.multi/attach-while-running.exp
@@ -36,10 +36,7 @@
 
 standard_testfile
 
-if [use_gdb_stub] {
-    unsupported "test requires running"
-    return
-}
+require !use_gdb_stub
 
 if { [build_executable "failed to prepare" ${testfile} ${srcfile}] } {
     return
diff --git a/gdb/testsuite/gdb.multi/dummy-frame-restore.exp b/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
index 0cd1cf5a414..836740d61e2 100644
--- a/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
+++ b/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
@@ -17,9 +17,7 @@ standard_testfile .c
 set executable ${testfile}
 
 # The plain remote target can't do multiple inferiors.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
     return -1
diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
index 7899c223553..b1bffb03fd1 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
@@ -19,9 +19,7 @@
 set testfile "multi-arch-exec"
 
 # The plain remote target can't do multiple inferiors.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 # The 64-bit compile may succeed for i386-linux, but gdb won't be able
 # to load the file.
diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp
index a15b0217a9e..0f6bf82b3f5 100644
--- a/gdb/testsuite/gdb.multi/multi-arch.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch.exp
@@ -19,9 +19,7 @@
 set testfile "multi-arch"
 
 # The plain remote target can't do multiple inferiors.
-if [use_gdb_stub] {
-    return
-}
+require !use_gdb_stub
 
 # The 64-bit compile may succeed for i386-linux, but gdb won't be able
 # to load the file.
diff --git a/gdb/testsuite/gdb.multi/multi-exit.exp b/gdb/testsuite/gdb.multi/multi-exit.exp
index 752192fbc89..6e198783112 100644
--- a/gdb/testsuite/gdb.multi/multi-exit.exp
+++ b/gdb/testsuite/gdb.multi/multi-exit.exp
@@ -24,9 +24,7 @@
 
 standard_testfile
 
-if {[use_gdb_stub]} {
-    return 0
-}
+require !use_gdb_stub
 
 if {[build_executable "failed to prepare" $testfile $srcfile]} {
     return -1
diff --git a/gdb/testsuite/gdb.multi/multi-kill.exp b/gdb/testsuite/gdb.multi/multi-kill.exp
index 1474faf8dd0..8783fa0063e 100644
--- a/gdb/testsuite/gdb.multi/multi-kill.exp
+++ b/gdb/testsuite/gdb.multi/multi-kill.exp
@@ -24,9 +24,7 @@
 
 standard_testfile
 
-if {[use_gdb_stub]} {
-    return 0
-}
+require !use_gdb_stub
 
 if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} {
     return -1
diff --git a/gdb/testsuite/gdb.multi/run-only-second-inf.exp b/gdb/testsuite/gdb.multi/run-only-second-inf.exp
index b94689d0bfa..704a9b40556 100644
--- a/gdb/testsuite/gdb.multi/run-only-second-inf.exp
+++ b/gdb/testsuite/gdb.multi/run-only-second-inf.exp
@@ -20,9 +20,7 @@
 
 standard_testfile
 
-if {[use_gdb_stub]} {
-    return 0
-}
+require !use_gdb_stub
 
 if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} {
     return -1
diff --git a/gdb/testsuite/gdb.multi/start-inferior-specific.exp b/gdb/testsuite/gdb.multi/start-inferior-specific.exp
index 45e8e8e2cc5..d103a8643d2 100644
--- a/gdb/testsuite/gdb.multi/start-inferior-specific.exp
+++ b/gdb/testsuite/gdb.multi/start-inferior-specific.exp
@@ -25,9 +25,7 @@
 
 standard_testfile .c -other.c
 
-if { [use_gdb_stub] } {
-    return
-}
+require !use_gdb_stub
 
 set srcfile_other ${srcfile2}
 set binfile_other ${binfile}-other
diff --git a/gdb/testsuite/gdb.multi/tids-gid-reset.exp b/gdb/testsuite/gdb.multi/tids-gid-reset.exp
index 27474b19e36..910df46e51f 100644
--- a/gdb/testsuite/gdb.multi/tids-gid-reset.exp
+++ b/gdb/testsuite/gdb.multi/tids-gid-reset.exp
@@ -52,10 +52,7 @@ with_test_prefix "single-inferior" {
 
 # For the following tests, multiple inferiors are needed, therefore
 # non-extended gdbserver is not supported.
-if [use_gdb_stub] {
-    untested "using gdb stub"
-    return
-}
+require !use_gdb_stub
 
 # Test with multiple inferiors.  This time, since we restart inferior
 # 1 while inferior 2 still has threads, then the new thread 1.1 should
diff --git a/gdb/testsuite/gdb.multi/tids.exp b/gdb/testsuite/gdb.multi/tids.exp
index 44face83860..d274bc15228 100644
--- a/gdb/testsuite/gdb.multi/tids.exp
+++ b/gdb/testsuite/gdb.multi/tids.exp
@@ -22,10 +22,7 @@ standard_testfile
 # Multiple inferiors are needed, therefore both native and extended
 # gdbserver modes are supported.  Only non-extended gdbserver is not
 # supported.
-if [use_gdb_stub] {
-    untested "using gdb stub"
-    return
-}
+require !use_gdb_stub
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads debug}] } {
     return -1
diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.exp b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
index 121d1e8a660..00437c195ef 100644
--- a/gdb/testsuite/gdb.multi/watchpoint-multi.exp
+++ b/gdb/testsuite/gdb.multi/watchpoint-multi.exp
@@ -18,10 +18,7 @@ set executable ${testfile}
 
 # Multiple inferiors are needed, therefore both native and extended gdbserver
 # modes are supported.  Only non-extended gdbserver is not supported.
-if [use_gdb_stub] {
-    untested "using gdb stub"
-    return
-}
+require !use_gdb_stub
 
 # Do not use simple hardware watchpoints ("watch") as its false hit may be
 # unnoticed by GDB if it reads it still has the same value.
diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp
index ce9342afaff..a06904bcbb3 100644
--- a/gdb/testsuite/gdb.python/py-events.exp
+++ b/gdb/testsuite/gdb.python/py-events.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if [use_gdb_stub] {
-    return 0
-}
+require !use_gdb_stub
 
 load_lib gdb-python.exp
 
diff --git a/gdb/testsuite/gdb.threads/attach-into-signal.exp b/gdb/testsuite/gdb.threads/attach-into-signal.exp
index 96878d5e6a0..c2b8ffebf65 100644
--- a/gdb/testsuite/gdb.threads/attach-into-signal.exp
+++ b/gdb/testsuite/gdb.threads/attach-into-signal.exp
@@ -17,8 +17,8 @@
 # This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-if { ![isnative] || [is_remote host] || [use_gdb_stub]
-     || ![istarget *-linux*] } {
+require !use_gdb_stub
+if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp b/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
index 93b1d88c0dc..aa9488af8a6 100644
--- a/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
+++ b/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
@@ -37,8 +37,8 @@
 # during the attach phase.
 
 # This test only works on Linux
-if { ![isnative] || [is_remote host] || [use_gdb_stub]
-     || ![istarget *-linux*] } {
+require !use_gdb_stub
+if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp
index ef3617cc57d..320c304bb7a 100644
--- a/gdb/testsuite/gdb.threads/attach-stopped.exp
+++ b/gdb/testsuite/gdb.threads/attach-stopped.exp
@@ -18,8 +18,8 @@
 # This file was updated by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-if { ![isnative] || [is_remote host] || [use_gdb_stub]
-     || ![istarget *-linux*] } {
+require !use_gdb_stub
+if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/vfork-multi-inferior.exp b/gdb/testsuite/gdb.threads/vfork-multi-inferior.exp
index 22a1476eaac..bca4d2572b4 100644
--- a/gdb/testsuite/gdb.threads/vfork-multi-inferior.exp
+++ b/gdb/testsuite/gdb.threads/vfork-multi-inferior.exp
@@ -25,10 +25,7 @@
 # To catch the bug, this test verifies that we can hit a breakpoint after a
 # vfork call, while a second inferior runs in the background.
 
-if [use_gdb_stub] {
-    unsupported "test uses multiple inferiors"
-    return
-}
+require !use_gdb_stub
 
 standard_testfile .c -sleep.c
 
diff --git a/gdb/testsuite/gdb.tui/corefile-run.exp b/gdb/testsuite/gdb.tui/corefile-run.exp
index 219ebadadae..b64ade1035c 100644
--- a/gdb/testsuite/gdb.tui/corefile-run.exp
+++ b/gdb/testsuite/gdb.tui/corefile-run.exp
@@ -29,7 +29,8 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
 }
 
 # Only run on native boards.
-if { [use_gdb_stub] || [target_info gdb_protocol] == "extended-remote" } {
+require !use_gdb_stub
+if { [target_info gdb_protocol] == "extended-remote" } {
     untested "not supported"
     return
 }
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 33/46] Use require can_spawn_for_attach
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (31 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 32/46] Use require use_gdb_stub Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 34/46] Use require isnative Tom Tromey
                   ` (14 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require can_spawn_for_attach".
---
 gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp           | 4 +---
 gdb/testsuite/gdb.base/attach-pie-noexec.exp                | 4 +---
 gdb/testsuite/gdb.base/attach-twice.exp                     | 4 +---
 gdb/testsuite/gdb.base/attach.exp                           | 4 +---
 gdb/testsuite/gdb.base/dlmopen.exp                          | 5 +----
 gdb/testsuite/gdb.base/interrupt-daemon-attach.exp          | 4 +---
 gdb/testsuite/gdb.base/jit-attach-pie.exp                   | 4 +---
 gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp        | 4 +---
 gdb/testsuite/gdb.base/run-after-attach.exp                 | 4 +---
 gdb/testsuite/gdb.base/solib-overlap.exp                    | 6 +-----
 gdb/testsuite/gdb.base/watchpoint-hw-attach.exp             | 4 +---
 gdb/testsuite/gdb.mi/list-thread-groups-available.exp       | 4 +---
 gdb/testsuite/gdb.multi/attach-no-multi-process.exp         | 4 +---
 gdb/testsuite/gdb.multi/multi-attach.exp                    | 4 +---
 gdb/testsuite/gdb.multi/multi-term-settings.exp             | 4 +---
 gdb/testsuite/gdb.python/py-sync-interp.exp                 | 4 +---
 gdb/testsuite/gdb.server/attach-flag.exp                    | 4 +---
 gdb/testsuite/gdb.server/ext-attach.exp                     | 4 +---
 .../gdb.threads/attach-many-short-lived-threads.exp         | 4 +---
 gdb/testsuite/gdb.threads/attach-non-stop.exp               | 4 +---
 gdb/testsuite/gdb.threads/clone-attach-detach.exp           | 4 +---
 gdb/testsuite/gdb.threads/detach-step-over.exp              | 4 +---
 22 files changed, 22 insertions(+), 69 deletions(-)

diff --git a/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp b/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp
index 1b9dc8a505b..e217469ee35 100644
--- a/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp
+++ b/gdb/testsuite/gdb.base/attach-non-pgrp-leader.exp
@@ -18,9 +18,7 @@
 # call any of setpgrp/setpgid/setsid to move itself to a new process
 # group.
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/attach-pie-noexec.exp b/gdb/testsuite/gdb.base/attach-pie-noexec.exp
index 33238db834d..f7ea13e323f 100644
--- a/gdb/testsuite/gdb.base/attach-pie-noexec.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-noexec.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile .c
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.base/attach-twice.exp b/gdb/testsuite/gdb.base/attach-twice.exp
index 9a00a8aa287..57bb4492f25 100644
--- a/gdb/testsuite/gdb.base/attach-twice.exp
+++ b/gdb/testsuite/gdb.base/attach-twice.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index 453fdbc7857..0f54cb69981 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile attach.c attach2.c attach3.c
 set binfile2 ${binfile}2
diff --git a/gdb/testsuite/gdb.base/dlmopen.exp b/gdb/testsuite/gdb.base/dlmopen.exp
index e8793fbd46d..46e6fa7dc6a 100644
--- a/gdb/testsuite/gdb.base/dlmopen.exp
+++ b/gdb/testsuite/gdb.base/dlmopen.exp
@@ -144,10 +144,7 @@ gdb_breakpoint $srcfile:$bp_main
 test_dlmopen
 
 # Try the same again when attaching after dlmopen().
-if { ![can_spawn_for_attach] } {
-    unsupported "target does not support attach"
-    return -1
-}
+require can_spawn_for_attach
 
 clean_restart $binfile
 
diff --git a/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp b/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp
index bff19074269..fd5b0528754 100644
--- a/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp
+++ b/gdb/testsuite/gdb.base/interrupt-daemon-attach.exp
@@ -24,9 +24,7 @@ if [target_info exists gdb,nointerrupts] {
     return
 }
 
-if { ![can_spawn_for_attach] } {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/jit-attach-pie.exp b/gdb/testsuite/gdb.base/jit-attach-pie.exp
index 7a2387b34d0..469594cd9bd 100644
--- a/gdb/testsuite/gdb.base/jit-attach-pie.exp
+++ b/gdb/testsuite/gdb.base/jit-attach-pie.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile .c
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp b/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp
index 868f9001802..bf2f8c870d8 100644
--- a/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp
+++ b/gdb/testsuite/gdb.base/kill-detach-inferiors-cmd.exp
@@ -18,9 +18,7 @@
 # Test the basic operation of the "kill inferiors" and "detach inferiors"
 # commands.
 
-if ![can_spawn_for_attach] {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile
 set executable $testfile
diff --git a/gdb/testsuite/gdb.base/run-after-attach.exp b/gdb/testsuite/gdb.base/run-after-attach.exp
index beea0e594e1..31e5ec8f3ac 100644
--- a/gdb/testsuite/gdb.base/run-after-attach.exp
+++ b/gdb/testsuite/gdb.base/run-after-attach.exp
@@ -16,9 +16,7 @@
 # Check that forking a process after a previous process was attached to unsets
 # attach_flag.  This is done indirectly by inspecting GDB's quit prompt.
 
-if ![can_spawn_for_attach] {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile
 set executable $testfile
diff --git a/gdb/testsuite/gdb.base/solib-overlap.exp b/gdb/testsuite/gdb.base/solib-overlap.exp
index 51378826657..bb58cde3ca8 100644
--- a/gdb/testsuite/gdb.base/solib-overlap.exp
+++ b/gdb/testsuite/gdb.base/solib-overlap.exp
@@ -27,11 +27,7 @@
 #   difference appears to be caused by prelink, adjusting expectations
 # In such case both disk libraries will be loaded at VMAs starting at zero.
 
-require !skip_shlib_tests
-
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require !skip_shlib_tests can_spawn_for_attach
 
 # Library file.
 set libname "solib-overlap-lib"
diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp b/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
index ce9263ef37a..5b810985bf3 100644
--- a/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-hw-attach.exp
@@ -18,9 +18,7 @@
 
 require !skip_hw_watchpoint_tests
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
index 4b3c6d7a18e..a66efdb06c7 100644
--- a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
+++ b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
@@ -35,9 +35,7 @@ if [mi_gdb_start] {
     return
 }
 
-if ![can_spawn_for_attach] {
-    return
-}
+require can_spawn_for_attach
 
 set string_re {(?:[^\\"]|\\.)*}
 
diff --git a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp
index 4d6cd32f17e..dd98b718368 100644
--- a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp
+++ b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp
@@ -26,9 +26,7 @@ if { [skip_gdbserver_tests] } {
     return 0
 }
 
-if {![can_spawn_for_attach]} {
-    return
-}
+require can_spawn_for_attach
 
 if {[build_executable "build" $testfile $srcfile {debug}] == -1} {
     return -1
diff --git a/gdb/testsuite/gdb.multi/multi-attach.exp b/gdb/testsuite/gdb.multi/multi-attach.exp
index f4fe8773f64..e4c243fe322 100644
--- a/gdb/testsuite/gdb.multi/multi-attach.exp
+++ b/gdb/testsuite/gdb.multi/multi-attach.exp
@@ -19,9 +19,7 @@
 
 standard_testfile
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}]} {
     return -1
diff --git a/gdb/testsuite/gdb.multi/multi-term-settings.exp b/gdb/testsuite/gdb.multi/multi-term-settings.exp
index 9e4183c7317..42876920387 100644
--- a/gdb/testsuite/gdb.multi/multi-term-settings.exp
+++ b/gdb/testsuite/gdb.multi/multi-term-settings.exp
@@ -25,9 +25,7 @@
 
 standard_testfile
 
-if ![can_spawn_for_attach] {
-    return 0
-}
+require can_spawn_for_attach
 
 if [build_executable "failed to prepare" $testfile $srcfile {debug}] {
     return -1
diff --git a/gdb/testsuite/gdb.python/py-sync-interp.exp b/gdb/testsuite/gdb.python/py-sync-interp.exp
index f8f5907790c..8aa64e358fb 100644
--- a/gdb/testsuite/gdb.python/py-sync-interp.exp
+++ b/gdb/testsuite/gdb.python/py-sync-interp.exp
@@ -20,9 +20,7 @@
 
 standard_testfile
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 load_lib gdb-python.exp
 
diff --git a/gdb/testsuite/gdb.server/attach-flag.exp b/gdb/testsuite/gdb.server/attach-flag.exp
index 32676a4ee70..2e3456a7fcb 100644
--- a/gdb/testsuite/gdb.server/attach-flag.exp
+++ b/gdb/testsuite/gdb.server/attach-flag.exp
@@ -25,9 +25,7 @@ if { [skip_gdbserver_tests] } {
     return 0
 }
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 # Start the test program, attach to it using gdbserver's --attach flag, connect
 # to it with GDB, check that what we see makes sense.
diff --git a/gdb/testsuite/gdb.server/ext-attach.exp b/gdb/testsuite/gdb.server/ext-attach.exp
index a67a536809c..16e4abe083f 100644
--- a/gdb/testsuite/gdb.server/ext-attach.exp
+++ b/gdb/testsuite/gdb.server/ext-attach.exp
@@ -26,9 +26,7 @@ if { [skip_gdbserver_tests] } {
     return 0
 }
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
     return -1
diff --git a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
index 3417bbb8e35..348d81b95f7 100644
--- a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
+++ b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
@@ -49,9 +49,7 @@ if {[bad_dejagnu]} {
     return 0
 }
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.threads/attach-non-stop.exp b/gdb/testsuite/gdb.threads/attach-non-stop.exp
index 5f851ddcb85..8ca0d829af9 100644
--- a/gdb/testsuite/gdb.threads/attach-non-stop.exp
+++ b/gdb/testsuite/gdb.threads/attach-non-stop.exp
@@ -19,9 +19,7 @@
 #  - maint target non-stop off/on
 #  - "attach" vs "attach &"
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.threads/clone-attach-detach.exp b/gdb/testsuite/gdb.threads/clone-attach-detach.exp
index ea35c15f0a0..a9e5affbd81 100644
--- a/gdb/testsuite/gdb.threads/clone-attach-detach.exp
+++ b/gdb/testsuite/gdb.threads/clone-attach-detach.exp
@@ -23,9 +23,7 @@ if ![istarget *-*-linux*] {
     return
 }
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.threads/detach-step-over.exp b/gdb/testsuite/gdb.threads/detach-step-over.exp
index 6c3a74fd16d..dbc35f2d265 100644
--- a/gdb/testsuite/gdb.threads/detach-step-over.exp
+++ b/gdb/testsuite/gdb.threads/detach-step-over.exp
@@ -48,9 +48,7 @@
 # a breakpoint, which has helped with exposing further corner case
 # bugs.
 
-if {![can_spawn_for_attach]} {
-    return 0
-}
+require can_spawn_for_attach
 
 standard_testfile
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 34/46] Use require isnative
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (32 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 33/46] Use require can_spawn_for_attach Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 35/46] Use require skip_gdbserver_tests Tom Tromey
                   ` (13 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require isnative".
---
 gdb/testsuite/gdb.arch/s390-multiarch.exp         | 3 ++-
 gdb/testsuite/gdb.base/argv0-symlink.exp          | 5 +----
 gdb/testsuite/gdb.base/attach-pie-misread.exp     | 5 ++---
 gdb/testsuite/gdb.base/bigcore.exp                | 5 +----
 gdb/testsuite/gdb.base/break-interp.exp           | 5 ++---
 gdb/testsuite/gdb.base/corefile.exp               | 4 +---
 gdb/testsuite/gdb.base/corefile2.exp              | 4 +---
 gdb/testsuite/gdb.base/jit-reader.exp             | 6 +-----
 gdb/testsuite/gdb.base/prelink.exp                | 3 ++-
 gdb/testsuite/gdb.base/skip-solib.exp             | 4 ++--
 gdb/testsuite/gdb.mi/mi-async.exp                 | 3 ++-
 gdb/testsuite/gdb.mi/mi-corefile.exp              | 4 +---
 gdb/testsuite/gdb.threads/attach-into-signal.exp  | 4 ++--
 gdb/testsuite/gdb.threads/attach-slow-waitpid.exp | 4 ++--
 gdb/testsuite/gdb.threads/attach-stopped.exp      | 4 ++--
 gdb/testsuite/gdb.threads/corethreads.exp         | 3 ++-
 16 files changed, 26 insertions(+), 40 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/s390-multiarch.exp b/gdb/testsuite/gdb.arch/s390-multiarch.exp
index 71cb53a5db9..1d98d887c1f 100644
--- a/gdb/testsuite/gdb.arch/s390-multiarch.exp
+++ b/gdb/testsuite/gdb.arch/s390-multiarch.exp
@@ -23,7 +23,8 @@
 # running native.  It should be executed on a sufficiently new Linux
 # kernel that provides the 'system_call' regset.
 
-if { ![isnative] || ![istarget s390x-*-* ] } {
+require isnative
+if { ![istarget s390x-*-* ] } {
     verbose "Skipping s390 multi-arch tests."
     return
 }
diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp
index 0838b07c246..8247505392c 100644
--- a/gdb/testsuite/gdb.base/argv0-symlink.exp
+++ b/gdb/testsuite/gdb.base/argv0-symlink.exp
@@ -20,10 +20,7 @@
 # Therefore, it can't work reliably on anything other than configurations 
 # where build/host/target are all the same.
 
-if { ![isnative] } {
-    unsupported "argv0-symlink.exp not supported on non-native target"
-    return -1
-}
+require isnative
 
 if { [is_remote host] } {
     unsupported "argv0-symlink.exp not supported on remote host"
diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.exp b/gdb/testsuite/gdb.base/attach-pie-misread.exp
index 2049dd4bb88..d1614b38242 100644
--- a/gdb/testsuite/gdb.base/attach-pie-misread.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
@@ -14,9 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-require !use_gdb_stub
-if { ![isnative] || [is_remote host]
-     || ![istarget *-linux*] || [skip_shlib_tests]} {
+require !use_gdb_stub isnative
+if { [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/bigcore.exp b/gdb/testsuite/gdb.base/bigcore.exp
index 8acb716c9b5..8f32133deb7 100644
--- a/gdb/testsuite/gdb.base/bigcore.exp
+++ b/gdb/testsuite/gdb.base/bigcore.exp
@@ -20,10 +20,7 @@
 # Are we on a target board?  As of 2004-02-12, GDB didn't have a
 # mechanism that would let it efficiently access a remote corefile.
 
-if {![isnative]} {
-    untested "remote system"
-    return
-}
+require isnative
 
 # Can the system run this test (in particular support sparse
 # corefiles)?  On systems that lack sparse corefile support this test
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index 3ec47628256..f0923239195 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -14,9 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-require !use_gdb_stub
-if { ![isnative] || [is_remote host]
-     || ![istarget *-linux*] || [skip_shlib_tests]} {
+require !use_gdb_stub isnative
+if { [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
index f15e1e9e81d..283f5af6792 100644
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -17,9 +17,7 @@
 
 
 # are we on a target board
-if {![isnative]} {
-    return
-}
+require isnative
 
 standard_testfile coremaker.c
 
diff --git a/gdb/testsuite/gdb.base/corefile2.exp b/gdb/testsuite/gdb.base/corefile2.exp
index b08bd714ca9..353833a3570 100644
--- a/gdb/testsuite/gdb.base/corefile2.exp
+++ b/gdb/testsuite/gdb.base/corefile2.exp
@@ -18,9 +18,7 @@
 # coremaker2.c for details.
 
 # are we on a target board
-if {![isnative]} {
-    return
-}
+require isnative
 
 # Some of these tests will only work on GNU/Linux due to the
 # fact that Linux core files includes a section describing
diff --git a/gdb/testsuite/gdb.base/jit-reader.exp b/gdb/testsuite/gdb.base/jit-reader.exp
index bda31fef0a6..d13c1336132 100644
--- a/gdb/testsuite/gdb.base/jit-reader.exp
+++ b/gdb/testsuite/gdb.base/jit-reader.exp
@@ -22,11 +22,7 @@ if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) || ![is_lp64_target] } {
     return -1;
 }
 
-require !skip_shlib_tests
-
-if { ![isnative] } {
-    return -1
-}
+require !skip_shlib_tests isnative
 
 # Increase this to see more detail.
 set test_verbose 0
diff --git a/gdb/testsuite/gdb.base/prelink.exp b/gdb/testsuite/gdb.base/prelink.exp
index 8145a5b8a68..755f687607b 100644
--- a/gdb/testsuite/gdb.base/prelink.exp
+++ b/gdb/testsuite/gdb.base/prelink.exp
@@ -19,7 +19,8 @@
 # This file was written by Alexandre Oliva <aoliva@redhat.com>
 
 
-if { ![isnative] || [is_remote host] || [skip_shlib_tests]} {
+require isnative
+if { [is_remote host] || [skip_shlib_tests]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/skip-solib.exp b/gdb/testsuite/gdb.base/skip-solib.exp
index 49539bb6695..e1245e7b4b8 100644
--- a/gdb/testsuite/gdb.base/skip-solib.exp
+++ b/gdb/testsuite/gdb.base/skip-solib.exp
@@ -20,8 +20,8 @@
 #
 
 # This only works on GNU/Linux.
-if { ![isnative] || [is_remote host] || ![istarget *-linux*]
-     || [skip_shlib_tests]} {
+require isnative
+if { [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.mi/mi-async.exp b/gdb/testsuite/gdb.mi/mi-async.exp
index 5687c9ac335..da95225b209 100644
--- a/gdb/testsuite/gdb.mi/mi-async.exp
+++ b/gdb/testsuite/gdb.mi/mi-async.exp
@@ -21,7 +21,8 @@
 # mi_run_cmd, it ignores whatever target the rest of GDB testsuite is
 # using, and always tries to run natively.  So, don't do anything unless
 # we're actually testing native.
-if {!([isnative] && [istarget *-linux*])} {
+require isnative
+if {![istarget *-linux*]} {
   return
 }
 
diff --git a/gdb/testsuite/gdb.mi/mi-corefile.exp b/gdb/testsuite/gdb.mi/mi-corefile.exp
index 61aec326bcb..b3439234240 100644
--- a/gdb/testsuite/gdb.mi/mi-corefile.exp
+++ b/gdb/testsuite/gdb.mi/mi-corefile.exp
@@ -18,9 +18,7 @@
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
-if {![isnative]} {
-    return
-}
+require isnative
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.threads/attach-into-signal.exp b/gdb/testsuite/gdb.threads/attach-into-signal.exp
index c2b8ffebf65..75ddc680806 100644
--- a/gdb/testsuite/gdb.threads/attach-into-signal.exp
+++ b/gdb/testsuite/gdb.threads/attach-into-signal.exp
@@ -17,8 +17,8 @@
 # This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-require !use_gdb_stub
-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
+require !use_gdb_stub isnative
+if { [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp b/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
index aa9488af8a6..b11692ad601 100644
--- a/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
+++ b/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
@@ -37,8 +37,8 @@
 # during the attach phase.
 
 # This test only works on Linux
-require !use_gdb_stub
-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
+require !use_gdb_stub isnative
+if { [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp
index 320c304bb7a..ecdb234584e 100644
--- a/gdb/testsuite/gdb.threads/attach-stopped.exp
+++ b/gdb/testsuite/gdb.threads/attach-stopped.exp
@@ -18,8 +18,8 @@
 # This file was updated by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-require !use_gdb_stub
-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
+require !use_gdb_stub isnative
+if { [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/corethreads.exp b/gdb/testsuite/gdb.threads/corethreads.exp
index 7e10f557776..0108c7469c7 100644
--- a/gdb/testsuite/gdb.threads/corethreads.exp
+++ b/gdb/testsuite/gdb.threads/corethreads.exp
@@ -15,7 +15,8 @@
 
 # Are we on a target board?  And non-Linux targets seem to identify the thread
 # differently.
-if {![isnative] || ![istarget "*-*-linux*"]} {
+require isnative
+if {![istarget "*-*-linux*"]} {
     return
 }
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 35/46] Use require skip_gdbserver_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (33 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 34/46] Use require isnative Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 36/46] Use require skip_shlib_tests Tom Tromey
                   ` (12 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_gdbserver_tests".
---
 gdb/testsuite/gdb.btrace/reconnect.exp                     | 5 +----
 gdb/testsuite/gdb.mi/mi-file-transfer.exp                  | 4 +---
 gdb/testsuite/gdb.multi/attach-no-multi-process.exp        | 4 +---
 gdb/testsuite/gdb.python/py-send-packet.exp                | 4 +---
 gdb/testsuite/gdb.server/abspath.exp                       | 4 +---
 gdb/testsuite/gdb.server/attach-flag.exp                   | 4 +---
 gdb/testsuite/gdb.server/bkpt-other-inferior.exp           | 4 +---
 gdb/testsuite/gdb.server/connect-stopped-target.exp        | 4 +---
 gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp   | 4 +---
 gdb/testsuite/gdb.server/connect-without-multi-process.exp | 4 +---
 gdb/testsuite/gdb.server/exit-multiple-threads.exp         | 5 +----
 gdb/testsuite/gdb.server/ext-attach.exp                    | 4 +---
 gdb/testsuite/gdb.server/ext-restart.exp                   | 4 +---
 gdb/testsuite/gdb.server/ext-run.exp                       | 4 +---
 gdb/testsuite/gdb.server/ext-wrapper.exp                   | 4 +---
 gdb/testsuite/gdb.server/file-transfer.exp                 | 4 +---
 gdb/testsuite/gdb.server/monitor-exit-quit.exp             | 4 +---
 gdb/testsuite/gdb.server/multi-ui-errors.exp               | 4 +---
 gdb/testsuite/gdb.server/no-thread-db.exp                  | 4 +---
 gdb/testsuite/gdb.server/non-existing-program.exp          | 4 +---
 gdb/testsuite/gdb.server/reconnect-ctrl-c.exp              | 5 +----
 gdb/testsuite/gdb.server/run-without-local-binary.exp      | 4 +---
 gdb/testsuite/gdb.server/server-connect.exp                | 4 +---
 gdb/testsuite/gdb.server/server-kill-python.exp            | 4 +---
 gdb/testsuite/gdb.server/server-kill.exp                   | 4 +---
 gdb/testsuite/gdb.server/server-mon.exp                    | 4 +---
 gdb/testsuite/gdb.server/server-pipe.exp                   | 4 +---
 gdb/testsuite/gdb.server/server-run.exp                    | 4 +---
 gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp    | 5 +----
 gdb/testsuite/gdb.server/stop-reply-no-thread.exp          | 5 +----
 gdb/testsuite/gdb.server/sysroot.exp                       | 5 +----
 gdb/testsuite/gdb.server/twice-connect.exp                 | 4 +---
 gdb/testsuite/gdb.server/unittest.exp                      | 4 +---
 gdb/testsuite/gdb.server/wrapper.exp                       | 4 +---
 34 files changed, 34 insertions(+), 108 deletions(-)

diff --git a/gdb/testsuite/gdb.btrace/reconnect.exp b/gdb/testsuite/gdb.btrace/reconnect.exp
index 4b9e7d7c921..5d74c7997d3 100644
--- a/gdb/testsuite/gdb.btrace/reconnect.exp
+++ b/gdb/testsuite/gdb.btrace/reconnect.exp
@@ -20,10 +20,7 @@
 load_lib gdbserver-support.exp
 
 require !skip_btrace_tests
-if { [skip_gdbserver_tests] } {
-    unsupported "target does not support gdbserver"
-    return -1
-}
+require !skip_gdbserver_tests
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.mi/mi-file-transfer.exp b/gdb/testsuite/gdb.mi/mi-file-transfer.exp
index 5c5ea02a428..27a26542265 100644
--- a/gdb/testsuite/gdb.mi/mi-file-transfer.exp
+++ b/gdb/testsuite/gdb.mi/mi-file-transfer.exp
@@ -20,9 +20,7 @@ load_lib gdbserver-support.exp
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 standard_testfile basics.c
 
diff --git a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp
index dd98b718368..9bd21172a7a 100644
--- a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp
+++ b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp
@@ -22,9 +22,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 require can_spawn_for_attach
 
diff --git a/gdb/testsuite/gdb.python/py-send-packet.exp b/gdb/testsuite/gdb.python/py-send-packet.exp
index 5cb2f5a656c..f6c90dd5039 100644
--- a/gdb/testsuite/gdb.python/py-send-packet.exp
+++ b/gdb/testsuite/gdb.python/py-send-packet.exp
@@ -24,9 +24,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-if {[skip_gdbserver_tests]} {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
diff --git a/gdb/testsuite/gdb.server/abspath.exp b/gdb/testsuite/gdb.server/abspath.exp
index e0d0c2c00e0..15b9681ecc0 100644
--- a/gdb/testsuite/gdb.server/abspath.exp
+++ b/gdb/testsuite/gdb.server/abspath.exp
@@ -22,9 +22,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile normal.c
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 # Because we're relying on being able to change our CWD before
 # executing gdbserver, we just run if we're not testing with a remote
diff --git a/gdb/testsuite/gdb.server/attach-flag.exp b/gdb/testsuite/gdb.server/attach-flag.exp
index 2e3456a7fcb..e799dc4daf6 100644
--- a/gdb/testsuite/gdb.server/attach-flag.exp
+++ b/gdb/testsuite/gdb.server/attach-flag.exp
@@ -21,9 +21,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 require can_spawn_for_attach
 
diff --git a/gdb/testsuite/gdb.server/bkpt-other-inferior.exp b/gdb/testsuite/gdb.server/bkpt-other-inferior.exp
index 452c7c93db3..33b03e53ff2 100644
--- a/gdb/testsuite/gdb.server/bkpt-other-inferior.exp
+++ b/gdb/testsuite/gdb.server/bkpt-other-inferior.exp
@@ -21,9 +21,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile server.c
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if { [prepare_for_testing "failed to prepare" ${binfile} "${srcfile}" \
 	  {debug pthreads}] } {
diff --git a/gdb/testsuite/gdb.server/connect-stopped-target.exp b/gdb/testsuite/gdb.server/connect-stopped-target.exp
index d2cef37dbb3..35651ca9a9c 100644
--- a/gdb/testsuite/gdb.server/connect-stopped-target.exp
+++ b/gdb/testsuite/gdb.server/connect-stopped-target.exp
@@ -20,9 +20,7 @@
 load_lib gdbserver-support.exp
 load_lib prelink-support.exp
 
-if {[skip_gdbserver_tests]} {
-    return
-}
+require !skip_gdbserver_tests
 
 standard_testfile
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp b/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp
index 9b47f21106f..3c9dc80c989 100644
--- a/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp
+++ b/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp
@@ -25,9 +25,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if { [build_executable "failed to prepare" $testfile $srcfile debug] } {
     return -1
diff --git a/gdb/testsuite/gdb.server/connect-without-multi-process.exp b/gdb/testsuite/gdb.server/connect-without-multi-process.exp
index c4bbcac72fa..b05542c8a0f 100644
--- a/gdb/testsuite/gdb.server/connect-without-multi-process.exp
+++ b/gdb/testsuite/gdb.server/connect-without-multi-process.exp
@@ -18,9 +18,7 @@
 
 load_lib gdbserver-support.exp
 
-if {[skip_gdbserver_tests]} {
-    return
-}
+require !skip_gdbserver_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.server/exit-multiple-threads.exp b/gdb/testsuite/gdb.server/exit-multiple-threads.exp
index 23ac512ef70..a43263fa5ed 100644
--- a/gdb/testsuite/gdb.server/exit-multiple-threads.exp
+++ b/gdb/testsuite/gdb.server/exit-multiple-threads.exp
@@ -25,10 +25,7 @@
 
 load_lib gdbserver-support.exp
 
-if { [skip_gdbserver_tests] } {
-    verbose "skipping gdbserver tests"
-    return -1
-}
+require !skip_gdbserver_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.server/ext-attach.exp b/gdb/testsuite/gdb.server/ext-attach.exp
index 16e4abe083f..9e0045ad1fd 100644
--- a/gdb/testsuite/gdb.server/ext-attach.exp
+++ b/gdb/testsuite/gdb.server/ext-attach.exp
@@ -22,9 +22,7 @@ load_lib trace-support.exp
 
 standard_testfile
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 require can_spawn_for_attach
 
diff --git a/gdb/testsuite/gdb.server/ext-restart.exp b/gdb/testsuite/gdb.server/ext-restart.exp
index ac03caa0aaf..63e4b2fb954 100644
--- a/gdb/testsuite/gdb.server/ext-restart.exp
+++ b/gdb/testsuite/gdb.server/ext-restart.exp
@@ -21,9 +21,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile server.c
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 save_vars { GDBFLAGS } {
     # If GDB and GDBserver are both running locally, set the sysroot to avoid
diff --git a/gdb/testsuite/gdb.server/ext-run.exp b/gdb/testsuite/gdb.server/ext-run.exp
index cfc31e25be9..95cb135726f 100644
--- a/gdb/testsuite/gdb.server/ext-run.exp
+++ b/gdb/testsuite/gdb.server/ext-run.exp
@@ -21,9 +21,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile server.c
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
     return -1
diff --git a/gdb/testsuite/gdb.server/ext-wrapper.exp b/gdb/testsuite/gdb.server/ext-wrapper.exp
index 4c6cea4cd89..099538d48ca 100644
--- a/gdb/testsuite/gdb.server/ext-wrapper.exp
+++ b/gdb/testsuite/gdb.server/ext-wrapper.exp
@@ -19,9 +19,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile wrapper.c
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
     return -1
diff --git a/gdb/testsuite/gdb.server/file-transfer.exp b/gdb/testsuite/gdb.server/file-transfer.exp
index 310effd44b6..5d069c89502 100644
--- a/gdb/testsuite/gdb.server/file-transfer.exp
+++ b/gdb/testsuite/gdb.server/file-transfer.exp
@@ -20,9 +20,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile server.c
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
diff --git a/gdb/testsuite/gdb.server/monitor-exit-quit.exp b/gdb/testsuite/gdb.server/monitor-exit-quit.exp
index fdf24520989..59aa69823e8 100644
--- a/gdb/testsuite/gdb.server/monitor-exit-quit.exp
+++ b/gdb/testsuite/gdb.server/monitor-exit-quit.exp
@@ -21,9 +21,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile server.c
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
     return -1
diff --git a/gdb/testsuite/gdb.server/multi-ui-errors.exp b/gdb/testsuite/gdb.server/multi-ui-errors.exp
index 45a2dabbd6c..f56a58ca4c5 100644
--- a/gdb/testsuite/gdb.server/multi-ui-errors.exp
+++ b/gdb/testsuite/gdb.server/multi-ui-errors.exp
@@ -24,9 +24,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-if {[skip_gdbserver_tests]} {
-    return 0
-}
+require !skip_gdbserver_tests
 
 save_vars { GDBFLAGS } {
     # If GDB and GDBserver are both running locally, set the sysroot to avoid
diff --git a/gdb/testsuite/gdb.server/no-thread-db.exp b/gdb/testsuite/gdb.server/no-thread-db.exp
index 16c1a0d9ca1..8fe225966a4 100644
--- a/gdb/testsuite/gdb.server/no-thread-db.exp
+++ b/gdb/testsuite/gdb.server/no-thread-db.exp
@@ -25,9 +25,7 @@ load_lib gdbserver-support.exp
 standard_testfile
 set unresolvable_thread_db_path "/foo/bar"
 
-if {[skip_gdbserver_tests]} {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     return -1
diff --git a/gdb/testsuite/gdb.server/non-existing-program.exp b/gdb/testsuite/gdb.server/non-existing-program.exp
index e1226f11969..01d3b206c45 100644
--- a/gdb/testsuite/gdb.server/non-existing-program.exp
+++ b/gdb/testsuite/gdb.server/non-existing-program.exp
@@ -22,9 +22,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 set gdbserver [find_gdbserver]
 if { $gdbserver == "" } {
diff --git a/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp b/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp
index 70b4dbf4340..9d354b771ef 100644
--- a/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp
+++ b/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp
@@ -19,10 +19,7 @@
 
 load_lib gdbserver-support.exp
 
-if { [skip_gdbserver_tests] } {
-    verbose "skipping gdbserver tests"
-    return -1
-}
+require !skip_gdbserver_tests
 
 if [target_info exists gdb,nointerrupts] {
     verbose "Skipping reconnect-ctrl-c.exp because of nointerrupts."
diff --git a/gdb/testsuite/gdb.server/run-without-local-binary.exp b/gdb/testsuite/gdb.server/run-without-local-binary.exp
index fb4beca6c92..f0ac47921d3 100644
--- a/gdb/testsuite/gdb.server/run-without-local-binary.exp
+++ b/gdb/testsuite/gdb.server/run-without-local-binary.exp
@@ -15,9 +15,7 @@
 
 load_lib gdbserver-support.exp
 
-if {[skip_gdbserver_tests]} {
-    return
-}
+require !skip_gdbserver_tests
 
 standard_testfile normal.c
 
diff --git a/gdb/testsuite/gdb.server/server-connect.exp b/gdb/testsuite/gdb.server/server-connect.exp
index 806f034cc57..33df2b8a4d6 100644
--- a/gdb/testsuite/gdb.server/server-connect.exp
+++ b/gdb/testsuite/gdb.server/server-connect.exp
@@ -22,9 +22,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile normal.c
 
-if {[skip_gdbserver_tests]} {
-    return 0
-}
+require !skip_gdbserver_tests
 
 # We want to have control over where we start gdbserver.
 if { [is_remote target] } {
diff --git a/gdb/testsuite/gdb.server/server-kill-python.exp b/gdb/testsuite/gdb.server/server-kill-python.exp
index 9f7938c8390..ef21f3144a2 100644
--- a/gdb/testsuite/gdb.server/server-kill-python.exp
+++ b/gdb/testsuite/gdb.server/server-kill-python.exp
@@ -23,9 +23,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile multi-ui-errors.c
 
-if {[skip_gdbserver_tests]} {
-    return 0
-}
+require !skip_gdbserver_tests
 
 # Gdb needs to be running for skip_python_tests, but exit once we're done,
 # we'll start a custom gdb after this.
diff --git a/gdb/testsuite/gdb.server/server-kill.exp b/gdb/testsuite/gdb.server/server-kill.exp
index 93daf482907..509828c8e5b 100644
--- a/gdb/testsuite/gdb.server/server-kill.exp
+++ b/gdb/testsuite/gdb.server/server-kill.exp
@@ -22,9 +22,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-if {[skip_gdbserver_tests]} {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if { [build_executable "failed to prepare" ${testfile}] } {
     return -1
diff --git a/gdb/testsuite/gdb.server/server-mon.exp b/gdb/testsuite/gdb.server/server-mon.exp
index 0cec9ccb418..d993f6bd010 100644
--- a/gdb/testsuite/gdb.server/server-mon.exp
+++ b/gdb/testsuite/gdb.server/server-mon.exp
@@ -21,9 +21,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile server.c
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
diff --git a/gdb/testsuite/gdb.server/server-pipe.exp b/gdb/testsuite/gdb.server/server-pipe.exp
index 83537378aa6..833c05e6bba 100644
--- a/gdb/testsuite/gdb.server/server-pipe.exp
+++ b/gdb/testsuite/gdb.server/server-pipe.exp
@@ -32,9 +32,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 set gdbserver [find_gdbserver]
 if { $gdbserver == "" } {
diff --git a/gdb/testsuite/gdb.server/server-run.exp b/gdb/testsuite/gdb.server/server-run.exp
index 5e99cfd1fbd..a5523e619ab 100644
--- a/gdb/testsuite/gdb.server/server-run.exp
+++ b/gdb/testsuite/gdb.server/server-run.exp
@@ -21,9 +21,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile server.c
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
     return -1
diff --git a/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp
index 3bc7cbed52e..535717d0cf6 100644
--- a/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp
+++ b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp
@@ -30,10 +30,7 @@
 
 load_lib gdbserver-support.exp
 
-if { [skip_gdbserver_tests] } {
-    verbose "skipping gdbserver tests"
-    return -1
-}
+require !skip_gdbserver_tests
 
 standard_testfile
 if { [build_executable "failed to prepare" $testfile $srcfile {debug pthreads}] == -1 } {
diff --git a/gdb/testsuite/gdb.server/stop-reply-no-thread.exp b/gdb/testsuite/gdb.server/stop-reply-no-thread.exp
index 488a5859961..41b727b77d7 100644
--- a/gdb/testsuite/gdb.server/stop-reply-no-thread.exp
+++ b/gdb/testsuite/gdb.server/stop-reply-no-thread.exp
@@ -22,10 +22,7 @@
 
 load_lib gdbserver-support.exp
 
-if { [skip_gdbserver_tests] } {
-    verbose "skipping gdbserver tests"
-    return -1
-}
+require !skip_gdbserver_tests
 
 standard_testfile
 if { [build_executable "failed to prepare" $testfile $srcfile] == -1 } {
diff --git a/gdb/testsuite/gdb.server/sysroot.exp b/gdb/testsuite/gdb.server/sysroot.exp
index 95679fc0849..bda7f8aff4a 100644
--- a/gdb/testsuite/gdb.server/sysroot.exp
+++ b/gdb/testsuite/gdb.server/sysroot.exp
@@ -20,10 +20,7 @@
 
 load_lib gdbserver-support.exp
 
-if { [skip_gdbserver_tests] } {
-    verbose "skipping gdbserver tests"
-    return -1
-}
+require !skip_gdbserver_tests
 
 standard_testfile
 if {[build_executable "failed to prepare" $testfile $srcfile "additional_flags=--no-builtin"] == -1} {
diff --git a/gdb/testsuite/gdb.server/twice-connect.exp b/gdb/testsuite/gdb.server/twice-connect.exp
index c892a0f80a9..369b4510a0f 100644
--- a/gdb/testsuite/gdb.server/twice-connect.exp
+++ b/gdb/testsuite/gdb.server/twice-connect.exp
@@ -19,9 +19,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if { [build_executable "failed to prepare" $::testfile $::srcfile \
 	  {debug}] } {
diff --git a/gdb/testsuite/gdb.server/unittest.exp b/gdb/testsuite/gdb.server/unittest.exp
index d083ef25487..e5ca7b1db86 100644
--- a/gdb/testsuite/gdb.server/unittest.exp
+++ b/gdb/testsuite/gdb.server/unittest.exp
@@ -19,9 +19,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 global server_spawn_id
 
diff --git a/gdb/testsuite/gdb.server/wrapper.exp b/gdb/testsuite/gdb.server/wrapper.exp
index fed33aa1731..80b32fc2a5e 100644
--- a/gdb/testsuite/gdb.server/wrapper.exp
+++ b/gdb/testsuite/gdb.server/wrapper.exp
@@ -21,9 +21,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-if { [skip_gdbserver_tests] } {
-    return 0
-}
+require !skip_gdbserver_tests
 
 if { [istarget *-*-mingw*]
      || [istarget *-*-cygwin*] } {
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 36/46] Use require skip_shlib_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (34 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 35/46] Use require skip_gdbserver_tests Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 37/46] Use require is_c_compiler_gcc Tom Tromey
                   ` (11 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_shlib_tests".  This patch
cleans up a few spots that were missed in the earlier patch.
---
 gdb/testsuite/gdb.base/attach-pie-misread.exp | 4 ++--
 gdb/testsuite/gdb.base/break-interp.exp       | 4 ++--
 gdb/testsuite/gdb.base/info-fun.exp           | 3 ++-
 gdb/testsuite/gdb.base/prelink.exp            | 4 ++--
 gdb/testsuite/gdb.base/skip-solib.exp         | 4 ++--
 gdb/testsuite/gdb.base/solib-search.exp       | 3 ++-
 6 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.exp b/gdb/testsuite/gdb.base/attach-pie-misread.exp
index d1614b38242..d1b2d781dae 100644
--- a/gdb/testsuite/gdb.base/attach-pie-misread.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
@@ -14,8 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-require !use_gdb_stub isnative
-if { [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
+require !use_gdb_stub isnative !skip_shlib_tests
+if { [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index f0923239195..39e49f9be7e 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -14,8 +14,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-require !use_gdb_stub isnative
-if { [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
+require !use_gdb_stub isnative !skip_shlib_tests
+if { [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/info-fun.exp b/gdb/testsuite/gdb.base/info-fun.exp
index f2ebd6f19b7..32e1ea52943 100644
--- a/gdb/testsuite/gdb.base/info-fun.exp
+++ b/gdb/testsuite/gdb.base/info-fun.exp
@@ -12,7 +12,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_shlib_tests] || [is_remote target] } {
+require !skip_shlib_tests
+if { [is_remote target] } {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/prelink.exp b/gdb/testsuite/gdb.base/prelink.exp
index 755f687607b..2b2b10c1c0d 100644
--- a/gdb/testsuite/gdb.base/prelink.exp
+++ b/gdb/testsuite/gdb.base/prelink.exp
@@ -19,8 +19,8 @@
 # This file was written by Alexandre Oliva <aoliva@redhat.com>
 
 
-require isnative
-if { [is_remote host] || [skip_shlib_tests]} {
+require isnative !skip_shlib_tests
+if { [is_remote host] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/skip-solib.exp b/gdb/testsuite/gdb.base/skip-solib.exp
index e1245e7b4b8..a056018ce04 100644
--- a/gdb/testsuite/gdb.base/skip-solib.exp
+++ b/gdb/testsuite/gdb.base/skip-solib.exp
@@ -20,8 +20,8 @@
 #
 
 # This only works on GNU/Linux.
-require isnative
-if { [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
+require isnative !skip_shlib_tests
+if { [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/solib-search.exp b/gdb/testsuite/gdb.base/solib-search.exp
index ab4f2c45072..abfcfbfc803 100644
--- a/gdb/testsuite/gdb.base/solib-search.exp
+++ b/gdb/testsuite/gdb.base/solib-search.exp
@@ -16,7 +16,8 @@
 # Test solib-search-path, and in the case of solib-svr4.c whether l_addr_p
 # is properly reset when the path is changed.
 
-if {[is_remote target] || [skip_shlib_tests]} {
+require !skip_shlib_tests
+if {[is_remote target]} {
     untested "skipping remote target and shared library tests"
     return -1
 }
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 37/46] Use require is_c_compiler_gcc
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (35 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 36/46] Use require skip_shlib_tests Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 38/46] Use require gdb_debug_enabled Tom Tromey
                   ` (10 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require is_c_compiler_gcc".
---
 gdb/testsuite/gdb.base/morestack.exp                       | 5 +----
 gdb/testsuite/gdb.base/prelink.exp                         | 7 +------
 gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp      | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp        | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp         | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp           | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp                 | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp                   | 4 +---
 gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp          | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp       | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp   | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp               | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp               | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp            | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp               | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-ranges.exp                    | 5 +----
 .../gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp        | 5 +----
 gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp    | 5 +----
 21 files changed, 21 insertions(+), 77 deletions(-)

diff --git a/gdb/testsuite/gdb.base/morestack.exp b/gdb/testsuite/gdb.base/morestack.exp
index 31f7d1a72d0..4c17f819a14 100644
--- a/gdb/testsuite/gdb.base/morestack.exp
+++ b/gdb/testsuite/gdb.base/morestack.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {![is_c_compiler_gcc]} {
-    unsupported "gcc compiler is required"
-    return
-}
+require is_c_compiler_gcc
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/prelink.exp b/gdb/testsuite/gdb.base/prelink.exp
index 2b2b10c1c0d..43389c1a587 100644
--- a/gdb/testsuite/gdb.base/prelink.exp
+++ b/gdb/testsuite/gdb.base/prelink.exp
@@ -19,16 +19,11 @@
 # This file was written by Alexandre Oliva <aoliva@redhat.com>
 
 
-require isnative !skip_shlib_tests
+require isnative !skip_shlib_tests is_c_compiler_gcc
 if { [is_remote host] } {
     return
 }
 
-if {![is_c_compiler_gcc]} {
-    unsupported "gcc compiler is required"
-    return -1
-}
-
 load_lib prelink-support.exp
 
 set testfile "prelink"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp b/gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp
index 14b72898015..44849cbae82 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-disasm-over-non-stmt.exp
@@ -28,9 +28,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    return 0
-}
+require is_c_compiler_gcc
 
 # Reuse many of the test source files from dw2-inline-header-1.exp.
 standard_testfile dw2-inline-header-lbls.c dw2-inline-header.S \
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
index aa7807e2427..b116ffe7a3a 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
@@ -56,9 +56,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    return 0
-}
+require is_c_compiler_gcc
 
 # Prepare and run the test.
 proc do_test { start_label func_name tag } {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
index 537d61dc88d..7211b4838b0 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
@@ -51,9 +51,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile dw2-inline-header-lbls.c dw2-inline-header.S \
     dw2-inline-header.c dw2-inline-header.h
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
index 96596d1f5f5..bca98226f05 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
@@ -40,9 +40,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile dw2-inline-header-lbls.c dw2-inline-header.S \
     dw2-inline-header.c dw2-inline-header.h
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp
index f77236a6b40..0ae2a7fed18 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp
@@ -29,9 +29,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
index 40f4233b5bc..8f6ae870822 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
@@ -30,9 +30,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile -lbls.c .S \
     .c .h
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp
index 65bc1fe23dc..1121282878f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp
@@ -29,9 +29,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp
index f8d3c1f68a6..97f52cb2255 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp
@@ -29,9 +29,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
index 4d269a2d0f4..92ffc123ac1 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
@@ -29,9 +29,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile .c .S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
index 26d6998d34d..19a2cda298d 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
@@ -18,10 +18,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp b/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp
index 0e4432845d9..9f12a21fe99 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-main-no-line-number.exp
@@ -22,10 +22,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp b/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
index d03f6716d18..2b846c60817 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
@@ -22,10 +22,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile main.c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
index dec7d6a9b37..31384e0cd21 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
@@ -21,10 +21,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp
index 07ac5a9e52d..610ae7d1f0e 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp
@@ -19,10 +19,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
-if ![is_c_compiler_gcc] {
-    unsupported "gcc required for this test"
-    return 0
-}
+require is_c_compiler_gcc
 
 proc do_test {suffix} {
     global gdb_test_file_name
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp
index b528c3d73ce..afecc32fd0c 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-overlap.exp
@@ -25,10 +25,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
index 770d2977a43..b1148d45dcb 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
@@ -20,10 +20,7 @@ load_lib dwarf.exp
 # This test can only be run on targets which support DWARF-2 and use gas.
 require dwarf2_support
 
-if ![is_c_compiler_gcc] {
-    unsupported "gcc required for this test"
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile main.c .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
index d80d604edff..4df4d98b7b2 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
@@ -21,10 +21,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    verbose "Skipping $gdb_test_file_name."
-    return 0  
-}
+require is_c_compiler_gcc
 
 standard_testfile .c -2.c -3.c
 set asmfile [standard_output_file ${testfile}.s]
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp b/gdb/testsuite/gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp
index cf9c77741a2..ad667df86ee 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp
@@ -31,10 +31,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile .c -dw.S
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
index 035d4902ab4..d8da6accb77 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
@@ -18,10 +18,7 @@ load_lib dwarf.exp
 require dwarf2_support
 
 # The .c files use __attribute__.
-if ![is_c_compiler_gcc] {
-    verbose "Skipping $gdb_test_file_name."
-    return 0
-}
+require is_c_compiler_gcc
 
 standard_testfile .c -dw.S
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 38/46] Use require gdb_debug_enabled
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (36 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 37/46] Use require is_c_compiler_gcc Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 39/46] Use require gdb_skip_xml_test Tom Tromey
                   ` (9 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require gdb_debug_enabled".
---
 gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp           | 5 +----
 gdb/testsuite/gdb.base/debug-expr.exp                        | 5 +----
 gdb/testsuite/gdb.base/foll-fork.exp                         | 5 +----
 gdb/testsuite/gdb.base/fork-print-inferior-events.exp        | 5 +----
 gdb/testsuite/gdb.base/gdb-sigterm.exp                       | 5 +----
 gdb/testsuite/gdb.base/gdbinit-history.exp                   | 5 +----
 gdb/testsuite/gdb.base/osabi.exp                             | 5 +----
 gdb/testsuite/gdb.base/page-logging.exp                      | 5 +----
 gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp               | 5 +----
 gdb/testsuite/gdb.base/style-logging.exp                     | 5 +----
 gdb/testsuite/gdb.base/ui-redirect.exp                       | 5 +----
 gdb/testsuite/gdb.fortran/debug-expr.exp                     | 5 +----
 gdb/testsuite/gdb.gdb/unittest.exp                           | 5 +----
 gdb/testsuite/gdb.mi/new-ui-mi-sync.exp                      | 5 +----
 gdb/testsuite/gdb.mi/user-selected-context-sync.exp          | 5 +----
 gdb/testsuite/gdb.threads/check-libthread-db.exp             | 5 +----
 .../signal-while-stepping-over-bp-other-thread.exp           | 4 +---
 gdb/testsuite/gdb.threads/stepi-random-signal.exp            | 5 +----
 18 files changed, 18 insertions(+), 71 deletions(-)

diff --git a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
index a3b654be99a..2f47b940270 100644
--- a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
+++ b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
@@ -17,10 +17,7 @@
 
 # Test relies on checking gdb debug output. Do not run if gdb debug is
 # enabled as any debug will be redirected to the log.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/debug-expr.exp b/gdb/testsuite/gdb.base/debug-expr.exp
index f0aea197ed2..c47b6619b8a 100644
--- a/gdb/testsuite/gdb.base/debug-expr.exp
+++ b/gdb/testsuite/gdb.base/debug-expr.exp
@@ -17,10 +17,7 @@
 
 # Test relies on checking gdb debug output. Do not run if gdb debug is
 # enabled as any debug will be redirected to the log.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 standard_testfile .c
 
diff --git a/gdb/testsuite/gdb.base/foll-fork.exp b/gdb/testsuite/gdb.base/foll-fork.exp
index 0ab2290c82c..4c30a85eb8f 100644
--- a/gdb/testsuite/gdb.base/foll-fork.exp
+++ b/gdb/testsuite/gdb.base/foll-fork.exp
@@ -15,10 +15,7 @@
 
 # Test relies on checking follow-fork output. Do not run if gdb debug is
 # enabled as it will be redirected to the log.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
index 7fdd6d43809..b33f5333c89 100644
--- a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
+++ b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
@@ -24,10 +24,7 @@ require !use_gdb_stub
 
 # Test relies on checking follow-fork output. Do not run if gdb debug is
 # enabled as it will be redirected to the log.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/gdb-sigterm.exp b/gdb/testsuite/gdb.base/gdb-sigterm.exp
index dd3bb731ab2..b27322ae986 100644
--- a/gdb/testsuite/gdb.base/gdb-sigterm.exp
+++ b/gdb/testsuite/gdb.base/gdb-sigterm.exp
@@ -17,10 +17,7 @@
 
 # Test relies on checking gdb debug output. Do not run if gdb debug is
 # enabled as any debug will be redirected to the log.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/gdbinit-history.exp b/gdb/testsuite/gdb.base/gdbinit-history.exp
index 408f090367c..ac971de3d01 100644
--- a/gdb/testsuite/gdb.base/gdbinit-history.exp
+++ b/gdb/testsuite/gdb.base/gdbinit-history.exp
@@ -22,10 +22,7 @@
 # local machine.
 
 # Do not run if gdb debug is enabled - it interferes with the command history.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 if { [is_remote host] } {
     unsupported "can't set environment variables on remote host"
diff --git a/gdb/testsuite/gdb.base/osabi.exp b/gdb/testsuite/gdb.base/osabi.exp
index 1ec7e922129..306e34de96e 100644
--- a/gdb/testsuite/gdb.base/osabi.exp
+++ b/gdb/testsuite/gdb.base/osabi.exp
@@ -17,10 +17,7 @@
 
 # Test relies on checking gdb debug output. Do not run if gdb debug is
 # enabled as any debug will be redirected to the log.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 # Test that choosing "set osabi none" really requests a gdbarch with no osabi.
 
diff --git a/gdb/testsuite/gdb.base/page-logging.exp b/gdb/testsuite/gdb.base/page-logging.exp
index ffc180aad4d..17f067415ac 100644
--- a/gdb/testsuite/gdb.base/page-logging.exp
+++ b/gdb/testsuite/gdb.base/page-logging.exp
@@ -14,10 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Do not run if gdb debug is enabled as it will interfere with log redirect.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 gdb_start
 
diff --git a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp
index a25c54b69ab..f3b904b905f 100644
--- a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp
+++ b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp
@@ -33,10 +33,7 @@
 
 # Test relies on checking gdb debug output. Do not run if gdb debug is
 # enabled as any debug will be redirected to the log.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.base/style-logging.exp b/gdb/testsuite/gdb.base/style-logging.exp
index 2564473bd81..6b218f98942 100644
--- a/gdb/testsuite/gdb.base/style-logging.exp
+++ b/gdb/testsuite/gdb.base/style-logging.exp
@@ -16,10 +16,7 @@
 # Test that logging does not style.
 
 # Do not run if gdb debug is enabled as it will interfere with log redirect.
-if {[gdb_debug_enabled]} {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 if {[is_remote host]} {
     untested "does not work on remote host"
diff --git a/gdb/testsuite/gdb.base/ui-redirect.exp b/gdb/testsuite/gdb.base/ui-redirect.exp
index 4ed82ae63bf..6e93165979a 100644
--- a/gdb/testsuite/gdb.base/ui-redirect.exp
+++ b/gdb/testsuite/gdb.base/ui-redirect.exp
@@ -14,10 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Do not run if gdb debug is enabled as it will interfere with log redirect.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 if { [prepare_for_testing "failed to prepare" ui-redirect start.c] } {
     return -1
diff --git a/gdb/testsuite/gdb.fortran/debug-expr.exp b/gdb/testsuite/gdb.fortran/debug-expr.exp
index acc0aadc11e..400c5ae4dbd 100644
--- a/gdb/testsuite/gdb.fortran/debug-expr.exp
+++ b/gdb/testsuite/gdb.fortran/debug-expr.exp
@@ -19,10 +19,7 @@ require !skip_fortran_tests
 
 # Test relies on checking gdb debug output. Do not run if gdb debug is
 # enabled as any debug will be redirected to the log.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 standard_testfile .f90
 load_lib fortran.exp
diff --git a/gdb/testsuite/gdb.gdb/unittest.exp b/gdb/testsuite/gdb.gdb/unittest.exp
index fdae7a24632..ec4cd170abb 100644
--- a/gdb/testsuite/gdb.gdb/unittest.exp
+++ b/gdb/testsuite/gdb.gdb/unittest.exp
@@ -15,10 +15,7 @@
 
 # Do not run if gdb debug is enabled as maintenance output will be
 # redirected to the log files.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 load_lib completion-support.exp
 
diff --git a/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp b/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp
index ebb9c983a0f..d11d81c36e4 100644
--- a/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp
+++ b/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp
@@ -21,10 +21,7 @@
 # stops again.  See PR gdb/20418.
 
 # Do not run if gdb debug is enabled as it doesn't work for separate-mi-tty.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 load_lib mi-support.exp
 
diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
index 1ff35229741..dc89a4e1bcc 100644
--- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
+++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
@@ -30,10 +30,7 @@
 #   are using all-stop, or running, if we are using non-stop.
 
 # Do not run if gdb debug is enabled as it doesn't work for separate-mi-tty.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 load_lib mi-support.exp
 
diff --git a/gdb/testsuite/gdb.threads/check-libthread-db.exp b/gdb/testsuite/gdb.threads/check-libthread-db.exp
index 231c1d2596d..b2a6d975f83 100644
--- a/gdb/testsuite/gdb.threads/check-libthread-db.exp
+++ b/gdb/testsuite/gdb.threads/check-libthread-db.exp
@@ -20,10 +20,7 @@ if {[target_info gdb_protocol] != "" || ![istarget *-linux*]} {
 
 # Test relies on checking gdb debug output. Do not run if gdb debug is
 # enabled as any debug will be redirected to the log.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
index 2a9746a502e..cde98933fde 100644
--- a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
+++ b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
@@ -20,9 +20,7 @@
 
 # Test relies on checking gdb debug output. Do not run if gdb debug is
 # enabled as any debug will be redirected to the log.
-if [gdb_debug_enabled] {
-    return
-}
+require !gdb_debug_enabled
 
 standard_testfile
 set executable ${testfile}
diff --git a/gdb/testsuite/gdb.threads/stepi-random-signal.exp b/gdb/testsuite/gdb.threads/stepi-random-signal.exp
index cc0564db04e..f71bc10396a 100644
--- a/gdb/testsuite/gdb.threads/stepi-random-signal.exp
+++ b/gdb/testsuite/gdb.threads/stepi-random-signal.exp
@@ -15,10 +15,7 @@
 
 # Test relies on checking gdb debug output. Do not run if gdb debug is
 # enabled as any debug will be redirected to the log.
-if [gdb_debug_enabled] {
-    untested "debug is enabled"
-    return 0
-}
+require !gdb_debug_enabled
 
 standard_testfile
 set executable ${testfile}
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 39/46] Use require gdb_skip_xml_test
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (37 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 38/46] Use require gdb_debug_enabled Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 40/46] Use require gdb_trace_common_supports_arch Tom Tromey
                   ` (8 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require gdb_skip_xml_test".
---
 gdb/testsuite/gdb.arch/arc-tdesc-cpu.exp              | 5 +----
 gdb/testsuite/gdb.base/info-os.exp                    | 5 +----
 gdb/testsuite/gdb.mi/list-thread-groups-available.exp | 5 +----
 gdb/testsuite/gdb.mi/mi-info-os.exp                   | 5 +----
 gdb/testsuite/gdb.xml/maint-xml-dump.exp              | 5 +----
 gdb/testsuite/gdb.xml/maint_print_struct.exp          | 5 +----
 gdb/testsuite/gdb.xml/tdesc-arch.exp                  | 5 +----
 gdb/testsuite/gdb.xml/tdesc-errors.exp                | 5 +----
 gdb/testsuite/gdb.xml/tdesc-regs.exp                  | 5 +----
 gdb/testsuite/gdb.xml/tdesc-reload.exp                | 5 +----
 gdb/testsuite/gdb.xml/tdesc-xinclude.exp              | 5 +----
 11 files changed, 11 insertions(+), 44 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/arc-tdesc-cpu.exp b/gdb/testsuite/gdb.arch/arc-tdesc-cpu.exp
index 2d7a0373fa4..5cb8bdfde7e 100644
--- a/gdb/testsuite/gdb.arch/arc-tdesc-cpu.exp
+++ b/gdb/testsuite/gdb.arch/arc-tdesc-cpu.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[gdb_skip_xml_test]} {
-    unsupported "arc-tdesc-cpu.exp"
-    return -1
-}
+require !gdb_skip_xml_test
 
 gdb_start
 
diff --git a/gdb/testsuite/gdb.base/info-os.exp b/gdb/testsuite/gdb.base/info-os.exp
index f4eb42fcb8b..b607c0225f7 100644
--- a/gdb/testsuite/gdb.base/info-os.exp
+++ b/gdb/testsuite/gdb.base/info-os.exp
@@ -22,10 +22,7 @@ if {![istarget *-*-linux*]} {
 }
 
 # Support for XML-output is needed to run this test.
-if {[gdb_skip_xml_test]} {
-    unsupported "info-os.exp"
-    return -1
-}
+require !gdb_skip_xml_test
 
 # Compile test program.
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] } {
diff --git a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
index a66efdb06c7..c421f7025da 100644
--- a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
+++ b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
@@ -21,10 +21,7 @@ set MIFLAGS "-i=mi"
 standard_testfile
 
 # Support for XML is needed to run this test.
-if {[gdb_skip_xml_test]} {
-    unsupported "list-thread-groups-available.exp"
-    return -1
-}
+require !gdb_skip_xml_test
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     untested "failed to compile"
diff --git a/gdb/testsuite/gdb.mi/mi-info-os.exp b/gdb/testsuite/gdb.mi/mi-info-os.exp
index fde70bb1ea8..adfcb72177a 100644
--- a/gdb/testsuite/gdb.mi/mi-info-os.exp
+++ b/gdb/testsuite/gdb.mi/mi-info-os.exp
@@ -23,10 +23,7 @@ if {![istarget *-*-linux*]} {
 }
 
 # Support for XML-output is needed to run this test.
-if {[gdb_skip_xml_test]} {
-    unsupported "mi-info-os.exp"
-    return -1
-}
+require !gdb_skip_xml_test
 
 gdb_exit
 if [mi_gdb_start] {
diff --git a/gdb/testsuite/gdb.xml/maint-xml-dump.exp b/gdb/testsuite/gdb.xml/maint-xml-dump.exp
index e7a92c8a1d2..dc0d29db176 100644
--- a/gdb/testsuite/gdb.xml/maint-xml-dump.exp
+++ b/gdb/testsuite/gdb.xml/maint-xml-dump.exp
@@ -37,10 +37,7 @@
 #
 # 4. Indentation of lines will be preserved so your input file needs
 #    to follow the expected indentation.
-if {[gdb_skip_xml_test]} {
-    unsupported "xml tests not being run"
-    return -1
-}
+require !gdb_skip_xml_test
 
 gdb_start
 
diff --git a/gdb/testsuite/gdb.xml/maint_print_struct.exp b/gdb/testsuite/gdb.xml/maint_print_struct.exp
index 70ea6e1dca0..6d9d7bec850 100644
--- a/gdb/testsuite/gdb.xml/maint_print_struct.exp
+++ b/gdb/testsuite/gdb.xml/maint_print_struct.exp
@@ -17,10 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[gdb_skip_xml_test]} {
-    unsupported "maint_print_struct.exp"
-    return -1
-}
+require !gdb_skip_xml_test
 
 gdb_start
 
diff --git a/gdb/testsuite/gdb.xml/tdesc-arch.exp b/gdb/testsuite/gdb.xml/tdesc-arch.exp
index 26a43cc54ff..881826239db 100644
--- a/gdb/testsuite/gdb.xml/tdesc-arch.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-arch.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[gdb_skip_xml_test]} {
-    unsupported "tdesc-arch.exp"
-    return -1
-}
+require !gdb_skip_xml_test
 
 gdb_start
 
diff --git a/gdb/testsuite/gdb.xml/tdesc-errors.exp b/gdb/testsuite/gdb.xml/tdesc-errors.exp
index 71aeefdc721..e08b21cb853 100644
--- a/gdb/testsuite/gdb.xml/tdesc-errors.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-errors.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[gdb_skip_xml_test]} {
-    unsupported "tdesc-errors.exp"
-    return -1
-}
+require !gdb_skip_xml_test
 
 gdb_start
 
diff --git a/gdb/testsuite/gdb.xml/tdesc-regs.exp b/gdb/testsuite/gdb.xml/tdesc-regs.exp
index cbd5c77ab96..d58a4a3b5b0 100644
--- a/gdb/testsuite/gdb.xml/tdesc-regs.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-regs.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[gdb_skip_xml_test]} {
-    unsupported "tdesc-regs.exp"
-    return -1
-}
+require !gdb_skip_xml_test
 
 gdb_start
 
diff --git a/gdb/testsuite/gdb.xml/tdesc-reload.exp b/gdb/testsuite/gdb.xml/tdesc-reload.exp
index 5c3f702ea18..d68b25493ce 100644
--- a/gdb/testsuite/gdb.xml/tdesc-reload.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-reload.exp
@@ -16,10 +16,7 @@
 # Testing for 'maint print xml-tdesc'.  Check we can print out the
 # current target description and load it back in again.
 
-if {[gdb_skip_xml_test]} {
-    unsupported "xml tests not being run"
-    return -1
-}
+require !gdb_skip_xml_test
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.xml/tdesc-xinclude.exp b/gdb/testsuite/gdb.xml/tdesc-xinclude.exp
index 586e3594339..b001b324e29 100644
--- a/gdb/testsuite/gdb.xml/tdesc-xinclude.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-xinclude.exp
@@ -13,10 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {[gdb_skip_xml_test]} {
-    unsupported "tdesc-errors.exp"
-    return -1
-}
+require !gdb_skip_xml_test
 
 gdb_start
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 40/46] Use require gdb_trace_common_supports_arch
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (38 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 39/46] Use require gdb_skip_xml_test Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 41/46] Use require skip_perf_tests Tom Tromey
                   ` (7 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require gdb_trace_common_supports_arch".
---
 gdb/testsuite/gdb.trace/actions-changed.exp          | 5 +----
 gdb/testsuite/gdb.trace/actions.exp                  | 5 +----
 gdb/testsuite/gdb.trace/ax.exp                       | 5 +----
 gdb/testsuite/gdb.trace/backtrace.exp                | 5 +----
 gdb/testsuite/gdb.trace/change-loc.exp               | 5 +----
 gdb/testsuite/gdb.trace/deltrace.exp                 | 5 +----
 gdb/testsuite/gdb.trace/ftrace-lock.exp              | 5 +----
 gdb/testsuite/gdb.trace/ftrace.exp                   | 5 +----
 gdb/testsuite/gdb.trace/infotrace.exp                | 5 +----
 gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp | 5 +----
 gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp    | 5 +----
 gdb/testsuite/gdb.trace/mi-tsv-changed.exp           | 5 +----
 gdb/testsuite/gdb.trace/packetlen.exp                | 5 +----
 gdb/testsuite/gdb.trace/passc-dyn.exp                | 5 +----
 gdb/testsuite/gdb.trace/passcount.exp                | 5 +----
 gdb/testsuite/gdb.trace/pending.exp                  | 5 +----
 gdb/testsuite/gdb.trace/report.exp                   | 5 +----
 gdb/testsuite/gdb.trace/save-trace.exp               | 5 +----
 gdb/testsuite/gdb.trace/tfind.exp                    | 5 +----
 gdb/testsuite/gdb.trace/trace-break.exp              | 5 +----
 gdb/testsuite/gdb.trace/trace-condition.exp          | 5 +----
 gdb/testsuite/gdb.trace/trace-enable-disable.exp     | 5 +----
 gdb/testsuite/gdb.trace/trace-mt.exp                 | 5 +----
 gdb/testsuite/gdb.trace/tracecmd.exp                 | 5 +----
 gdb/testsuite/gdb.trace/tstatus.exp                  | 5 +----
 gdb/testsuite/gdb.trace/tsv.exp                      | 5 +----
 gdb/testsuite/gdb.trace/while-dyn.exp                | 5 +----
 gdb/testsuite/gdb.trace/while-stepping.exp           | 5 +----
 28 files changed, 28 insertions(+), 112 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/actions-changed.exp b/gdb/testsuite/gdb.trace/actions-changed.exp
index 7652ea4d0ff..db8355f7b73 100644
--- a/gdb/testsuite/gdb.trace/actions-changed.exp
+++ b/gdb/testsuite/gdb.trace/actions-changed.exp
@@ -17,10 +17,7 @@ load_lib trace-support.exp
 
 standard_testfile
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/actions.exp
index 397b30e484b..bd5172233f9 100644
--- a/gdb/testsuite/gdb.trace/actions.exp
+++ b/gdb/testsuite/gdb.trace/actions.exp
@@ -22,10 +22,7 @@ gdb_exit
 gdb_start
 
 standard_testfile
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
     untested "failed to compile"
diff --git a/gdb/testsuite/gdb.trace/ax.exp b/gdb/testsuite/gdb.trace/ax.exp
index 1f7f7bb786b..22f5a6950b6 100644
--- a/gdb/testsuite/gdb.trace/ax.exp
+++ b/gdb/testsuite/gdb.trace/ax.exp
@@ -25,10 +25,7 @@ gdb_exit
 gdb_start
 standard_testfile actions.c
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp
index 20f0a388afc..dbf0f3e9697 100644
--- a/gdb/testsuite/gdb.trace/backtrace.exp
+++ b/gdb/testsuite/gdb.trace/backtrace.exp
@@ -21,10 +21,7 @@ standard_testfile actions.c
 set executable $testfile
 set expfile $testfile.exp
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if [prepare_for_testing "failed to prepare" $executable $srcfile \
 	[list debug nowarnings nopie]] {
diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.trace/change-loc.exp
index 371fa7cca14..963b9a1033d 100644
--- a/gdb/testsuite/gdb.trace/change-loc.exp
+++ b/gdb/testsuite/gdb.trace/change-loc.exp
@@ -16,10 +16,7 @@ load_lib "trace-support.exp"
 
 require !skip_shlib_tests
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 standard_testfile
 set libfile1 "change-loc-1"
diff --git a/gdb/testsuite/gdb.trace/deltrace.exp b/gdb/testsuite/gdb.trace/deltrace.exp
index 605223aa3db..000b6912168 100644
--- a/gdb/testsuite/gdb.trace/deltrace.exp
+++ b/gdb/testsuite/gdb.trace/deltrace.exp
@@ -23,10 +23,7 @@ gdb_start
 
 standard_testfile actions.c
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
diff --git a/gdb/testsuite/gdb.trace/ftrace-lock.exp b/gdb/testsuite/gdb.trace/ftrace-lock.exp
index 48cbe21397d..c61b35d802e 100644
--- a/gdb/testsuite/gdb.trace/ftrace-lock.exp
+++ b/gdb/testsuite/gdb.trace/ftrace-lock.exp
@@ -31,10 +31,7 @@ set options [list debug [gdb_target_symbol_prefix_flags] \
 	     additional_flags=-DNUM_THREADS=$NUM_THREADS]
 
 # Check that the target supports trace.
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
     untested "failed to compile"
     return -1
diff --git a/gdb/testsuite/gdb.trace/ftrace.exp b/gdb/testsuite/gdb.trace/ftrace.exp
index 79fa6d3e924..dbda0a24442 100644
--- a/gdb/testsuite/gdb.trace/ftrace.exp
+++ b/gdb/testsuite/gdb.trace/ftrace.exp
@@ -23,10 +23,7 @@ set expfile $testfile.exp
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if [prepare_for_testing "failed to prepare" $executable $srcfile \
 	[list debug $additional_flags]] {
diff --git a/gdb/testsuite/gdb.trace/infotrace.exp b/gdb/testsuite/gdb.trace/infotrace.exp
index 912e29123d3..fd7c5255b4d 100644
--- a/gdb/testsuite/gdb.trace/infotrace.exp
+++ b/gdb/testsuite/gdb.trace/infotrace.exp
@@ -23,10 +23,7 @@ gdb_start
 
 standard_testfile actions.c
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
diff --git a/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp b/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp
index 23cc03c0068..b76ffebe3ba 100644
--- a/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp
+++ b/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp
@@ -17,10 +17,7 @@ load_lib trace-support.exp
 
 standard_testfile actions.c
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] } {
     return -1
diff --git a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
index f4b0b0ecead..08e125438c0 100644
--- a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
+++ b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
@@ -16,10 +16,7 @@
 load_lib trace-support.exp
 
 require !skip_shlib_tests
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 standard_testfile pending.c
 set libfile1 "pendshr1"
diff --git a/gdb/testsuite/gdb.trace/mi-tsv-changed.exp b/gdb/testsuite/gdb.trace/mi-tsv-changed.exp
index a2cfa70b8f3..26fc5faf1cb 100644
--- a/gdb/testsuite/gdb.trace/mi-tsv-changed.exp
+++ b/gdb/testsuite/gdb.trace/mi-tsv-changed.exp
@@ -18,10 +18,7 @@ load_lib mi-support.exp
 
 standard_testfile actions.c
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
diff --git a/gdb/testsuite/gdb.trace/packetlen.exp b/gdb/testsuite/gdb.trace/packetlen.exp
index 0330e82c1a0..2b186016d79 100644
--- a/gdb/testsuite/gdb.trace/packetlen.exp
+++ b/gdb/testsuite/gdb.trace/packetlen.exp
@@ -22,10 +22,7 @@ gdb_exit
 gdb_start
 
 standard_testfile actions.c
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
     untested "failed to compile"
diff --git a/gdb/testsuite/gdb.trace/passc-dyn.exp b/gdb/testsuite/gdb.trace/passc-dyn.exp
index 63f4788d07b..64618387f8a 100644
--- a/gdb/testsuite/gdb.trace/passc-dyn.exp
+++ b/gdb/testsuite/gdb.trace/passc-dyn.exp
@@ -21,10 +21,7 @@ load_lib "trace-support.exp"
 gdb_exit
 gdb_start
 standard_testfile actions.c
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
     untested "failed to compile"
diff --git a/gdb/testsuite/gdb.trace/passcount.exp b/gdb/testsuite/gdb.trace/passcount.exp
index bbb3be7d583..2cb899043cb 100644
--- a/gdb/testsuite/gdb.trace/passcount.exp
+++ b/gdb/testsuite/gdb.trace/passcount.exp
@@ -21,10 +21,7 @@ load_lib "trace-support.exp"
 gdb_exit
 gdb_start
 standard_testfile actions.c
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
     untested "failed to compile"
diff --git a/gdb/testsuite/gdb.trace/pending.exp b/gdb/testsuite/gdb.trace/pending.exp
index 4ef0e5b4df2..9a95eab4f87 100644
--- a/gdb/testsuite/gdb.trace/pending.exp
+++ b/gdb/testsuite/gdb.trace/pending.exp
@@ -16,10 +16,7 @@ load_lib "trace-support.exp"
 
 require !skip_shlib_tests
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 standard_testfile
 set libfile1 "pendshr1"
diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp
index 33e803bd4fe..f3983539543 100644
--- a/gdb/testsuite/gdb.trace/report.exp
+++ b/gdb/testsuite/gdb.trace/report.exp
@@ -22,10 +22,7 @@ gdb_exit
 gdb_start
 
 standard_testfile actions.c
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings nopie}] != "" } {
     untested "failed to compile"
diff --git a/gdb/testsuite/gdb.trace/save-trace.exp b/gdb/testsuite/gdb.trace/save-trace.exp
index ddeb20360aa..ba351d1c698 100644
--- a/gdb/testsuite/gdb.trace/save-trace.exp
+++ b/gdb/testsuite/gdb.trace/save-trace.exp
@@ -22,10 +22,7 @@ gdb_exit
 gdb_start
 
 standard_testfile actions.c
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
     untested "failed to compile"
diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tfind.exp
index 66b744fc11b..27418e79479 100644
--- a/gdb/testsuite/gdb.trace/tfind.exp
+++ b/gdb/testsuite/gdb.trace/tfind.exp
@@ -23,10 +23,7 @@ gdb_start
 
 standard_testfile actions.c
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if { [gdb_compile "$srcdir/$subdir/$srcfile" "$binfile" \
 	  executable {debug nowarnings nopie}] != "" } {
diff --git a/gdb/testsuite/gdb.trace/trace-break.exp b/gdb/testsuite/gdb.trace/trace-break.exp
index c3227494c45..39f9574aea4 100644
--- a/gdb/testsuite/gdb.trace/trace-break.exp
+++ b/gdb/testsuite/gdb.trace/trace-break.exp
@@ -21,10 +21,7 @@ set expfile $testfile.exp
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if [prepare_for_testing "failed to prepare" $executable $srcfile \
 	[list debug $additional_flags]] {
diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp
index 6b0e6f80746..6c8353f4892 100644
--- a/gdb/testsuite/gdb.trace/trace-condition.exp
+++ b/gdb/testsuite/gdb.trace/trace-condition.exp
@@ -23,10 +23,7 @@ set expfile $testfile.exp
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if [prepare_for_testing "failed to prepare" $executable $srcfile \
 	[list debug $additional_flags]] {
diff --git a/gdb/testsuite/gdb.trace/trace-enable-disable.exp b/gdb/testsuite/gdb.trace/trace-enable-disable.exp
index e477ad6152b..da7aad3a338 100644
--- a/gdb/testsuite/gdb.trace/trace-enable-disable.exp
+++ b/gdb/testsuite/gdb.trace/trace-enable-disable.exp
@@ -24,10 +24,7 @@ set expfile $testfile.exp
 set options [list debug [gdb_target_symbol_prefix_flags]]
 
 # Check that the target supports trace.
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
     untested "failed to compile"
     return -1
diff --git a/gdb/testsuite/gdb.trace/trace-mt.exp b/gdb/testsuite/gdb.trace/trace-mt.exp
index daf674a1c6d..a486f1e5556 100644
--- a/gdb/testsuite/gdb.trace/trace-mt.exp
+++ b/gdb/testsuite/gdb.trace/trace-mt.exp
@@ -21,10 +21,7 @@ set expfile $testfile.exp
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if { [gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile \
 	  executable [list debug $additional_flags] ] != "" } {
diff --git a/gdb/testsuite/gdb.trace/tracecmd.exp b/gdb/testsuite/gdb.trace/tracecmd.exp
index 4bc16b1d344..0a213b00df5 100644
--- a/gdb/testsuite/gdb.trace/tracecmd.exp
+++ b/gdb/testsuite/gdb.trace/tracecmd.exp
@@ -21,10 +21,7 @@ load_lib "trace-support.exp"
 gdb_exit
 gdb_start
 standard_testfile actions.c
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
     untested "failed to compile"
diff --git a/gdb/testsuite/gdb.trace/tstatus.exp b/gdb/testsuite/gdb.trace/tstatus.exp
index 4835efc4ef7..d5964b790f9 100644
--- a/gdb/testsuite/gdb.trace/tstatus.exp
+++ b/gdb/testsuite/gdb.trace/tstatus.exp
@@ -18,10 +18,7 @@ standard_testfile actions.c
 set executable $testfile
 set expfile tstatus.exp
 
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 
 if [prepare_for_testing "failed to prepare" $executable $srcfile \
 	[list debug]] {
diff --git a/gdb/testsuite/gdb.trace/tsv.exp b/gdb/testsuite/gdb.trace/tsv.exp
index e51e7d654b1..fcb332888cf 100644
--- a/gdb/testsuite/gdb.trace/tsv.exp
+++ b/gdb/testsuite/gdb.trace/tsv.exp
@@ -19,10 +19,7 @@ load_lib "trace-support.exp"
 gdb_exit
 gdb_start
 standard_testfile actions.c
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
     untested "failed to compile"
diff --git a/gdb/testsuite/gdb.trace/while-dyn.exp b/gdb/testsuite/gdb.trace/while-dyn.exp
index 0085e0aad48..7e64e8db991 100644
--- a/gdb/testsuite/gdb.trace/while-dyn.exp
+++ b/gdb/testsuite/gdb.trace/while-dyn.exp
@@ -23,10 +23,7 @@ gdb_start
 
 standard_testfile actions.c
 set executable $testfile
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable {debug nowarnings}] != "" } {
     untested "failed to compile"
diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb.trace/while-stepping.exp
index 3d1b29bab02..0e48506bae3 100644
--- a/gdb/testsuite/gdb.trace/while-stepping.exp
+++ b/gdb/testsuite/gdb.trace/while-stepping.exp
@@ -22,10 +22,7 @@ gdb_exit
 gdb_start
 
 standard_testfile actions.c
-if ![gdb_trace_common_supports_arch] {
-    unsupported "no trace-common.h support for arch"
-    return -1
-}
+require gdb_trace_common_supports_arch
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \
 	  executable {debug nowarnings}] != "" } {
     untested "failed to compile"
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 41/46] Use require skip_perf_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (39 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 40/46] Use require gdb_trace_common_supports_arch Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 42/46] Use require skip_opencl_tests Tom Tromey
                   ` (6 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_perf_tests".
---
 gdb/testsuite/gdb.perf/backtrace.exp                   | 4 +---
 gdb/testsuite/gdb.perf/disassemble.exp                 | 4 +---
 gdb/testsuite/gdb.perf/gmonster1-null-lookup.exp       | 4 +---
 gdb/testsuite/gdb.perf/gmonster1-pervasive-typedef.exp | 4 +---
 gdb/testsuite/gdb.perf/gmonster1-print-cerr.exp        | 4 +---
 gdb/testsuite/gdb.perf/gmonster1-ptype-string.exp      | 4 +---
 gdb/testsuite/gdb.perf/gmonster1-runto-main.exp        | 4 +---
 gdb/testsuite/gdb.perf/gmonster1-select-file.exp       | 4 +---
 gdb/testsuite/gdb.perf/gmonster1.exp                   | 4 +---
 gdb/testsuite/gdb.perf/gmonster2-null-lookup.exp       | 4 +---
 gdb/testsuite/gdb.perf/gmonster2-pervasive-typedef.exp | 4 +---
 gdb/testsuite/gdb.perf/gmonster2-print-cerr.exp        | 4 +---
 gdb/testsuite/gdb.perf/gmonster2-ptype-string.exp      | 4 +---
 gdb/testsuite/gdb.perf/gmonster2-runto-main.exp        | 4 +---
 gdb/testsuite/gdb.perf/gmonster2-select-file.exp       | 4 +---
 gdb/testsuite/gdb.perf/gmonster2.exp                   | 4 +---
 gdb/testsuite/gdb.perf/single-step.exp                 | 4 +---
 gdb/testsuite/gdb.perf/skip-command.exp                | 4 +---
 gdb/testsuite/gdb.perf/skip-prologue.exp               | 4 +---
 gdb/testsuite/gdb.perf/solib.exp                       | 4 +---
 gdb/testsuite/gdb.perf/template-breakpoints.exp        | 4 +---
 21 files changed, 21 insertions(+), 63 deletions(-)

diff --git a/gdb/testsuite/gdb.perf/backtrace.exp b/gdb/testsuite/gdb.perf/backtrace.exp
index a5a4428844c..524cf236080 100644
--- a/gdb/testsuite/gdb.perf/backtrace.exp
+++ b/gdb/testsuite/gdb.perf/backtrace.exp
@@ -21,9 +21,7 @@
 
 load_lib perftest.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 standard_testfile .c
 set executable $testfile
diff --git a/gdb/testsuite/gdb.perf/disassemble.exp b/gdb/testsuite/gdb.perf/disassemble.exp
index 9902b0dc225..8e12ca79e5c 100644
--- a/gdb/testsuite/gdb.perf/disassemble.exp
+++ b/gdb/testsuite/gdb.perf/disassemble.exp
@@ -17,9 +17,7 @@
 # some large functions in GDB.
 load_lib perftest.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 global GDB
 
diff --git a/gdb/testsuite/gdb.perf/gmonster1-null-lookup.exp b/gdb/testsuite/gdb.perf/gmonster1-null-lookup.exp
index b1ebf52c237..f4522f19af2 100644
--- a/gdb/testsuite/gdb.perf/gmonster1-null-lookup.exp
+++ b/gdb/testsuite/gdb.perf/gmonster1-null-lookup.exp
@@ -19,8 +19,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster1.exp make_testcase_config gmonster-null-lookup.py NullLookup
diff --git a/gdb/testsuite/gdb.perf/gmonster1-pervasive-typedef.exp b/gdb/testsuite/gdb.perf/gmonster1-pervasive-typedef.exp
index 52fcf46ba21..8aedccc1077 100644
--- a/gdb/testsuite/gdb.perf/gmonster1-pervasive-typedef.exp
+++ b/gdb/testsuite/gdb.perf/gmonster1-pervasive-typedef.exp
@@ -21,8 +21,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster1.exp make_testcase_config gmonster-pervasive-typedef.py PervasiveTypedef
diff --git a/gdb/testsuite/gdb.perf/gmonster1-print-cerr.exp b/gdb/testsuite/gdb.perf/gmonster1-print-cerr.exp
index f5444eea26f..0f7e7f9a6bb 100644
--- a/gdb/testsuite/gdb.perf/gmonster1-print-cerr.exp
+++ b/gdb/testsuite/gdb.perf/gmonster1-print-cerr.exp
@@ -19,8 +19,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster1.exp make_testcase_config gmonster-print-cerr.py PrintCerr
diff --git a/gdb/testsuite/gdb.perf/gmonster1-ptype-string.exp b/gdb/testsuite/gdb.perf/gmonster1-ptype-string.exp
index ae6f10eceae..5b01d013f89 100644
--- a/gdb/testsuite/gdb.perf/gmonster1-ptype-string.exp
+++ b/gdb/testsuite/gdb.perf/gmonster1-ptype-string.exp
@@ -19,8 +19,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster1.exp make_testcase_config gmonster-ptype-string.py GmonsterPtypeString
diff --git a/gdb/testsuite/gdb.perf/gmonster1-runto-main.exp b/gdb/testsuite/gdb.perf/gmonster1-runto-main.exp
index 4250d17392f..7a9def1c18f 100644
--- a/gdb/testsuite/gdb.perf/gmonster1-runto-main.exp
+++ b/gdb/testsuite/gdb.perf/gmonster1-runto-main.exp
@@ -19,8 +19,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster1.exp make_testcase_config gmonster-runto-main.py GmonsterRuntoMain
diff --git a/gdb/testsuite/gdb.perf/gmonster1-select-file.exp b/gdb/testsuite/gdb.perf/gmonster1-select-file.exp
index 35c4f8bdc1d..c639cc8649e 100644
--- a/gdb/testsuite/gdb.perf/gmonster1-select-file.exp
+++ b/gdb/testsuite/gdb.perf/gmonster1-select-file.exp
@@ -19,8 +19,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster1.exp make_testcase_config gmonster-select-file.py GmonsterSelectFile
diff --git a/gdb/testsuite/gdb.perf/gmonster1.exp b/gdb/testsuite/gdb.perf/gmonster1.exp
index 1b18a635259..d4d73024c84 100644
--- a/gdb/testsuite/gdb.perf/gmonster1.exp
+++ b/gdb/testsuite/gdb.perf/gmonster1.exp
@@ -36,9 +36,7 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 if ![info exists MONSTER] {
     set MONSTER "n"
diff --git a/gdb/testsuite/gdb.perf/gmonster2-null-lookup.exp b/gdb/testsuite/gdb.perf/gmonster2-null-lookup.exp
index e8b54b3e7aa..41724e13843 100644
--- a/gdb/testsuite/gdb.perf/gmonster2-null-lookup.exp
+++ b/gdb/testsuite/gdb.perf/gmonster2-null-lookup.exp
@@ -20,8 +20,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster2.exp make_testcase_config gmonster-null-lookup.py NullLookup
diff --git a/gdb/testsuite/gdb.perf/gmonster2-pervasive-typedef.exp b/gdb/testsuite/gdb.perf/gmonster2-pervasive-typedef.exp
index 1b36e612af7..1da2b7fdc32 100644
--- a/gdb/testsuite/gdb.perf/gmonster2-pervasive-typedef.exp
+++ b/gdb/testsuite/gdb.perf/gmonster2-pervasive-typedef.exp
@@ -21,8 +21,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster2.exp make_testcase_config gmonster-pervasive-typedef.py PervasiveTypedef
diff --git a/gdb/testsuite/gdb.perf/gmonster2-print-cerr.exp b/gdb/testsuite/gdb.perf/gmonster2-print-cerr.exp
index 52b5cfac949..bf635ef55e6 100644
--- a/gdb/testsuite/gdb.perf/gmonster2-print-cerr.exp
+++ b/gdb/testsuite/gdb.perf/gmonster2-print-cerr.exp
@@ -19,8 +19,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster2.exp make_testcase_config gmonster-print-cerr.py PrintCerr
diff --git a/gdb/testsuite/gdb.perf/gmonster2-ptype-string.exp b/gdb/testsuite/gdb.perf/gmonster2-ptype-string.exp
index b7543683d5b..957fcaa20ab 100644
--- a/gdb/testsuite/gdb.perf/gmonster2-ptype-string.exp
+++ b/gdb/testsuite/gdb.perf/gmonster2-ptype-string.exp
@@ -20,8 +20,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster2.exp make_testcase_config gmonster-ptype-string.py GmonsterPtypeString
diff --git a/gdb/testsuite/gdb.perf/gmonster2-runto-main.exp b/gdb/testsuite/gdb.perf/gmonster2-runto-main.exp
index 04867226623..db940e178e3 100644
--- a/gdb/testsuite/gdb.perf/gmonster2-runto-main.exp
+++ b/gdb/testsuite/gdb.perf/gmonster2-runto-main.exp
@@ -19,8 +19,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster2.exp make_testcase_config gmonster-runto-main.py GmonsterRuntoMain
diff --git a/gdb/testsuite/gdb.perf/gmonster2-select-file.exp b/gdb/testsuite/gdb.perf/gmonster2-select-file.exp
index 1d7eecf0186..8da84bee675 100644
--- a/gdb/testsuite/gdb.perf/gmonster2-select-file.exp
+++ b/gdb/testsuite/gdb.perf/gmonster2-select-file.exp
@@ -20,8 +20,6 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 GenPerfTest::standard_run_driver gmonster2.exp make_testcase_config gmonster-select-file.py GmonsterSelectFile
diff --git a/gdb/testsuite/gdb.perf/gmonster2.exp b/gdb/testsuite/gdb.perf/gmonster2.exp
index 60da23fb710..abbfdd7b3e2 100644
--- a/gdb/testsuite/gdb.perf/gmonster2.exp
+++ b/gdb/testsuite/gdb.perf/gmonster2.exp
@@ -36,9 +36,7 @@
 load_lib perftest.exp
 load_lib gen-perf-test.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 if ![info exists MONSTER] {
     set MONSTER "n"
diff --git a/gdb/testsuite/gdb.perf/single-step.exp b/gdb/testsuite/gdb.perf/single-step.exp
index 288c4b3050e..b6f936ed0be 100644
--- a/gdb/testsuite/gdb.perf/single-step.exp
+++ b/gdb/testsuite/gdb.perf/single-step.exp
@@ -19,9 +19,7 @@
 
 load_lib perftest.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 standard_testfile .c
 set executable $testfile
diff --git a/gdb/testsuite/gdb.perf/skip-command.exp b/gdb/testsuite/gdb.perf/skip-command.exp
index 447fbcb2972..d180158dc60 100644
--- a/gdb/testsuite/gdb.perf/skip-command.exp
+++ b/gdb/testsuite/gdb.perf/skip-command.exp
@@ -25,9 +25,7 @@
 
 load_lib perftest.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 standard_testfile .cc skip-funcs.cc
 set executable $testfile
diff --git a/gdb/testsuite/gdb.perf/skip-prologue.exp b/gdb/testsuite/gdb.perf/skip-prologue.exp
index 01ae6547806..80aa668d5a2 100644
--- a/gdb/testsuite/gdb.perf/skip-prologue.exp
+++ b/gdb/testsuite/gdb.perf/skip-prologue.exp
@@ -21,9 +21,7 @@
 
 load_lib perftest.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 standard_testfile .c
 set executable $testfile
diff --git a/gdb/testsuite/gdb.perf/solib.exp b/gdb/testsuite/gdb.perf/solib.exp
index 93cf7ebc159..4d926bd14b3 100644
--- a/gdb/testsuite/gdb.perf/solib.exp
+++ b/gdb/testsuite/gdb.perf/solib.exp
@@ -24,9 +24,7 @@
 
 load_lib perftest.exp
 
-if [skip_perf_tests] {
-    return 0
-}
+require !skip_perf_tests
 
 standard_testfile .c
 set executable $testfile
diff --git a/gdb/testsuite/gdb.perf/template-breakpoints.exp b/gdb/testsuite/gdb.perf/template-breakpoints.exp
index c80b0fc17c7..09aee12a869 100644
--- a/gdb/testsuite/gdb.perf/template-breakpoints.exp
+++ b/gdb/testsuite/gdb.perf/template-breakpoints.exp
@@ -21,9 +21,7 @@
 
 load_lib perftest.exp
 
-if [skip_perf_tests] {
-	return 0
-}
+require !skip_perf_tests
 
 standard_testfile .cc
 set executable $testfile
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 42/46] Use require skip_opencl_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (40 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 41/46] Use require skip_perf_tests Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 43/46] Use require target_can_use_run_cmd Tom Tromey
                   ` (5 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_opencl_tests".
---
 gdb/testsuite/gdb.opencl/callfuncs.exp   | 5 +----
 gdb/testsuite/gdb.opencl/convs_casts.exp | 5 +----
 gdb/testsuite/gdb.opencl/datatypes.exp   | 5 +----
 gdb/testsuite/gdb.opencl/operators.exp   | 5 +----
 gdb/testsuite/gdb.opencl/vec_comps.exp   | 5 +----
 5 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/gdb/testsuite/gdb.opencl/callfuncs.exp b/gdb/testsuite/gdb.opencl/callfuncs.exp
index 25fdee41b03..87f2d079342 100644
--- a/gdb/testsuite/gdb.opencl/callfuncs.exp
+++ b/gdb/testsuite/gdb.opencl/callfuncs.exp
@@ -19,10 +19,7 @@
 
 load_lib opencl.exp
 
-if { [skip_opencl_tests] } {
-    unsupported "OpenCL support not detected"
-    return 0
-}
+require !skip_opencl_tests
 
 set testfile "callfuncs"
 set clprogram [remote_download target ${srcdir}/${subdir}/${testfile}.cl]
diff --git a/gdb/testsuite/gdb.opencl/convs_casts.exp b/gdb/testsuite/gdb.opencl/convs_casts.exp
index efbd1fc4124..b17cf616ecd 100644
--- a/gdb/testsuite/gdb.opencl/convs_casts.exp
+++ b/gdb/testsuite/gdb.opencl/convs_casts.exp
@@ -19,10 +19,7 @@
 
 load_lib opencl.exp
 
-if { [skip_opencl_tests] } {
-    unsupported "OpenCL support not detected"
-    return 0
-}
+require !skip_opencl_tests
 
 set testfile "convs_casts"
 set clprogram [remote_download target ${srcdir}/${subdir}/${testfile}.cl]
diff --git a/gdb/testsuite/gdb.opencl/datatypes.exp b/gdb/testsuite/gdb.opencl/datatypes.exp
index 40e0c13702b..f7a3ca47170 100644
--- a/gdb/testsuite/gdb.opencl/datatypes.exp
+++ b/gdb/testsuite/gdb.opencl/datatypes.exp
@@ -19,10 +19,7 @@
 
 load_lib opencl.exp
 
-if { [skip_opencl_tests] } {
-    unsupported "OpenCL support not detected"
-    return 0
-}
+require !skip_opencl_tests
 
 set testfile "datatypes"
 set clprogram [remote_download target ${srcdir}/${subdir}/${testfile}.cl]
diff --git a/gdb/testsuite/gdb.opencl/operators.exp b/gdb/testsuite/gdb.opencl/operators.exp
index 415b513a952..5e804b4e99b 100644
--- a/gdb/testsuite/gdb.opencl/operators.exp
+++ b/gdb/testsuite/gdb.opencl/operators.exp
@@ -19,10 +19,7 @@
 
 load_lib opencl.exp
 
-if { [skip_opencl_tests] } {
-    unsupported "OpenCL support not detected"
-    return 0
-}
+require !skip_opencl_tests
 
 set testfile "operators"
 set clprogram [remote_download target ${srcdir}/${subdir}/${testfile}.cl]
diff --git a/gdb/testsuite/gdb.opencl/vec_comps.exp b/gdb/testsuite/gdb.opencl/vec_comps.exp
index ab0beea8188..2948532d7b8 100644
--- a/gdb/testsuite/gdb.opencl/vec_comps.exp
+++ b/gdb/testsuite/gdb.opencl/vec_comps.exp
@@ -19,10 +19,7 @@
 
 load_lib opencl.exp
 
-if { [skip_opencl_tests] } {
-    unsupported "OpenCL support not detected"
-    return 0
-}
+require !skip_opencl_tests
 
 set testfile "vec_comps"
 set clprogram [remote_download target ${srcdir}/${subdir}/${testfile}.cl]
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 43/46] Use require target_can_use_run_cmd
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (41 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 42/46] Use require skip_opencl_tests Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 44/46] Use require using_fission Tom Tromey
                   ` (4 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require target_can_use_run_cmd".
---
 gdb/testsuite/gdb.base/annota1.exp                    | 4 +---
 gdb/testsuite/gdb.base/annota3.exp                    | 4 +---
 gdb/testsuite/gdb.base/dprintf-execution-x-script.exp | 4 +---
 gdb/testsuite/gdb.cp/annota2.exp                      | 4 +---
 gdb/testsuite/gdb.cp/annota3.exp                      | 4 +---
 gdb/testsuite/gdb.multi/bkpt-multi-exec.exp           | 4 +---
 6 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index 675f3afe2d4..6c0630b4bdd 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -19,9 +19,7 @@
 # This testcase cannot use runto_main because of the different prompt
 # we get when using annotation level 2.
 #
-if ![target_can_use_run_cmd] {
-    return 0
-}
+require target_can_use_run_cmd
 
 set breakpoints_invalid "\r\n\032\032breakpoints-invalid\r\n"
 
diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp
index 4fae6f066ab..3502340060a 100644
--- a/gdb/testsuite/gdb.base/annota3.exp
+++ b/gdb/testsuite/gdb.base/annota3.exp
@@ -19,9 +19,7 @@
 # This testcase cannot use runto_main because of the different prompt
 # we get when using annotation level 2.
 #
-if ![target_can_use_run_cmd] {
-    return 0
-}
+require target_can_use_run_cmd
 
 
 #
diff --git a/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp b/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp
index a8fa858cb3a..90b9ecaee5f 100644
--- a/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp
+++ b/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp
@@ -20,9 +20,7 @@
 # part of this test.
 
 # Bail out if the target can't use the 'run' command.
-if ![target_can_use_run_cmd] {
-    return 0
-}
+require target_can_use_run_cmd
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.cp/annota2.exp b/gdb/testsuite/gdb.cp/annota2.exp
index 96ac2e7ffbd..102bda557fc 100644
--- a/gdb/testsuite/gdb.cp/annota2.exp
+++ b/gdb/testsuite/gdb.cp/annota2.exp
@@ -32,9 +32,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 # This testcase cannot use runto_main because of the different prompt
 # we get when using annotation level 2.
 #
-if ![target_can_use_run_cmd] {
-    return 0
-}
+require target_can_use_run_cmd
 
 set breakpoints_invalid "\r\n\032\032breakpoints-invalid\r\n"
 set frames_invalid "\r\n\032\032frames-invalid\r\n"
diff --git a/gdb/testsuite/gdb.cp/annota3.exp b/gdb/testsuite/gdb.cp/annota3.exp
index f60bd469c7f..66e083ac7e5 100644
--- a/gdb/testsuite/gdb.cp/annota3.exp
+++ b/gdb/testsuite/gdb.cp/annota3.exp
@@ -32,9 +32,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 # This testcase cannot use runto_main because of the different prompt
 # we get when using annotation level 2.
 #
-if ![target_can_use_run_cmd] {
-    return 0
-}
+require target_can_use_run_cmd
 
 #
 # line number where we need to stop in main
diff --git a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
index 43700016b4e..8542fef8e34 100644
--- a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
+++ b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
@@ -13,9 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if ![target_can_use_run_cmd] {
-    return
-}
+require target_can_use_run_cmd
 
 # Until "catch exec" is implemented on other targets...
 #
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 44/46] Use require using_fission
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (42 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 43/46] Use require target_can_use_run_cmd Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 45/46] Use require skip_debuginfod_tests Tom Tromey
                   ` (3 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require using_fission".
---
 gdb/testsuite/gdb.base/info-macros.exp        | 5 +----
 gdb/testsuite/gdb.linespec/macro-relative.exp | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/gdb/testsuite/gdb.base/info-macros.exp b/gdb/testsuite/gdb.base/info-macros.exp
index b2d75e49f46..5f6a867c96d 100644
--- a/gdb/testsuite/gdb.base/info-macros.exp
+++ b/gdb/testsuite/gdb.base/info-macros.exp
@@ -16,10 +16,7 @@
 standard_testfile .c
 
 # Fission doesn't support macros yet.  Bug 15954.
-if [using_fission] {
-    untested "fission does not support macros yet"
-    return -1
-}
+require !using_fission
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug macros}] } {
     return -1
diff --git a/gdb/testsuite/gdb.linespec/macro-relative.exp b/gdb/testsuite/gdb.linespec/macro-relative.exp
index 67b779f5896..a9468f74bd5 100644
--- a/gdb/testsuite/gdb.linespec/macro-relative.exp
+++ b/gdb/testsuite/gdb.linespec/macro-relative.exp
@@ -16,10 +16,7 @@
 standard_testfile
 
 # Fission doesn't support macros yet.  Bug 15954.
-if [using_fission] {
-    unsupported "fission"
-    return -1
-}
+require !using_fission
 
 if [is_remote host] {
     unsupported "compiling on a remote host does not support a filename with directory."
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 45/46] Use require skip_debuginfod_tests
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (43 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 44/46] Use require using_fission Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-17  0:08 ` [PATCH 46/46] Use require gnat_runtime_has_debug_info Tom Tromey
                   ` (2 subsequent siblings)
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require skip_debuginfod_tests".
---
 gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
index e95526a069f..70900758b87 100644
--- a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
+++ b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
@@ -20,7 +20,7 @@ standard_testfile
 load_lib dwarf.exp
 load_lib debuginfod-support.exp
 
-if { [skip_debuginfod_tests] } { return -1 }
+require !skip_debuginfod_tests
 
 set sourcetmp [standard_output_file tmp-${srcfile}]
 set outputdir [standard_output_file {}]
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 46/46] Use require gnat_runtime_has_debug_info
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (44 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 45/46] Use require skip_debuginfod_tests Tom Tromey
@ 2022-12-17  0:08 ` Tom Tromey
  2022-12-19 10:49 ` [PATCH 00/46] Rewrite "require" test procedure and use it more often Luis Machado
  2023-01-05  1:29 ` Kevin Buettner
  47 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-17  0:08 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some tests to use "require gnat_runtime_has_debug_info".
---
 gdb/testsuite/gdb.ada/dynamic-iface.exp | 5 +----
 gdb/testsuite/gdb.ada/interface.exp     | 5 +----
 gdb/testsuite/gdb.ada/iwide.exp         | 5 +----
 gdb/testsuite/gdb.ada/mi_interface.exp  | 5 +----
 gdb/testsuite/gdb.ada/tagged.exp        | 5 +----
 gdb/testsuite/gdb.ada/tagged_access.exp | 5 +----
 6 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/dynamic-iface.exp b/gdb/testsuite/gdb.ada/dynamic-iface.exp
index e75569c48b8..a22a1cf7d4e 100644
--- a/gdb/testsuite/gdb.ada/dynamic-iface.exp
+++ b/gdb/testsuite/gdb.ada/dynamic-iface.exp
@@ -17,10 +17,7 @@ load_lib "ada.exp"
 
 require !skip_ada_tests
 
-if {![gnat_runtime_has_debug_info]} {
-    untested "GNAT runtime debuginfo required for this test"
-    return -1
-}
+require gnat_runtime_has_debug_info
 
 standard_ada_testfile main
 
diff --git a/gdb/testsuite/gdb.ada/interface.exp b/gdb/testsuite/gdb.ada/interface.exp
index bf08aa59601..a9040eb3f8c 100644
--- a/gdb/testsuite/gdb.ada/interface.exp
+++ b/gdb/testsuite/gdb.ada/interface.exp
@@ -17,10 +17,7 @@ load_lib "ada.exp"
 
 require !skip_ada_tests
 
-if {![gnat_runtime_has_debug_info]} {
-    untested "GNAT runtime debuginfo required for this test"
-    return -1
-}
+require gnat_runtime_has_debug_info
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/iwide.exp b/gdb/testsuite/gdb.ada/iwide.exp
index fc4bc79eb65..073613359b2 100644
--- a/gdb/testsuite/gdb.ada/iwide.exp
+++ b/gdb/testsuite/gdb.ada/iwide.exp
@@ -17,10 +17,7 @@ load_lib "ada.exp"
 
 require !skip_ada_tests
 
-if {![gnat_runtime_has_debug_info]} {
-    untested "GNAT runtime debuginfo required for this test"
-    return -1
-}
+require gnat_runtime_has_debug_info
 
 standard_ada_testfile p
 
diff --git a/gdb/testsuite/gdb.ada/mi_interface.exp b/gdb/testsuite/gdb.ada/mi_interface.exp
index 2ddf4b1fca5..2dc677fb3ea 100644
--- a/gdb/testsuite/gdb.ada/mi_interface.exp
+++ b/gdb/testsuite/gdb.ada/mi_interface.exp
@@ -17,10 +17,7 @@ load_lib "ada.exp"
 
 require !skip_ada_tests
 
-if {![gnat_runtime_has_debug_info]} {
-    untested "GNAT runtime debuginfo required for this test"
-    return -1
-}
+require gnat_runtime_has_debug_info
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/tagged.exp b/gdb/testsuite/gdb.ada/tagged.exp
index 7de8cf331e7..22d1bc7bcb8 100644
--- a/gdb/testsuite/gdb.ada/tagged.exp
+++ b/gdb/testsuite/gdb.ada/tagged.exp
@@ -17,10 +17,7 @@ load_lib "ada.exp"
 
 require !skip_ada_tests
 
-if {![gnat_runtime_has_debug_info]} {
-    untested "GNAT runtime debuginfo required for this test"
-    return -1
-}
+require gnat_runtime_has_debug_info
 
 standard_ada_testfile foo
 
diff --git a/gdb/testsuite/gdb.ada/tagged_access.exp b/gdb/testsuite/gdb.ada/tagged_access.exp
index 26be69f0d4b..4441a78ed51 100644
--- a/gdb/testsuite/gdb.ada/tagged_access.exp
+++ b/gdb/testsuite/gdb.ada/tagged_access.exp
@@ -17,10 +17,7 @@ load_lib "ada.exp"
 
 require !skip_ada_tests
 
-if {![gnat_runtime_has_debug_info]} {
-    untested "GNAT runtime debuginfo required for this test"
-    return -1
-}
+require gnat_runtime_has_debug_info
 
 standard_ada_testfile p
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 21/46] Use require skip_btrace_tests
  2022-12-17  0:07 ` [PATCH 21/46] Use require skip_btrace_tests Tom Tromey
@ 2022-12-17  1:15   ` Enze Li
  2022-12-18  0:48     ` Tom Tromey
  0 siblings, 1 reply; 63+ messages in thread
From: Enze Li @ 2022-12-17  1:15 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches


Hi Tom,

Just one nit.  skip_btrace_tests -> skip_btrace_pt_tests in the subject.

On Fri, Dec 16 2022 at 05:07:53 PM -0700, Tom Tromey wrote:

> This changes some tests to use "require skip_btrace_tests" and
> "require skip_tsx_tests".

Likewise here.

Thanks,
Enze

> ---
>  gdb/testsuite/gdb.btrace/tsx.exp | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.btrace/tsx.exp b/gdb/testsuite/gdb.btrace/tsx.exp
> index c055b0ae409..81b71b1fef9 100644
> --- a/gdb/testsuite/gdb.btrace/tsx.exp
> +++ b/gdb/testsuite/gdb.btrace/tsx.exp
> @@ -15,15 +15,7 @@
>  # You should have received a copy of the GNU General Public License
>  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
>  
> -if { [skip_btrace_pt_tests] } {
> -    unsupported "target does not support PT"
> -    return -1
> -}
> -
> -if { [skip_tsx_tests] } {
> -    unsupported "target does not support TSX"
> -    return -1
> -}
> +require !skip_btrace_pt_tests !skip_tsx_tests
>  
>  standard_testfile .c x86-tsx.S
>  if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {

^ permalink raw reply	[flat|nested] 63+ messages in thread

* RE: [PATCH 22/46] Use require skip_btrace_tests
  2022-12-17  0:07 ` [PATCH 22/46] " Tom Tromey
@ 2022-12-17  9:22   ` Metzger, Markus T
  2022-12-18 17:46     ` Tom Tromey
  0 siblings, 1 reply; 63+ messages in thread
From: Metzger, Markus T @ 2022-12-17  9:22 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

>This changes some tests to use "require skip_btrace_tests".
>---
> gdb/testsuite/gdb.btrace/buffer-size.exp              | 5 +----
> gdb/testsuite/gdb.btrace/data.exp                     | 5 +----
> gdb/testsuite/gdb.btrace/delta.exp                    | 5 +----
> gdb/testsuite/gdb.btrace/enable-new-thread.exp        | 5 +----
> gdb/testsuite/gdb.btrace/enable-running.exp           | 5 +----
> gdb/testsuite/gdb.btrace/enable.exp                   | 5 +----
> gdb/testsuite/gdb.btrace/exception.exp                | 5 +----
> gdb/testsuite/gdb.btrace/function_call_history.exp    | 5 +----
> gdb/testsuite/gdb.btrace/gcore.exp                    | 5 +----
> gdb/testsuite/gdb.btrace/instruction_history.exp      | 5 +----
> gdb/testsuite/gdb.btrace/multi-inferior.exp           | 5 +----
> gdb/testsuite/gdb.btrace/multi-thread-step.exp        | 5 +----
> gdb/testsuite/gdb.btrace/nohist.exp                   | 5 +----
> gdb/testsuite/gdb.btrace/non-stop.exp                 | 5 +----
> gdb/testsuite/gdb.btrace/reconnect.exp                | 5 +----
> gdb/testsuite/gdb.btrace/record_goto-step.exp         | 5 +----
> gdb/testsuite/gdb.btrace/record_goto.exp              | 5 +----
> gdb/testsuite/gdb.btrace/rn-dl-bind.exp               | 5 +----
> gdb/testsuite/gdb.btrace/segv.exp                     | 5 +----
> gdb/testsuite/gdb.btrace/step.exp                     | 5 +----
> gdb/testsuite/gdb.btrace/stepi.exp                    | 5 +----
> gdb/testsuite/gdb.btrace/tailcall-only.exp            | 5 +----
> gdb/testsuite/gdb.btrace/tailcall.exp                 | 5 +----
> gdb/testsuite/gdb.btrace/unknown_functions.exp        | 5 +----
> gdb/testsuite/gdb.btrace/vdso.exp                     | 5 +----
> gdb/testsuite/gdb.python/py-record-btrace-threads.exp | 5 +----
> gdb/testsuite/gdb.python/py-record-btrace.exp         | 5 +----
> 27 files changed, 27 insertions(+), 108 deletions(-)

LGTM with two nits and a general comment below.


>-if { [skip_btrace_tests] } {
>-    unsupported "target does not support record-btrace"
>-    return -1
>-}
>+require !skip_btrace_tests

This looks a little bit odd, now, and the ! is easy to miss.  Those skip checks
should probably be rewritten as support checks to fit better into the new
require logic.

>-if { [skip_btrace_tests] } {
>-    unsupported "target does not support record-btrace"
>-    return -1
>-}
>+require !skip_btrace_tests
>
> if { [use_gdb_stub] } {
>     unsupported "test creates multiple inferiors"

Should this be

require !skip_btrace_tests !use_gdb_stub

>-if { [skip_btrace_tests] } {
>-    unsupported "target does not support record-btrace"
>-    return -1
>-}
>+require !skip_btrace_tests
> if { [skip_gdbserver_tests] } {
>     unsupported "target does not support gdbserver"
>     return -1

Same here with skip_gdbserver_tests.

regards,
markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 21/46] Use require skip_btrace_tests
  2022-12-17  1:15   ` Enze Li
@ 2022-12-18  0:48     ` Tom Tromey
  2022-12-19  5:13       ` Enze Li
  0 siblings, 1 reply; 63+ messages in thread
From: Tom Tromey @ 2022-12-18  0:48 UTC (permalink / raw)
  To: Enze Li; +Cc: Tom Tromey, gdb-patches

Enze> Just one nit.  skip_btrace_tests -> skip_btrace_pt_tests in the subject.

Thanks, I fixed this.

Tom

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 22/46] Use require skip_btrace_tests
  2022-12-17  9:22   ` Metzger, Markus T
@ 2022-12-18 17:46     ` Tom Tromey
  0 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-18 17:46 UTC (permalink / raw)
  To: Metzger, Markus T; +Cc: Tom Tromey, gdb-patches

>> +require !skip_btrace_tests

> This looks a little bit odd, now, and the ! is easy to miss.  Those skip checks
> should probably be rewritten as support checks to fit better into the new
> require logic.

Yes, I think this would be an improvement as well; and if this series
goes in, I think we should encourage future predicates to be written in
the "positive" sense.

> Should this be
> require !skip_btrace_tests !use_gdb_stub
...
> Same here with skip_gdbserver_tests.

These changes are made later in the series, though I didn't make much
effort to consistently combine calls to require.

Tom

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 21/46] Use require skip_btrace_tests
  2022-12-18  0:48     ` Tom Tromey
@ 2022-12-19  5:13       ` Enze Li
  2022-12-19 14:44         ` Tom Tromey
  0 siblings, 1 reply; 63+ messages in thread
From: Enze Li @ 2022-12-19  5:13 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Sat, Dec 17 2022 at 05:48:50 PM -0700, Tom Tromey wrote:

> Enze> Just one nit.  skip_btrace_tests -> skip_btrace_pt_tests in the subject.
>
> Thanks, I fixed this.
>
> Tom

I'm a little forgetful.  I created a pull request to your branch
"rewrite-require" a few days ago.  And, I dunno what's going on with
Github, it messed thing up.  I recreated one (#42), is that ok?

Best Regards,
Enze

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 25/46] Use require is_aarch64_target
  2022-12-17  0:07 ` [PATCH 25/46] Use require is_aarch64_target Tom Tromey
@ 2022-12-19 10:46   ` Luis Machado
  0 siblings, 0 replies; 63+ messages in thread
From: Luis Machado @ 2022-12-19 10:46 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 12/17/22 00:07, Tom Tromey wrote:
> This changes some tests to use "require is_aarch64_target".
> ---
>   gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp     | 5 +----
>   gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp    | 5 +----
>   gdb/testsuite/gdb.arch/aarch64-dbreg-contents.exp  | 5 +----
>   gdb/testsuite/gdb.arch/aarch64-fp.exp              | 5 +----
>   gdb/testsuite/gdb.arch/aarch64-mte-core.exp        | 5 +----
>   gdb/testsuite/gdb.arch/aarch64-mte.exp             | 5 +----
>   gdb/testsuite/gdb.arch/aarch64-pauth.exp           | 5 +----
>   gdb/testsuite/gdb.arch/aarch64-prologue.exp        | 5 +----
>   gdb/testsuite/gdb.arch/aarch64-sighandler-regs.exp | 5 +----
>   gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp  | 5 +----
>   gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp       | 5 +----
>   gdb/testsuite/gdb.arch/aarch64-w-registers.exp     | 5 +----
>   12 files changed, 12 insertions(+), 48 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp b/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
> index 18843d341e1..a72210ffa68 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
> @@ -18,10 +18,7 @@
>   # Test single stepping through atomic sequences beginning with
>   # a ldxr instruction and ending with a stxr instruction.
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch64_target
>   
>   standard_testfile
>   if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
> diff --git a/gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp b/gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp
> index f4ecc554379..9e1f7d6f8a6 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp
> @@ -18,10 +18,7 @@
>   # Test if GDB stops at various BRK instruction patterns inserted into
>   # the code.
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch64_target
>   
>   standard_testfile
>   if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
> diff --git a/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.exp b/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.exp
> index add1234e606..f8606e219ad 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-dbreg-contents.exp
> @@ -21,10 +21,7 @@
>   #
>   # See PR breakpoints/21870.
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch64_target
>   
>   standard_testfile .c
>   
> diff --git a/gdb/testsuite/gdb.arch/aarch64-fp.exp b/gdb/testsuite/gdb.arch/aarch64-fp.exp
> index 41c162b4d50..48c39951e4f 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-fp.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-fp.exp
> @@ -18,10 +18,7 @@
>   # PR server/17457
>   # Test aarch64 floating point registers q0, q1, v0, v1, fpsr, fpcr
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch64_target
>   
>   standard_testfile
>   if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
> diff --git a/gdb/testsuite/gdb.arch/aarch64-mte-core.exp b/gdb/testsuite/gdb.arch/aarch64-mte-core.exp
> index 904364d027c..5ebc6d7d1ee 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-mte-core.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-mte-core.exp
> @@ -164,10 +164,7 @@ proc test_mode { mode } {
>   
>   }
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch64_target
>   
>   # Run tests
>   foreach_with_prefix mode {"sync" "async"} {
> diff --git a/gdb/testsuite/gdb.arch/aarch64-mte.exp b/gdb/testsuite/gdb.arch/aarch64-mte.exp
> index 4aaf1844f24..a4a8a20d8aa 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-mte.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-mte.exp
> @@ -43,10 +43,7 @@ proc get_ltag_from_ptr { ptr } {
>   		      "fetch tag from pointer ${ptr}"]
>   }
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch64_target
>   
>   standard_testfile
>   if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
> diff --git a/gdb/testsuite/gdb.arch/aarch64-pauth.exp b/gdb/testsuite/gdb.arch/aarch64-pauth.exp
> index 901eb8212c9..54bf16c5f67 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-pauth.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-pauth.exp
> @@ -17,10 +17,7 @@
>   # supports pauth instructions.  On non pauth systems, all pauth instructions
>   # are treated as nops.
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch64_target
>   
>   # Build program with address signing forced on.
>   standard_testfile
> diff --git a/gdb/testsuite/gdb.arch/aarch64-prologue.exp b/gdb/testsuite/gdb.arch/aarch64-prologue.exp
> index d17dc668873..588bc269336 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-prologue.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-prologue.exp
> @@ -15,10 +15,7 @@
>   
>   # This file is part of the gdb testsuite.
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return 1
> -}
> +require is_aarch64_target
>   
>   standard_testfile
>   if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}]} {
> diff --git a/gdb/testsuite/gdb.arch/aarch64-sighandler-regs.exp b/gdb/testsuite/gdb.arch/aarch64-sighandler-regs.exp
> index 7cb3adad076..1175e8d6b4f 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-sighandler-regs.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-sighandler-regs.exp
> @@ -15,10 +15,7 @@
>   #
>   # This file is part of the gdb testsuite.
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return -1
> -}
> +require is_aarch64_target
>   
>   set compile_flags {debug}
>   
> diff --git a/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp b/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp
> index 6e94a8fc11a..8faf92bee8d 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp
> @@ -15,10 +15,7 @@
>   #
>   # This file is part of the gdb testsuite.
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch64_target
>   
>   standard_testfile
>   if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
> diff --git a/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp b/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp
> index a6d549a9830..9e9613aa3f9 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp
> @@ -17,10 +17,7 @@
>   
>   # Test explicitly unwinding the PC DWARF register on aarch64
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch64_target
>   
>   standard_testfile .S
>   
> diff --git a/gdb/testsuite/gdb.arch/aarch64-w-registers.exp b/gdb/testsuite/gdb.arch/aarch64-w-registers.exp
> index 72711fe660f..7e4fc24c3cb 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-w-registers.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-w-registers.exp
> @@ -16,10 +16,7 @@
>   # Check if the W registers have the expected size and if setting/fetching
>   # values from W registers works correctly for both big and little endian.
>   
> -if {![is_aarch64_target]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch64_target
>   
>   standard_testfile
>   if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}]} {

LGTM.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 26/46] Use require is_aarch32_target
  2022-12-17  0:07 ` [PATCH 26/46] Use require is_aarch32_target Tom Tromey
@ 2022-12-19 10:46   ` Luis Machado
  0 siblings, 0 replies; 63+ messages in thread
From: Luis Machado @ 2022-12-19 10:46 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 12/17/22 00:07, Tom Tromey wrote:
> This changes some tests to use "require is_aarch32_target".
> ---
>   gdb/testsuite/gdb.arch/arm-bl-branch-dest.exp            | 5 +----
>   gdb/testsuite/gdb.arch/arm-disp-step.exp                 | 5 +----
>   gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp | 5 +----
>   gdb/testsuite/gdb.arch/pr25124.exp                       | 5 +----
>   gdb/testsuite/gdb.arch/thumb-bx-pc.exp                   | 5 +----
>   gdb/testsuite/gdb.arch/thumb-prologue.exp                | 5 +----
>   gdb/testsuite/gdb.arch/thumb-singlestep.exp              | 5 +----
>   7 files changed, 7 insertions(+), 28 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.arch/arm-bl-branch-dest.exp b/gdb/testsuite/gdb.arch/arm-bl-branch-dest.exp
> index 34d98aec96e..37710649005 100644
> --- a/gdb/testsuite/gdb.arch/arm-bl-branch-dest.exp
> +++ b/gdb/testsuite/gdb.arch/arm-bl-branch-dest.exp
> @@ -13,10 +13,7 @@
>   # You should have received a copy of the GNU General Public License
>   # along with this program.  If not, see <http://www.gnu.org/licenses/>.
>   
> -if { ![is_aarch32_target] } {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch32_target
>   
>   standard_testfile
>   
> diff --git a/gdb/testsuite/gdb.arch/arm-disp-step.exp b/gdb/testsuite/gdb.arch/arm-disp-step.exp
> index ec6578257b3..0eb1707bb6c 100644
> --- a/gdb/testsuite/gdb.arch/arm-disp-step.exp
> +++ b/gdb/testsuite/gdb.arch/arm-disp-step.exp
> @@ -17,10 +17,7 @@
>   
>   # Test arm displaced stepping.
>   
> -if {![is_aarch32_target]} {
> -    verbose "Skipping arm displaced stepping tests."
> -    return
> -}
> +require is_aarch32_target
>   
>   standard_testfile .S
>   
> diff --git a/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp b/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp
> index c3544b16a0b..22a2559b271 100644
> --- a/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp
> +++ b/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp
> @@ -13,10 +13,7 @@
>   # You should have received a copy of the GNU General Public License
>   # along with this program.  If not, see <http://www.gnu.org/licenses/>.
>   
> -if { ![is_aarch32_target] } {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require is_aarch32_target
>   
>   standard_testfile
>   
> diff --git a/gdb/testsuite/gdb.arch/pr25124.exp b/gdb/testsuite/gdb.arch/pr25124.exp
> index a68a3d1b7df..95636bd1ed8 100644
> --- a/gdb/testsuite/gdb.arch/pr25124.exp
> +++ b/gdb/testsuite/gdb.arch/pr25124.exp
> @@ -16,10 +16,7 @@
>   # Test proper disassembling of ARM thumb instructions when reloading a symbol
>   # file.
>   
> -if {![is_aarch32_target]} {
> -    verbose "Skipping ARM tests."
> -    return
> -}
> +require is_aarch32_target
>   
>   standard_testfile .S
>   
> diff --git a/gdb/testsuite/gdb.arch/thumb-bx-pc.exp b/gdb/testsuite/gdb.arch/thumb-bx-pc.exp
> index ccc6fbfdca7..6989d79c6d6 100644
> --- a/gdb/testsuite/gdb.arch/thumb-bx-pc.exp
> +++ b/gdb/testsuite/gdb.arch/thumb-bx-pc.exp
> @@ -15,10 +15,7 @@
>   
>   # Test PC adjustment from Thumb-mode "bx pc" instruction.
>   
> -if {![is_aarch32_target]} {
> -    verbose "Skipping ARM tests."
> -    return
> -}
> +require is_aarch32_target
>   
>   set testfile "thumb-bx-pc"
>   set srcfile ${testfile}.S
> diff --git a/gdb/testsuite/gdb.arch/thumb-prologue.exp b/gdb/testsuite/gdb.arch/thumb-prologue.exp
> index 0cb14572345..8e83bd3c009 100644
> --- a/gdb/testsuite/gdb.arch/thumb-prologue.exp
> +++ b/gdb/testsuite/gdb.arch/thumb-prologue.exp
> @@ -15,10 +15,7 @@
>   
>   # Test ARM/Thumb prologue analyzer.
>   
> -if {![is_aarch32_target]} {
> -    verbose "Skipping ARM prologue tests."
> -    return
> -}
> +require is_aarch32_target
>   
>   standard_testfile
>   
> diff --git a/gdb/testsuite/gdb.arch/thumb-singlestep.exp b/gdb/testsuite/gdb.arch/thumb-singlestep.exp
> index 289bdf52463..c3b7999036e 100644
> --- a/gdb/testsuite/gdb.arch/thumb-singlestep.exp
> +++ b/gdb/testsuite/gdb.arch/thumb-singlestep.exp
> @@ -15,10 +15,7 @@
>   
>   # Test single-stepping into incorrectly marked Thumb routine
>   
> -if {![is_aarch32_target]} {
> -    verbose "Skipping ARM tests."
> -    return
> -}
> +require is_aarch32_target
>   
>   set testfile "thumb-singlestep"
>   set srcfile ${testfile}.S

LGTM.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 00/46] Rewrite "require" test procedure and use it more often
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (45 preceding siblings ...)
  2022-12-17  0:08 ` [PATCH 46/46] Use require gnat_runtime_has_debug_info Tom Tromey
@ 2022-12-19 10:49 ` Luis Machado
  2023-01-06  2:45   ` Tom Tromey
  2023-01-05  1:29 ` Kevin Buettner
  47 siblings, 1 reply; 63+ messages in thread
From: Luis Machado @ 2022-12-19 10:49 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 12/17/22 00:07, Tom Tromey wrote:
> A recent patch by Enze Li made me revisit the "require" procedure.
> For his patch, see:
> 
> https://sourceware.org/pipermail/gdb-patches/2022-December/194586.html
> 
> This series rewrites "require" to be a bit more 'static' and then
> changes a lot of the test suite to use it when possible.  I looked at
> a large number of tests, but not every single one, so it's possible
> some more work here could be done.
> 
> The new 'require' just invokes simple predicates and decides what to
> do based on them.  It will issue an "unsupported" message if the
> requirements are not satisfied.  See patch #3.
> 
> Currently the requirements should only be invoked when gdb is not
> running.  At least, that's what I've done, I don't think there's a
> real barrier to doing this, other than the fact that the resulting
> code might be overly subtle.

That has happened in the past. Of course once you realize that's how it should work, you don't do it anymore.

I wonder if there is a way to assert if the requirement is being used with a running gdb.

> 
> More changes here could be done, for example allowing uses like:
> 
>      require {is_remote host}
> 
> or the like.  I haven't tried this.
> 
> The main benefit of this entire approach is that it removes
> boilerplate and decisions about whether to use verbose, unsupport,
> untested, or even no output at all.
> 
> Regression tested on x86-64 Fedora 36, though TBH that's hardly
> sufficient.
> 
> Let me know what you think.
> 
> Tom
> 
> 


^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 20/46] Use require skip_aarch64_sve_tests
  2022-12-17  0:07 ` [PATCH 20/46] Use require skip_aarch64_sve_tests Tom Tromey
@ 2022-12-19 10:50   ` Luis Machado
  0 siblings, 0 replies; 63+ messages in thread
From: Luis Machado @ 2022-12-19 10:50 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 12/17/22 00:07, Tom Tromey wrote:
> This changes some tests to use "require skip_aarch64_sve_tests".
> ---
>   gdb/testsuite/gdb.arch/aarch64-sve.exp | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.arch/aarch64-sve.exp b/gdb/testsuite/gdb.arch/aarch64-sve.exp
> index 803aae5fdfb..56793cec44e 100644
> --- a/gdb/testsuite/gdb.arch/aarch64-sve.exp
> +++ b/gdb/testsuite/gdb.arch/aarch64-sve.exp
> @@ -15,10 +15,7 @@
>   
>   # Test a binary that uses SVE and exercise changing the SVE vector length.
>   
> -if {[skip_aarch64_sve_tests]} {
> -    verbose "Skipping ${gdb_test_file_name}."
> -    return
> -}
> +require !skip_aarch64_sve_tests
>   
>   standard_testfile
>   if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {

LGTM.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 21/46] Use require skip_btrace_tests
  2022-12-19  5:13       ` Enze Li
@ 2022-12-19 14:44         ` Tom Tromey
  0 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2022-12-19 14:44 UTC (permalink / raw)
  To: Enze Li; +Cc: Tom Tromey, gdb-patches

>>>>> "Enze" == Enze Li <enze.li@hotmail.com> writes:

Enze> I'm a little forgetful.  I created a pull request to your branch
Enze> "rewrite-require" a few days ago.  And, I dunno what's going on with
Enze> Github, it messed thing up.  I recreated one (#42), is that ok?

I don't mind or anything, but I also don't look at issues or pull
requests there.  That repository is more just a spot for me to store
patches.

Tom

^ permalink raw reply	[flat|nested] 63+ messages in thread

* RE: [PATCH 03/46] Use unsupported in 'require'
  2022-12-17  0:07 ` [PATCH 03/46] Use unsupported in 'require' Tom Tromey
@ 2022-12-23 12:39   ` Aktemur, Tankut Baris
  2023-01-06  1:14     ` Tom Tromey
  0 siblings, 1 reply; 63+ messages in thread
From: Aktemur, Tankut Baris @ 2022-12-23 12:39 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On Saturday, December 17, 2022 1:08 AM, Tom Tromey wrote:
> This changes 'require' to use 'untested' rather than 'unsupported'.

I think you meant "use 'unsupported' rather than 'untested'".

Thanks
-Baris

> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index 62e519a3cb7..3509ff0a51d 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -9042,7 +9042,7 @@ proc require { args } {
>  	    set fn $arg
>  	}
>  	if {$ok != !![uplevel 1 $fn]} {
> -	    untested "require failed: $arg"
> +	    unsupported "require failed: $arg"
>  	    return -code return 0
>  	}
>      }
> --
> 2.38.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 00/46] Rewrite "require" test procedure and use it more often
  2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
                   ` (46 preceding siblings ...)
  2022-12-19 10:49 ` [PATCH 00/46] Rewrite "require" test procedure and use it more often Luis Machado
@ 2023-01-05  1:29 ` Kevin Buettner
  2023-01-06  2:47   ` Tom Tromey
  47 siblings, 1 reply; 63+ messages in thread
From: Kevin Buettner @ 2023-01-05  1:29 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Fri, 16 Dec 2022 17:07:32 -0700
Tom Tromey <tom@tromey.com> wrote:

> Let me know what you think.

Overall, I like this series.

One thing that I find a little odd (due to a sort of double negation) is the
construct:

    require !skip_something

...which replaces something like:

    if {[skip_something]} {
        unsupported "target does not support something"
	return 0
    }

I see that Markus Metzger also commented on this and also that you
noted that this could be improved over time.  (Which is fine with me.)

I looked at each patch in the series, though I didn't read all of them
closely.  After a while, I just did some spot checks to make sure that
they were doing what I expected.

So... LGTM.

Kevin


^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 03/46] Use unsupported in 'require'
  2022-12-23 12:39   ` Aktemur, Tankut Baris
@ 2023-01-06  1:14     ` Tom Tromey
  0 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2023-01-06  1:14 UTC (permalink / raw)
  To: Aktemur, Tankut Baris; +Cc: Tom Tromey, gdb-patches

> On Saturday, December 17, 2022 1:08 AM, Tom Tromey wrote:
>> This changes 'require' to use 'untested' rather than 'unsupported'.

> I think you meant "use 'unsupported' rather than 'untested'".

Thank you.  I made this change.

Tom

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 00/46] Rewrite "require" test procedure and use it more often
  2022-12-19 10:49 ` [PATCH 00/46] Rewrite "require" test procedure and use it more often Luis Machado
@ 2023-01-06  2:45   ` Tom Tromey
  0 siblings, 0 replies; 63+ messages in thread
From: Tom Tromey @ 2023-01-06  2:45 UTC (permalink / raw)
  To: Luis Machado; +Cc: Tom Tromey, gdb-patches

>> Currently the requirements should only be invoked when gdb is not
>> running.  At least, that's what I've done, I don't think there's a
>> real barrier to doing this, other than the fact that the resulting
>> code might be overly subtle.

Luis> I wonder if there is a way to assert if the requirement is being
Luis> used with a running gdb.

We could make it work.

Also I think now that gdb has --config, we can make skip_python_tests
without needing a running gdb.  I don't know if there are others that
could be improved this way.

Tom

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 00/46] Rewrite "require" test procedure and use it more often
  2023-01-05  1:29 ` Kevin Buettner
@ 2023-01-06  2:47   ` Tom Tromey
  2023-01-07  0:07     ` Kevin Buettner
  0 siblings, 1 reply; 63+ messages in thread
From: Tom Tromey @ 2023-01-06  2:47 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: Tom Tromey, gdb-patches

Kevin> One thing that I find a little odd (due to a sort of double negation) is the
Kevin> construct:
Kevin>     require !skip_something
...
Kevin> I see that Markus Metzger also commented on this and also that you
Kevin> noted that this could be improved over time.  (Which is fine with me.)

It would be pretty easy to just convert them all.

What non-negative name would be good?
"test_"?  "allow_"?  "enable_"?

Kevin> So... LGTM.

Thanks.  I will put it in reasonably soon, though if we pick a good name
I will do that first and send a v2.

Tom

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 00/46] Rewrite "require" test procedure and use it more often
  2023-01-06  2:47   ` Tom Tromey
@ 2023-01-07  0:07     ` Kevin Buettner
  0 siblings, 0 replies; 63+ messages in thread
From: Kevin Buettner @ 2023-01-07  0:07 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Thu, 05 Jan 2023 19:47:14 -0700
Tom Tromey <tom@tromey.com> wrote:

> Kevin> One thing that I find a little odd (due to a sort of double negation) is the
> Kevin> construct:
> Kevin>     require !skip_something  
> ...
> Kevin> I see that Markus Metzger also commented on this and also that you
> Kevin> noted that this could be improved over time.  (Which is fine with me.)  
> 
> It would be pretty easy to just convert them all.
> 
> What non-negative name would be good?
> "test_"?  "allow_"?  "enable_"?

Of the choices you mention, I like "allow_" the best.

Kevin


^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2023-01-07  0:07 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-17  0:07 [PATCH 00/46] Rewrite "require" test procedure and use it more often Tom Tromey
2022-12-17  0:07 ` [PATCH 01/46] Don't use ensure_gdb_index with require Tom Tromey
2022-12-17  0:07 ` [PATCH 02/46] Change 'require' to accept a list of predicates Tom Tromey
2022-12-17  0:07 ` [PATCH 03/46] Use unsupported in 'require' Tom Tromey
2022-12-23 12:39   ` Aktemur, Tankut Baris
2023-01-06  1:14     ` Tom Tromey
2022-12-17  0:07 ` [PATCH 04/46] Use require supports_reverse Tom Tromey
2022-12-17  0:07 ` [PATCH 05/46] Use require supports_process_record Tom Tromey
2022-12-17  0:07 ` [PATCH 06/46] Use require dwarf2_support Tom Tromey
2022-12-17  0:07 ` [PATCH 07/46] Use require is_x86_like_target Tom Tromey
2022-12-17  0:07 ` [PATCH 08/46] Use require skip_cplus_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 09/46] Use require skip_shlib_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 10/46] Use require skip_dlmopen_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 11/46] Use require skip_stl_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 12/46] Use require skip_rust_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 13/46] Use require skip_fortran_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 14/46] Use require skip_ada_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 15/46] Use require skip_go_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 16/46] Use require skip_d_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 17/46] Use require skip_ctf_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 18/46] Use require skip_hw_watchpoint_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 19/46] Use require skip_ifunc_tests Tom Tromey
2022-12-17  0:07 ` [PATCH 20/46] Use require skip_aarch64_sve_tests Tom Tromey
2022-12-19 10:50   ` Luis Machado
2022-12-17  0:07 ` [PATCH 21/46] Use require skip_btrace_tests Tom Tromey
2022-12-17  1:15   ` Enze Li
2022-12-18  0:48     ` Tom Tromey
2022-12-19  5:13       ` Enze Li
2022-12-19 14:44         ` Tom Tromey
2022-12-17  0:07 ` [PATCH 22/46] " Tom Tromey
2022-12-17  9:22   ` Metzger, Markus T
2022-12-18 17:46     ` Tom Tromey
2022-12-17  0:07 ` [PATCH 23/46] Use require skip_avx_* Tom Tromey
2022-12-17  0:07 ` [PATCH 24/46] Use require support_displaced_stepping Tom Tromey
2022-12-17  0:07 ` [PATCH 25/46] Use require is_aarch64_target Tom Tromey
2022-12-19 10:46   ` Luis Machado
2022-12-17  0:07 ` [PATCH 26/46] Use require is_aarch32_target Tom Tromey
2022-12-19 10:46   ` Luis Machado
2022-12-17  0:07 ` [PATCH 27/46] Use require is_amd64_regs_target Tom Tromey
2022-12-17  0:08 ` [PATCH 28/46] Use require is_elf_target Tom Tromey
2022-12-17  0:08 ` [PATCH 29/46] Use require can_single_step_to_signal_handler Tom Tromey
2022-12-17  0:08 ` [PATCH 30/46] Use require supports_get_siginfo_type Tom Tromey
2022-12-17  0:08 ` [PATCH 31/46] Use require support_go_compile Tom Tromey
2022-12-17  0:08 ` [PATCH 32/46] Use require use_gdb_stub Tom Tromey
2022-12-17  0:08 ` [PATCH 33/46] Use require can_spawn_for_attach Tom Tromey
2022-12-17  0:08 ` [PATCH 34/46] Use require isnative Tom Tromey
2022-12-17  0:08 ` [PATCH 35/46] Use require skip_gdbserver_tests Tom Tromey
2022-12-17  0:08 ` [PATCH 36/46] Use require skip_shlib_tests Tom Tromey
2022-12-17  0:08 ` [PATCH 37/46] Use require is_c_compiler_gcc Tom Tromey
2022-12-17  0:08 ` [PATCH 38/46] Use require gdb_debug_enabled Tom Tromey
2022-12-17  0:08 ` [PATCH 39/46] Use require gdb_skip_xml_test Tom Tromey
2022-12-17  0:08 ` [PATCH 40/46] Use require gdb_trace_common_supports_arch Tom Tromey
2022-12-17  0:08 ` [PATCH 41/46] Use require skip_perf_tests Tom Tromey
2022-12-17  0:08 ` [PATCH 42/46] Use require skip_opencl_tests Tom Tromey
2022-12-17  0:08 ` [PATCH 43/46] Use require target_can_use_run_cmd Tom Tromey
2022-12-17  0:08 ` [PATCH 44/46] Use require using_fission Tom Tromey
2022-12-17  0:08 ` [PATCH 45/46] Use require skip_debuginfod_tests Tom Tromey
2022-12-17  0:08 ` [PATCH 46/46] Use require gnat_runtime_has_debug_info Tom Tromey
2022-12-19 10:49 ` [PATCH 00/46] Rewrite "require" test procedure and use it more often Luis Machado
2023-01-06  2:45   ` Tom Tromey
2023-01-05  1:29 ` Kevin Buettner
2023-01-06  2:47   ` Tom Tromey
2023-01-07  0:07     ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).