From: Walfred Tedeschi <walfred.tedeschi@intel.com>
To: brobecker@adacore.com
Cc: gdb-patches@sourceware.org,
Walfred Tedeschi <walfred.tedeschi@intel.com>
Subject: [PATCH v3] Improve test for processor feature om MPX registers test.
Date: Mon, 08 Jun 2015 16:06:00 -0000 [thread overview]
Message-ID: <1433779534-32677-1-git-send-email-walfred.tedeschi@intel.com> (raw)
Skips the MPX register test in case target is not Intel.
Improves the test for MPX feature making MPX and AVX512
tests more similar in terms of initialization.
Indentation was improved on sample file and final return added
to have_mpx. On test file identation was improved and
gdb_send was exchanged by gdb_test_multiple.
2015-06-08 Walfred Tedeschi <walfred.tedeschi@intel.com>
gdb/testsuite
* gdb.arch/i386-mpx.c: Added final return to the have_mpx
function and improved indentation.
* gdb.arch/i386-mpx.exp: Exchanging gdb_send and gdb_expect for
gdb_test_multiple. Added additional tests to skip the test.
---
gdb/testsuite/gdb.arch/i386-mpx.c | 1 +
gdb/testsuite/gdb.arch/i386-mpx.exp | 31 ++++++++++++++++++-------------
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/gdb/testsuite/gdb.arch/i386-mpx.c b/gdb/testsuite/gdb.arch/i386-mpx.c
index b62a272..87c753c 100644
--- a/gdb/testsuite/gdb.arch/i386-mpx.c
+++ b/gdb/testsuite/gdb.arch/i386-mpx.c
@@ -46,6 +46,7 @@ have_mpx (void)
else
return 0;
}
+ return 0;
}
int
diff --git a/gdb/testsuite/gdb.arch/i386-mpx.exp b/gdb/testsuite/gdb.arch/i386-mpx.exp
index 8b50aed..6835b24 100644
--- a/gdb/testsuite/gdb.arch/i386-mpx.exp
+++ b/gdb/testsuite/gdb.arch/i386-mpx.exp
@@ -22,6 +22,11 @@ if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } {
standard_testfile
+if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } {
+ verbose "Skipping x86 MPX tests."
+ return
+}
+
set comp_flags "-fmpx -I${srcdir}/../nat/"
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
@@ -34,23 +39,23 @@ if ![runto_main] {
return -1
}
-send_gdb "print have_mpx ()\r"
-gdb_expect {
- -re ".. = 1\r\n$gdb_prompt " {
- pass "check whether processor supports MPX"
+set supports_mpx 0
+set test "probe MPX support"
+gdb_test_multiple "print have_mpx()" $test {
+ -re ".. = 1\r\n$gdb_prompt $" {
+ pass $test
+ set supports_mpx 1
}
- -re ".. = 0\r\n$gdb_prompt " {
- verbose "processor does not support MPX; skipping MPX tests"
- return
- }
- -re ".*$gdb_prompt $" {
- fail "check whether processor supports MPX"
- }
- timeout {
- fail "check whether processor supports MPX (timeout)"
+ -re ".. = 0\r\n$gdb_prompt $" {
+ pass $test
}
}
+if { !$supports_mpx } {
+ unsupported "processor does not support MPX"
+ return
+}
+
# Test bndcfg register and bndstatus at startup
set test_string "\\\{raw = 0x\[0-9a-f\]+, config = \\\{base = \[0-9\]+,\
reserved = \[0-9\]+, preserved = \[0-9\]+, enabled = \[0-9\]+\\\}\\\}"
--
2.1.4
next reply other threads:[~2015-06-08 16:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-08 16:06 Walfred Tedeschi [this message]
2015-06-09 18:23 ` Joel Brobecker
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=1433779534-32677-1-git-send-email-walfred.tedeschi@intel.com \
--to=walfred.tedeschi@intel.com \
--cc=brobecker@adacore.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