From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id A9B6C3858D38; Mon, 25 Mar 2024 14:28:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9B6C3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1711376925; bh=qo5v058Qy2F1Pc+DmEuczEltAZ6jV+XAew0zAD6NRRM=; h=From:To:Subject:Date:From; b=lFmtKQLfRmTjUGodWXLEUE8LwX6VlTBnpFKB2FBAg6EXs5rDYQoQVttgg2QqP8Qbn MPKSY2HhpTUyZ5RWhQ8RAw1MyOGgSb74iuHBoSQCQfN9eCfMdFTa8kjhbNTNeC1KJ+ VvmJQqi4JDN9XHAnuaTpQE55EdmumpYIGXOlr9lc= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.ada/tagged-lookup.exp with gcc <= 12 X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 61ced226a4fc2e6df7836cd9c0f7e1ad47af2440 X-Git-Newrev: 874f4887f0361e953f7098459ae60a5f894d362a Message-Id: <20240325142845.A9B6C3858D38@sourceware.org> Date: Mon, 25 Mar 2024 14:28:45 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D874f4887f036= 1e953f7098459ae60a5f894d362a commit 874f4887f0361e953f7098459ae60a5f894d362a Author: Tom de Vries Date: Mon Mar 25 15:28:35 2024 +0100 [gdb/testsuite] Fix gdb.ada/tagged-lookup.exp with gcc <=3D 12 =20 With gcc 13, test-case gdb.ada/tagged-lookup.exp passes for me, but wit= h gcc 12, I get: ... (gdb) set debug symtab-create 1^M (gdb) print *the_local_var^M ... $1 =3D (n =3D> 2)^M (gdb) FAIL: gdb.ada/tagged-lookup.exp: only one CU expanded ... =20 The problem is that this fails: ... -re -wrap ".* =3D \\\(n =3D> $decimal\\\)" { if {$found_pck + $found_pck2 =3D=3D 1} { pass $gdb_test_name } else { fail $gdb_test_name } ... because $found_pck =3D=3D 0 and $found_pck2 =3D=3D 0. =20 Indeed, with gcc 13 we have: ... $ grep "start_subfile: name =3D .*/tagged-lookup/" gdb.log | sed 's%.*/= %%' b~foo.adb b~foo.adb b~foo.adb b~foo.ads pck2.adb pck2.adb pck2.ads pck2.adb pck2.ads ... and with gcc 12: ... $ grep "start_subfile: name =3D .*/tagged-lookup/" gdb.log | sed 's%.*/= %%' b~foo.adb b~foo.adb b~foo.adb b~foo.ads ... =20 Fix this by checking for "$found_pck + $found_pck2 <=3D 1" instead. =20 Tested on x86_64-linux. =20 Approved-By: Tom Tromey =20 PR testsuite/31514 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31514 Diff: --- gdb/testsuite/gdb.ada/tagged-lookup.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.ada/tagged-lookup.exp b/gdb/testsuite/gdb.ad= a/tagged-lookup.exp index 4bc088ba8d5..3803319c505 100644 --- a/gdb/testsuite/gdb.ada/tagged-lookup.exp +++ b/gdb/testsuite/gdb.ada/tagged-lookup.exp @@ -52,7 +52,7 @@ gdb_test_multiple "print *the_local_var" "only one CU exp= anded" -lbl { exp_continue } -re -wrap ".* =3D \\\(n =3D> $decimal\\\)" { - if {$found_pck + $found_pck2 =3D=3D 1} { + if {$found_pck + $found_pck2 <=3D 1} { pass $gdb_test_name } else { fail $gdb_test_name