[08/46] Use require skip_cplus_tests

Message ID 20221217000818.3729389-9-tom@tromey.com
State Committed
Headers
Series Rewrite "require" test procedure and use it more often |

Commit Message

Tom Tromey Dec. 17, 2022, 12:07 a.m. UTC
  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(-)
  

Patch

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