From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15353 invoked by alias); 30 Sep 2014 07:28:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 15339 invoked by uid 89); 30 Sep 2014 07:28:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mga03.intel.com Received: from mga03.intel.com (HELO mga03.intel.com) (134.134.136.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Sep 2014 07:28:38 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by orsmga103.jf.intel.com with ESMTP; 30 Sep 2014 00:26:22 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by azsmga001.ch.intel.com with ESMTP; 30 Sep 2014 00:28:34 -0700 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s8U7SXwH011061; Tue, 30 Sep 2014 08:28:33 +0100 Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id s8U7SXmO022458; Tue, 30 Sep 2014 09:28:33 +0200 Received: (from wtedesch@localhost) by ulvlx001.iul.intel.com with œ id s8U7SWK5022454; Tue, 30 Sep 2014 09:28:32 +0200 From: Walfred Tedeschi To: palves@redhat.com, mark.kettenis@xs4all.nl Cc: gdb-patches@sourceware.org, Walfred Tedeschi Subject: [PATCH] Fix MPX and AVX512 tests for path changes. Date: Tue, 30 Sep 2014 07:28:00 -0000 Message-Id: <1412062097-22417-1-git-send-email-walfred.tedeschi@intel.com> X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00865.txt.bz2 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 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 . */ -#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 . */ #include -#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