From patchwork Thu Jul 30 19:02:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 7942 Received: (qmail 60642 invoked by alias); 30 Jul 2015 19:04:27 -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 60633 invoked by uid 89); 30 Jul 2015 19:04:26 -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 19:04:24 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1ZKt7t-0007Tn-NI from Sandra_Loosemore@mentor.com for gdb-patches@sourceware.org; Thu, 30 Jul 2015 12:04:21 -0700 Received: from [IPv6:::1] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.224.2; Thu, 30 Jul 2015 12:04:21 -0700 Message-ID: <55BA74C2.8050800@codesourcery.com> Date: Thu, 30 Jul 2015 13:02:26 -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: Subject: [committed, testsuite] Reapply fix for gdb.cp/var-tag.exp C++ failures I have reapplied this patch from last year; https://sourceware.org/ml/gdb-patches/2014-05/msg00480.html This fix was lost when the change that added the gdb.cp/var-tag.exp testcase was reverted and then restored again a few months ago. In the restored version of the testcase, there were 12 FAILs fixed by this patch, rather than 9 as previously reported in the original version: FAIL: gdb.cp/var-tag.exp: before start: c++: ptype E FAIL: gdb.cp/var-tag.exp: before start: c++: ptype ee FAIL: gdb.cp/var-tag.exp: before start: c++: ptype EE FAIL: gdb.cp/var-tag.exp: before start: c++: ptype E2 FAIL: gdb.cp/var-tag.exp: in main: c++: ptype E FAIL: gdb.cp/var-tag.exp: in main: c++: ptype ee FAIL: gdb.cp/var-tag.exp: in main: c++: ptype EE FAIL: gdb.cp/var-tag.exp: in main: c++: ptype E2 FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype E FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype ee FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype EE FAIL: gdb.cp/var-tag.exp: in C::f: c++: ptype E2 -Sandra 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 "" + 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 +53,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" "= {.*}"