From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 476E93857809; Mon, 4 Apr 2022 08:56:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 476E93857809 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 KPASS in gdb.ada/arrayptr.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: cf78890fd449bedb7190d36ed1288187fb3e8bb2 X-Git-Newrev: cbf26882c0cafe85e309376d9883a93a0fbc3180 Message-Id: <20220404085655.476E93857809@sourceware.org> Date: Mon, 4 Apr 2022 08:56:55 +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: Mon, 04 Apr 2022 08:56:55 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dcbf26882c0ca= fe85e309376d9883a93a0fbc3180 commit cbf26882c0cafe85e309376d9883a93a0fbc3180 Author: Tom de Vries Date: Mon Apr 4 10:56:51 2022 +0200 [gdb/testsuite] Fix KPASS in gdb.ada/arrayptr.exp =20 On openSUSE Leap 15.3 I run into: ... KPASS: gdb.ada/arrayptr.exp: scenario=3Dminimal: print pa_ptr.all \ (PRMS minimal encodings) KPASS: gdb.ada/arrayptr.exp: scenario=3Dminimal: print pa_ptr(3) \ (PRMS minimal encodings) KPASS: gdb.ada/arrayptr.exp: scenario=3Dminimal: print pa_ptr.all(3) \ (PRMS minimal encodings) ... =20 The test-case KFAILs some tests. However, the analysis in the correspo= nding PR talks of a compiler problem, so it should use XFAILs instead. =20 The KFAILs are setup for pre-gcc-12, but apparantly the fix has been backported to system compiler 7.5.0, hence the KPASS. =20 Fix this by: - using an XFAIL instead of a KFAIL - matching the specific gdb output that corresponds to the XFAILs (reproduced on Fedora 34). =20 Tested on x86_64-linux, specifically openSUSE Leap 15.3 and Fedora 34. Diff: --- gdb/testsuite/gdb.ada/arrayptr.exp | 61 ++++++++++++++++++++++++++++------= ---- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/gdb/testsuite/gdb.ada/arrayptr.exp b/gdb/testsuite/gdb.ada/arr= ayptr.exp index 23e89759666..c3fb5f3d647 100644 --- a/gdb/testsuite/gdb.ada/arrayptr.exp +++ b/gdb/testsuite/gdb.ada/arrayptr.exp @@ -49,27 +49,56 @@ foreach_with_prefix scenario {all minimal} { =20 gdb_test "ptype string_access" "=3D access array \\(<>\\) of character" =20 - set kfail_int128support_re \ - "That operation is not available on integers of more than 8 bytes\\." - set kfail_packed_array_range_re \ - "cannot subscript or call something of type `foo__packed_array_ptr'" - # GNAT >=3D 12.0 has the needed fix here. + set xfail_expected 0 if {$scenario =3D=3D "minimal" && ![test_compiler_info {gcc-1[2-9]-*}]= } { - setup_kfail "minimal encodings" *-*-* + set xfail_expected 1 } - gdb_test "print pa_ptr.all" \ - " =3D \\(10, 20, 30, 40, 50, 60, 62, 63, -23, 42\\)" =20 - # GNAT >=3D 12.0 has the needed fix here. - if {$scenario =3D=3D "minimal" && ![test_compiler_info {gcc-1[2-9]-*}]= } { - setup_kfail "minimal encodings" *-*-* + gdb_test_multiple "print pa_ptr.all" "" { + -re -wrap " =3D \\(10, 20, 30, 40, 50, 60, 62, 63, -23, 42\\)" { + pass $gdb_test_name + } + -re -wrap " =3D \[0-9\]+" { + if { $xfail_expected } { + xfail $gdb_test_name + } else { + fail $gdb_test_name + } + } } - gdb_test "print pa_ptr(3)" " =3D 30" =20 - # GNAT >=3D 12.0 has the needed fix here. - if {$scenario =3D=3D "minimal" && ![test_compiler_info {gcc-1[2-9]-*}]= } { - setup_kfail "minimal encodings" *-*-* + set xfail_cannot_subscript_re \ + "cannot subscript or call something of type `foo__packed_array_ptr'" + + gdb_test_multiple "print pa_ptr(3)" "" { + -re -wrap " =3D 30" { + pass $gdb_test_name + + } + -re -wrap $xfail_cannot_subscript_re { + if { $xfail_expected } { + xfail $gdb_test_name + } else { + fail $gdb_test_name + } + } + } + + set xfail_attempt_to_index_re \ + "Attempt to index or call something other than an array or function" + + gdb_test_multiple "print pa_ptr.all(3)" "" { + -re -wrap " =3D 30" { + pass $gdb_test_name + + } + -re -wrap $xfail_attempt_to_index_re { + if { $xfail_expected } { + xfail $gdb_test_name + } else { + fail $gdb_test_name + } + } } - gdb_test "print pa_ptr.all(3)" " =3D 30" }