public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix MPX and AVX512 tests for path changes.
@ 2014-09-30  7:28 Walfred Tedeschi
  2014-11-23  3:42 ` Joel Brobecker
  0 siblings, 1 reply; 4+ messages in thread
From: Walfred Tedeschi @ 2014-09-30  7:28 UTC (permalink / raw)
  To: palves, mark.kettenis; +Cc: gdb-patches, Walfred Tedeschi

Changes on the path for i386-cpuid.h file lead to failure in compiling
tests for MPX and AVX512.  Conformity between both tests is also
addressed with this path.

2014-08-12  Walfred Tedeschi  <walfred.tedeschi@intel.com>

gdb/testsuite
	* gdb.arch/i386-avx512.c: Change path in include file.
	* gdb.arch/i386-mpx.c: Change path in include file.
	* gdb.arch/i386-avx512.exp: Change include dir path
	compilation flag.
	* gdb.arch/i386-mpx.exp: Change include dir path
	compilation flag.

---
 gdb/testsuite/gdb.arch/i386-avx512.c   |  2 +-
 gdb/testsuite/gdb.arch/i386-avx512.exp |  2 +-
 gdb/testsuite/gdb.arch/i386-mpx.c      | 22 +++++++++++----------
 gdb/testsuite/gdb.arch/i386-mpx.exp    | 35 ++++++++++++++++++++--------------
 4 files changed, 35 insertions(+), 26 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/i386-avx512.c b/gdb/testsuite/gdb.arch/i386-avx512.c
index 77fc347..77cdbec 100644
--- a/gdb/testsuite/gdb.arch/i386-avx512.c
+++ b/gdb/testsuite/gdb.arch/i386-avx512.c
@@ -17,7 +17,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include "nat/x86-cpuid.h"
+#include "x86-cpuid.h"
 
 typedef struct
 {
diff --git a/gdb/testsuite/gdb.arch/i386-avx512.exp b/gdb/testsuite/gdb.arch/i386-avx512.exp
index c30ff23..57d553e 100644
--- a/gdb/testsuite/gdb.arch/i386-avx512.exp
+++ b/gdb/testsuite/gdb.arch/i386-avx512.exp
@@ -26,7 +26,7 @@ if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } {
 
 standard_testfile
 
-set comp_flags "-mavx512f -I${srcdir}/../common"
+set comp_flags "-mavx512f -I${srcdir}/../nat"
 
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
      [list debug nowarnings additional_flags=${comp_flags}]] } {
diff --git a/gdb/testsuite/gdb.arch/i386-mpx.c b/gdb/testsuite/gdb.arch/i386-mpx.c
index 8e5096d..3d33b80 100644
--- a/gdb/testsuite/gdb.arch/i386-mpx.c
+++ b/gdb/testsuite/gdb.arch/i386-mpx.c
@@ -18,7 +18,8 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdio.h>
-#include "nat/x86-cpuid.h"
+#include "x86-cpuid.h"
+
 
 #ifndef NOINLINE
 #define NOINLINE __attribute__ ((noinline))
@@ -35,17 +36,18 @@ have_mpx (void)
     return 0;
 
   if ((ecx & bit_OSXSAVE) == bit_OSXSAVE)
-     {
-       if (__get_cpuid_max (0, NULL) < 7)
-         return 0;
+    {
+      if (__get_cpuid_max (0, NULL) < 7)
+	return 0;
 
-       __cpuid_count (7, 0, eax, ebx, ecx, edx);
+      __cpuid_count (7, 0, eax, ebx, ecx, edx);
 
-       if ((ebx & bit_MPX) == bit_MPX)
-	 return 1;
-       else
-	 return 0;
-     }
+      if ((ebx & bit_MPX) == bit_MPX)
+	return 1;
+      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 5ed89da..d56a4cc 100644
--- a/gdb/testsuite/gdb.arch/i386-mpx.exp
+++ b/gdb/testsuite/gdb.arch/i386-mpx.exp
@@ -22,10 +22,15 @@ if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } {
 
 standard_testfile
 
-set comp_flags "-fmpx -I${srcdir}/../common"
+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} \
- [list debug nowarnings additional_flags=${comp_flags}]] } {
+     [list debug nowarnings additional_flags=${comp_flags}]] } {
     return -1
 }
 
@@ -34,23 +39,25 @@ if ![runto_main] {
     return -1
 }
 
+set supports_mpx 0
+set test "probe MPX support"
 send_gdb "print have_mpx ()\r"
-gdb_expect {
-    -re ".. = 1\r\n$gdb_prompt " {
-        pass "check whether processor supports MPX"
-    }
-    -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"
+
+gdb_test_multiple "print have_mpx()" $test {
+    -re ".. = 1\r\n$gdb_prompt $" {
+        pass $test
+        set supports_mpx 1
     }
-    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\]+\\\}\\\}"
-- 
1.9.1

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

* Re: [PATCH] Fix MPX and AVX512 tests for path changes.
  2014-09-30  7:28 [PATCH] Fix MPX and AVX512 tests for path changes Walfred Tedeschi
@ 2014-11-23  3:42 ` Joel Brobecker
  2014-11-24 13:48   ` Tedeschi, Walfred
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2014-11-23  3:42 UTC (permalink / raw)
  To: Walfred Tedeschi; +Cc: palves, mark.kettenis, gdb-patches

Hello Walfred,

On Tue, Sep 30, 2014 at 09:28:17AM +0200, Walfred Tedeschi wrote:
> Changes on the path for i386-cpuid.h file lead to failure in compiling
> tests for MPX and AVX512.  Conformity between both tests is also
> addressed with this path.
> 
> 2014-08-12  Walfred Tedeschi  <walfred.tedeschi@intel.com>
> 
> gdb/testsuite
> 	* gdb.arch/i386-avx512.c: Change path in include file.
> 	* gdb.arch/i386-mpx.c: Change path in include file.
> 	* gdb.arch/i386-avx512.exp: Change include dir path
> 	compilation flag.
> 	* gdb.arch/i386-mpx.exp: Change include dir path
> 	compilation flag.

Overall, the changes look good. But would you mind please splitting
this patch into individual pieces. For instance, one patch to fix
i386-avx512.exp's build failure, one patch to fix i386-mpx.exp's
build failure, and then as many individual patches for the other
changes made for "conformity between both tests". I am 300 patches
behind on review and trying to spend this weekend catching up a bit,
so a more detailed explanation will help me, as well as anyone
going back in time trying to figure out why some changes were made.

Thank you!
-- 
Joel

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

* RE: [PATCH] Fix MPX and AVX512 tests for path changes.
  2014-11-23  3:42 ` Joel Brobecker
@ 2014-11-24 13:48   ` Tedeschi, Walfred
  2014-11-24 14:45     ` Joel Brobecker
  0 siblings, 1 reply; 4+ messages in thread
From: Tedeschi, Walfred @ 2014-11-24 13:48 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: palves, mark.kettenis, gdb-patches

Hello Joel,

Thanks a lot for your review!

Ok! I will proceed as you proposed!

Best regards,
-Fred

-----Original Message-----
From: Joel Brobecker [mailto:brobecker@adacore.com] 
Sent: Sunday, November 23, 2014 4:42 AM
To: Tedeschi, Walfred
Cc: palves@redhat.com; mark.kettenis@xs4all.nl; gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix MPX and AVX512 tests for path changes.

Hello Walfred,

On Tue, Sep 30, 2014 at 09:28:17AM +0200, Walfred Tedeschi wrote:
> Changes on the path for i386-cpuid.h file lead to failure in compiling 
> tests for MPX and AVX512.  Conformity between both tests is also 
> addressed with this path.
> 
> 2014-08-12  Walfred Tedeschi  <walfred.tedeschi@intel.com>
> 
> gdb/testsuite
> 	* gdb.arch/i386-avx512.c: Change path in include file.
> 	* gdb.arch/i386-mpx.c: Change path in include file.
> 	* gdb.arch/i386-avx512.exp: Change include dir path
> 	compilation flag.
> 	* gdb.arch/i386-mpx.exp: Change include dir path
> 	compilation flag.

Overall, the changes look good. But would you mind please splitting this patch into individual pieces. For instance, one patch to fix i386-avx512.exp's build failure, one patch to fix i386-mpx.exp's build failure, and then as many individual patches for the other changes made for "conformity between both tests". I am 300 patches behind on review and trying to spend this weekend catching up a bit, so a more detailed explanation will help me, as well as anyone going back in time trying to figure out why some changes were made.

Thank you!
--
Joel
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052

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

* Re: [PATCH] Fix MPX and AVX512 tests for path changes.
  2014-11-24 13:48   ` Tedeschi, Walfred
@ 2014-11-24 14:45     ` Joel Brobecker
  0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2014-11-24 14:45 UTC (permalink / raw)
  To: Tedeschi, Walfred; +Cc: palves, mark.kettenis, gdb-patches

> Thanks a lot for your review!
> Ok! I will proceed as you proposed!

You are very welcome. If you can remember, do Cc: me in your emails
to remind me that I already started reviewing your patches. I try
to follow up faster after the initial review.

Thank you,
-- 
Joel

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

end of thread, other threads:[~2014-11-24 14:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-30  7:28 [PATCH] Fix MPX and AVX512 tests for path changes Walfred Tedeschi
2014-11-23  3:42 ` Joel Brobecker
2014-11-24 13:48   ` Tedeschi, Walfred
2014-11-24 14:45     ` Joel Brobecker

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).