From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125381 invoked by alias); 8 Jun 2015 16:06:03 -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 125306 invoked by uid 89); 8 Jun 2015 16:06:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mga02.intel.com Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 Jun 2015 16:05:53 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 08 Jun 2015 09:05:51 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 08 Jun 2015 09:05:50 -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 t58G5n7C022352; Mon, 8 Jun 2015 17:05:49 +0100 Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id t58G5nLQ000371; Mon, 8 Jun 2015 18:05:49 +0200 Received: (from wtedesch@localhost) by ulvlx001.iul.intel.com with œ id t58G5nxH000367; Mon, 8 Jun 2015 18:05:49 +0200 From: Walfred Tedeschi To: brobecker@adacore.com Cc: gdb-patches@sourceware.org, Walfred Tedeschi Subject: [PATCH v3] Improve test for processor feature om MPX registers test. Date: Mon, 08 Jun 2015 16:06:00 -0000 Message-Id: <1433779534-32677-1-git-send-email-walfred.tedeschi@intel.com> X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00113.txt.bz2 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 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