From patchwork Thu Jul 30 21:24:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 7944 Received: (qmail 10449 invoked by alias); 30 Jul 2015 21:26:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 10389 invoked by uid 89); 30 Jul 2015 21:26:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 Jul 2015 21:26:29 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1ZKvLO-0000k5-4P from Sandra_Loosemore@mentor.com ; Thu, 30 Jul 2015 14:26:26 -0700 Received: from [IPv6:::1] (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.224.2; Thu, 30 Jul 2015 14:26:25 -0700 Message-ID: <55BA960F.7020508@codesourcery.com> Date: Thu, 30 Jul 2015 15:24:31 -0600 From: Sandra Loosemore User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Keith Seitz CC: Subject: Re: [committed, testsuite] Reapply fix for gdb.cp/var-tag.exp C++ failures References: <55BA74C2.8050800@codesourcery.com> <55BA8F8C.8080301@redhat.com> In-Reply-To: <55BA8F8C.8080301@redhat.com> On 07/30/2015 02:56 PM, Keith Seitz wrote: > On 07/30/2015 12:02 PM, Sandra Loosemore wrote: > >> diff --git a/gdb/testsuite/gdb.cp/var-tag.exp b/gdb/testsuite/gdb.cp/var-tag.exp >> index 30aab99..60379e9 100644 >> --- a/gdb/testsuite/gdb.cp/var-tag.exp >> +++ b/gdb/testsuite/gdb.cp/var-tag.exp >> @@ -28,13 +28,18 @@ if {[prepare_for_testing $testfile.exp $testfile \ >> >> proc do_global_tests {lang} { >> set invalid_print "Attempt to use a type name as an expression" >> - set ptypefmt "type = (class|enum|union|struct) %s {.*}" >> + >> + if {$lang == "c++"} { >> + set opt_underlying "(: unsigned int )?" >> + } else { >> + set opt_underlying "" > > Missing '}' ? Oh, argh. I had fixed this in the local GIT branch I'm using for testing, and then applied the wrong version of the patch to the master branch to check in. Here is the correct patch; I hope I've fixed this up correctly on master now. -Sandra diff --git a/gdb/testsuite/gdb.cp/var-tag.exp b/gdb/testsuite/gdb.cp/var-tag.exp index 30aab99..71d9237 100644 --- a/gdb/testsuite/gdb.cp/var-tag.exp +++ b/gdb/testsuite/gdb.cp/var-tag.exp @@ -28,13 +28,19 @@ if {[prepare_for_testing $testfile.exp $testfile \ proc do_global_tests {lang} { set invalid_print "Attempt to use a type name as an expression" - set ptypefmt "type = (class|enum|union|struct) %s {.*}" + + if {$lang == "c++"} { + set opt_underlying "(: unsigned int )?" + } else { + set opt_underlying "" + } + set ptypefmt "type = (class|enum|union|struct) %s $opt_underlying{.*}" with_test_prefix $lang { gdb_test_no_output "set language $lang" gdb_test "ptype C" "type = class C {.*}" gdb_test "print E" "= a" - gdb_test "ptype E" "type = enum E {.*}" + gdb_test "ptype E" "type = enum E $opt_underlying{.*}" gdb_test "print S" "= {}" gdb_test "ptype S" "type = struct S {.*}" gdb_test "print U" "= {.*}" @@ -48,7 +54,7 @@ proc do_global_tests {lang} { gdb_test "print SS" [format $invalid_print "SS"] gdb_test "ptype SS" [format $ptypefmt "SS"] gdb_test "print ee" "= .*" - gdb_test "ptype ee" "type = enum EE {.*}" + gdb_test "ptype ee" "type = enum EE $opt_underlying{.*}" gdb_test "print EE" [format $invalid_print "EE"] gdb_test "ptype EE" [format $ptypefmt "EE"] gdb_test "print uu" "= {.*}" @@ -60,7 +66,7 @@ proc do_global_tests {lang} { # Each of them is in a separate CU as once its CU is expanded, # we're no longer using the quick fns API. gdb_test "print E2" "= a2" - gdb_test "ptype E2" "type = enum E2 {.*}" + gdb_test "ptype E2" "type = enum E2 $opt_underlying{.*}" gdb_test "print S2" "= {}" gdb_test "ptype S2" "type = struct S2 {.*}" gdb_test "print U2" "= {.*}"