From patchwork Wed Feb 19 11:57:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 38223 Received: (qmail 118740 invoked by alias); 19 Feb 2020 11:57:35 -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 118732 invoked by uid 89); 19 Feb 2020 11:57:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Feb 2020 11:57:33 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 36E19BA0D for ; Wed, 19 Feb 2020 11:57:31 +0000 (UTC) Date: Wed, 19 Feb 2020 12:57:29 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix xpass in gdb.python/lib-types.exp Message-ID: <20200219115728.GA20410@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, When running gdb.python/lib-types.exp, we have an xpass: ... (gdb) python print (str (typedef_const_typedef_class1_ref_obj.type))^M typedef_const_typedef_class1_ref^M (gdb) XPASS: gdb.python/lib-types.exp: \ python print (str (typedef_const_typedef_class1_ref_obj.type)) \ (PRMS gcc/55641) ... When running the same with gcc 4.8, we have an xfail instead: ... (gdb) python print (str (typedef_const_typedef_class1_ref_obj.type))^M const typedef_const_typedef_class1_ref^M (gdb) XFAIL: gdb.python/lib-types.exp: \ python print (str (typedef_const_typedef_class1_ref_obj.type)) \ (PRMS gcc/55641) ... It's incorrect to xfail a gdb test-case for gcc bug. Marking the test unsupported for older gcc instead is not necessary either: it's just that gdb prints different output when given different input, which is entirely expected behaviour. Fix this by passing for both patterns. Tested on x86_64-linux, with: - gcc 7.5.0 - gcc 4.8.5 - clang 5.0.2 OK for trunk? Thanks, - Tom [gdb/testsuite] Fix xpass in gdb.python/lib-types.exp gdb/testsuite/ChangeLog: 2020-02-19 Tom de Vries * gdb.python/lib-types.exp: Remove gcc/55641 xfail. --- gdb/testsuite/gdb.python/lib-types.exp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.python/lib-types.exp b/gdb/testsuite/gdb.python/lib-types.exp index ab1d9d8dad..779942ceae 100644 --- a/gdb/testsuite/gdb.python/lib-types.exp +++ b/gdb/testsuite/gdb.python/lib-types.exp @@ -103,8 +103,15 @@ gdb_test_multiple "python print (str (basic_type_typedef_const_typedef_class1_ob # test nested typedef/reference stripping gdb_test_no_output "python typedef_const_typedef_class1_ref_obj = gdb.parse_and_eval ('typedef_const_typedef_class1_ref_obj')" gdb_test_no_output "python basic_type_typedef_const_typedef_class1_ref_obj = gdb.types.get_basic_type (typedef_const_typedef_class1_ref_obj.type)" -if {[test_compiler_info {gcc-*-*}]} { setup_xfail gcc/55641 *-*-* } -gdb_test "python print (str (typedef_const_typedef_class1_ref_obj.type))" "\[\r\n\]+typedef_const_typedef_class1_ref" +gdb_test_multiple "python print (str (typedef_const_typedef_class1_ref_obj.type))" "" { + -re -wrap "\[\r\n\]+const typedef_const_typedef_class1_ref" { + # Compiler with PR gcc/55641. + pass $gdb_test_name + } + -re -wrap "\[\r\n\]+typedef_const_typedef_class1_ref" { + pass $gdb_test_name + } +} set test "nested typedef/ref stripping" gdb_test_multiple "python print (str (basic_type_typedef_const_typedef_class1_ref_obj))" $test { -re "\[\r\n\]+class1\[\r\n\]+$gdb_prompt $" {