From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 498C0385BF81; Wed, 8 Apr 2020 04:57:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 498C0385BF81 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Add gcc/94469 xfails to gdb.ada/call_pn.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: cc9411f8dca2720638e3d06df9d551ab028f48fd X-Git-Newrev: e21d048f8ad95002e61aec25160fa6fabfab21a4 Message-Id: <20200408045759.498C0385BF81@sourceware.org> Date: Wed, 8 Apr 2020 04:57:59 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2020 04:57:59 -0000 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e21d048f8ad95002e61aec25160fa6fabfab21a4 commit e21d048f8ad95002e61aec25160fa6fabfab21a4 Author: Tom de Vries Date: Wed Apr 8 06:57:56 2020 +0200 [gdb/testsuite] Add gcc/94469 xfails to gdb.ada/call_pn.exp When running test-case gdb.ada/call_pn.exp with target board unix/-flto/-O0/-flto-partition=none/-ffat-lto-objects, we run into: ... (gdb) print last_node_id^M Multiple matches for last_node_id^M [0] cancel^M [1] pck.last_node_id at gdb/testsuite/gdb.ada/call_pn/pck.adb:17^M [2] pck.last_node_id at gdb/testsuite/gdb.ada/call_pn/foo.adb:17^M > FAIL: gdb.ada/call_pn.exp: print last_node_id after calling pn (timeout) ... This failure is due to a gcc bug that declares two instead of one symbols, filed as PR gcc/94469. Add an xfail at this test. Also add a similar xfail at an earlier test, that only triggers with -readnow. Stabilize test results by making sure the earlier xfail is always triggered, using "maint expand-symtabs". Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-04-08 Tom de Vries PR testsuite/25760 * gdb.ada/call_pn.exp: Call "maint expand-symtabs". Add xfails. Diff: --- gdb/testsuite/ChangeLog | 5 ++++ gdb/testsuite/gdb.ada/call_pn.exp | 50 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 8c2ace4e538..066a41ec5bb 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-04-08 Tom de Vries + + PR testsuite/25760 + * gdb.ada/call_pn.exp: Call "maint expand-symtabs". Add xfails. + 2020-04-07 Tom de Vries PR symtab/25796 diff --git a/gdb/testsuite/gdb.ada/call_pn.exp b/gdb/testsuite/gdb.ada/call_pn.exp index b21de4da7c0..1fe133fe7b5 100644 --- a/gdb/testsuite/gdb.ada/call_pn.exp +++ b/gdb/testsuite/gdb.ada/call_pn.exp @@ -29,8 +29,41 @@ if ![runto "foo.adb:$bp_location" ] then { return } +# The xfail mentioned below triggers for the "after" print, but may not +# trigger for the "before" print, though it will for -readnow. This is +# related to PR25764 - "LOC_UNRESOLVED symbol missing from partial symtab". +# Stabilize test results by ensuring that the xfail triggers for the "before" +# print. +gdb_test_no_output "maint expand-symtabs" + +# The xfail is for PR gcc/94469, which occurs with target board +# unix/-flto/-O0/-flto-partition=none/-ffat-lto-objects and gcc-8 and later. +# Note: We don't check for the filename in xfail_re because it might be +# wrong, filed as gdb PR25771. +set xfail_re \ + [multi_line \ + "Multiple matches for last_node_id" \ + "\\\[0\\\] cancel" \ + "\\\[1\\\] pck\.last_node_id at .*.adb:17" \ + "\\\[2\\\] pck\.last_node_id at .*.adb:17" \ + "> $"] + # Make sure that last_node_id is set to zero... -gdb_test "print last_node_id" "= 0" "print last_node_id before calling pn" +gdb_test_multiple "print last_node_id" "print last_node_id before calling pn" { + -re $xfail_re { + xfail $gdb_test_name + # One of the choices will print the correct value, the other one + # . Since we don't known which one to choose to get + # the correct value, cancel. + gdb_test_multiple "0" "cancel after xfail 1" { + -re -wrap "cancelled" { + } + } + } + -re -wrap "= 0" { + pass $gdb_test_name + } +} # Now, call procedure Pn, which should set Last_Node_Id to the value # of the parameter used in the function call. Verify that we can print @@ -38,5 +71,16 @@ gdb_test "print last_node_id" "= 0" "print last_node_id before calling pn" gdb_test "print pn (4321)" "= 4321" # Make sure that last_node_id now has the correct value... -gdb_test "print last_node_id" "= 4321" "print last_node_id after calling pn" - +gdb_test_multiple "print last_node_id" "print last_node_id after calling pn" { + -re $xfail_re { + xfail $gdb_test_name + # Cancel + gdb_test_multiple "0" "cancel after xfail 2" { + -re -wrap "cancelled" { + } + } + } + -re -wrap "= 4321" { + pass $gdb_test_name + } +}