From patchwork Tue Feb 18 14:21:22 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: 38211 Received: (qmail 94584 invoked by alias); 18 Feb 2020 14:21:30 -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 94572 invoked by uid 89); 18 Feb 2020 14:21:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 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=world!, xfail, XFAIL, UD:bar 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; Tue, 18 Feb 2020 14:21:26 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D14D569943 for ; Tue, 18 Feb 2020 14:21:23 +0000 (UTC) Date: Tue, 18 Feb 2020 15:21:22 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix funcall_ref.exp xpass Message-ID: <20200218142054.GA23157@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, When running gdb.ada/funcall_ref.exp I run into two XPASSes: ... (gdb) p get ("Hello world!")^M $1 = (n => 12, s => "Hello world!")^M (gdb) XPASS: gdb.ada/funcall_ref.exp: p get ("Hello world!") ptype get ("Hello world!")^M type = record^M n: natural;^M s: access array (1 .. n) of character;^M end record^M (gdb) XPASS: gdb.ada/funcall_ref.exp: ptype get ("Hello world!") ... The xfails are documented in funcall_ref.exp: ... # Currently, GCC describes such functions as returning pointers (instead of # references). setup_xfail *-*-* ... Using gnatmake 4.8, we can reproduce the XFAILs: ... (gdb) p get ("Hello world!")^M $1 = (access foo.bar) 0x6147b0 ^M (gdb) XFAIL: gdb.ada/funcall_ref.exp: p get ("Hello world!") ptype get ("Hello world!")^M type = access record^M n: natural;^M s: access array (1 .. n) of character;^M end record^M (gdb) XFAIL: gdb.ada/funcall_ref.exp: ptype get ("Hello world!") ... Fix the XPASSes by: - removing the xfail setup - switching the order of the two tests - detecting the "access record" type and declaring the first test unsupported, and skipping the second test Tested on x86_64-linux, both with gnatmake 4.8.5 and gnatmake 7.5.0. OK for trunk? Thanks, - Tom [gdb/testsuite] Fix funcall_ref.exp xpass gdb/testsuite/ChangeLog: 2020-02-18 Tom de Vries * gdb.ada/funcall_ref.exp: Replace xfail setup by unsupported check. --- gdb/testsuite/gdb.ada/funcall_ref.exp | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/gdb/testsuite/gdb.ada/funcall_ref.exp b/gdb/testsuite/gdb.ada/funcall_ref.exp index 2992e56a20..02664f6ad3 100644 --- a/gdb/testsuite/gdb.ada/funcall_ref.exp +++ b/gdb/testsuite/gdb.ada/funcall_ref.exp @@ -32,13 +32,28 @@ runto "foo.adb:$bp_location" # Currently, GCC describes such functions as returning pointers (instead of # references). -setup_xfail *-*-* +set pass_re [multi_line "type = record" \ + " n: natural;" \ + " s: access array \\(1 \\.\\. n\\) of character;" \ + "end record"] +set unsupported_re [multi_line "type = access record" \ + " n: natural;" \ + " s: access array \\(1 \\.\\. n\\) of character;" \ + "end record"] +set supported 1 +gdb_test_multiple "ptype get (\"Hello world!\")" "" { + -re -wrap $pass_re { + pass $gdb_test_name + } + -re -wrap $unsupported_re { + unsupported $gdb_test_name + set supported 0 + } +} + +if { $supported == 0 } { + return 0 +} + gdb_test "p get (\"Hello world!\")" \ - "= \\(n => 12, s => \"Hello world!\"\\)" \ - -setup_xfail *-*-* -gdb_test "ptype get (\"Hello world!\")" \ - [multi_line "type = record" \ - " n: natural;" \ - " s: access array \\(1 \\.\\. n\\) of character;" \ - "end record"] \ + "= \\(n => 12, s => \"Hello world!\"\\)"