From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH v2 4/9] Rename skip_vsx_tests to allow form
Date: Tue, 24 Jan 2023 16:02:38 -0700 [thread overview]
Message-ID: <20230124230243.2471957-5-tom@tromey.com> (raw)
In-Reply-To: <20230124230243.2471957-1-tom@tromey.com>
This renames skip_vsx_tests to allow_vsx_tests and updates it users to
use require.
---
gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp | 3 ++-
gdb/testsuite/gdb.arch/vsx-regs.exp | 3 ++-
gdb/testsuite/gdb.arch/vsx-vsr-float28.exp | 4 +--
gdb/testsuite/lib/gdb.exp | 28 ++++++++++----------
4 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp b/gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp
index 69789998ea2..b80afa5b7f2 100644
--- a/gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp
@@ -18,10 +18,11 @@
# This test checks that generating and loading a core file preserves
# the correct VSX register state.
-if {![istarget "powerpc*-*-linux*"] || [skip_vsx_tests]} {
+if {![istarget "powerpc*-*-linux*"]} {
verbose "Skipping PowerPC test for corefiles with VSX registers."
return
}
+require allow_vsx_tests
standard_testfile .c
diff --git a/gdb/testsuite/gdb.arch/vsx-regs.exp b/gdb/testsuite/gdb.arch/vsx-regs.exp
index b3a120e8188..e7476f1015b 100644
--- a/gdb/testsuite/gdb.arch/vsx-regs.exp
+++ b/gdb/testsuite/gdb.arch/vsx-regs.exp
@@ -19,10 +19,11 @@
#
-if {![istarget "powerpc*"] || [skip_vsx_tests]} {
+if {![istarget "powerpc*"]} {
verbose "Skipping vsx register tests."
return
}
+require allow_vsx_tests
standard_testfile
diff --git a/gdb/testsuite/gdb.arch/vsx-vsr-float28.exp b/gdb/testsuite/gdb.arch/vsx-vsr-float28.exp
index 296a7420f61..04915719615 100644
--- a/gdb/testsuite/gdb.arch/vsx-vsr-float28.exp
+++ b/gdb/testsuite/gdb.arch/vsx-vsr-float28.exp
@@ -18,11 +18,11 @@
# Test the vsr registers print values in float128 bit format.
#
-
-if {![istarget "powerpc*"] || [skip_vsx_tests]} {
+if {![istarget "powerpc*"]} {
verbose "Skipping vsr float128 field tests."
return
}
+require allow_vsx_tests
standard_testfile
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 5425ae74cb9..4b8337dbc1c 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3571,19 +3571,19 @@ gdb_caching_proc allow_power_isa_3_1_tests {
return $allow_power_isa_3_1_tests
}
-# Run a test on the target to see if it supports vmx hardware. Return 0 if so,
-# 1 if it does not. Based on 'check_vmx_hw_available' from the GCC testsuite.
+# Run a test on the target to see if it supports vmx hardware. Return 1 if so,
+# 0 if it does not. Based on 'check_vmx_hw_available' from the GCC testsuite.
-gdb_caching_proc skip_vsx_tests {
+gdb_caching_proc allow_vsx_tests {
global srcdir subdir gdb_prompt inferior_exited_re
- set me "skip_vsx_tests"
+ set me "allow_vsx_tests"
# Some simulators are known to not support Altivec instructions, so
# they won't support VSX instructions as well.
if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] } {
- verbose "$me: target known to not support VSX, returning 1" 2
- return 1
+ verbose "$me: target known to not support VSX, returning 0" 2
+ return 0
}
# Make sure we have a compiler that understands altivec.
@@ -3592,8 +3592,8 @@ gdb_caching_proc skip_vsx_tests {
} elseif [test_compiler_info xlc*] {
set compile_flags "additional_flags=-qasm=gcc"
} else {
- verbose "Could not compile with vsx support, returning 1" 2
- return 1
+ verbose "Could not compile with vsx support, returning 0" 2
+ return 0
}
# Compile a test program containing VSX instructions.
@@ -3609,7 +3609,7 @@ gdb_caching_proc skip_vsx_tests {
}
}
if {![gdb_simple_compile $me $src executable $compile_flags]} {
- return 1
+ return 0
}
# No error message, compilation succeeded so now run it via gdb.
@@ -3622,22 +3622,22 @@ gdb_caching_proc skip_vsx_tests {
gdb_expect {
-re ".*Illegal instruction.*${gdb_prompt} $" {
verbose -log "\n$me VSX hardware not detected"
- set skip_vsx_tests 1
+ set allow_vsx_tests 0
}
-re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
verbose -log "\n$me: VSX hardware detected"
- set skip_vsx_tests 0
+ set allow_vsx_tests 1
}
default {
warning "\n$me: default case taken"
- set skip_vsx_tests 1
+ set allow_vsx_tests 0
}
}
gdb_exit
remote_file build delete $obj
- verbose "$me: returning $skip_vsx_tests" 2
- return $skip_vsx_tests
+ verbose "$me: returning $allow_vsx_tests" 2
+ return $allow_vsx_tests
}
# Run a test on the target to see if it supports TSX hardware. Return 1 if so,
--
2.39.0
next prev parent reply other threads:[~2023-01-24 23:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-24 23:02 [PATCH v2 0/9] Use 'require' even more Tom Tromey
2023-01-24 23:02 ` [PATCH v2 1/9] Convert skip_altivec_tests to allow form Tom Tromey
2023-01-25 10:54 ` Pedro Alves
2023-01-24 23:02 ` [PATCH v2 2/9] Rename skip_float_test " Tom Tromey
2023-01-24 23:02 ` [PATCH v2 3/9] Rename skip_power_isa_3_1_tests " Tom Tromey
2023-01-24 23:02 ` Tom Tromey [this message]
2023-01-24 23:02 ` [PATCH v2 5/9] Use require with istarget Tom Tromey
2023-01-24 23:02 ` [PATCH v2 6/9] Introduce and use is_any_target Tom Tromey
2023-01-24 23:02 ` [PATCH v2 7/9] Add unsupported calls where needed Tom Tromey
2023-01-24 23:02 ` [PATCH v2 8/9] Use require with is_remote Tom Tromey
2023-01-24 23:02 ` [PATCH v2 9/9] Move target check into allow_altivec_tests Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230124230243.2471957-5-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).