[07/46] Use require is_x86_like_target

Message ID 20221217000818.3729389-8-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 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(-)
  

Patch

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