From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 05285386F0EA; Fri, 10 Jun 2022 06:59:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05285386F0EA 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 XPASS with gcc-12 in gdb.base/vla-struct-fields.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 84860e85919f7f09328ae1f84303435ff2e6ee64 X-Git-Newrev: 6a72edd8e26c670bbdce7aeae3c0c8f793fc8612 Message-Id: <20220610065909.05285386F0EA@sourceware.org> Date: Fri, 10 Jun 2022 06:59:09 +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: Fri, 10 Jun 2022 06:59:09 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6a72edd8e26c= 670bbdce7aeae3c0c8f793fc8612 commit 6a72edd8e26c670bbdce7aeae3c0c8f793fc8612 Author: Tom de Vries Date: Fri Jun 10 08:59:05 2022 +0200 [gdb/testsuite] Fix XPASS with gcc-12 in gdb.base/vla-struct-fields.exp =20 With gcc-12, I get for test-case gdb.base/vla-struct-fields.exp: ... (gdb) print inner_vla_struct_object_size =3D=3D sizeof(inner_vla_struct= _object)^M $7 =3D 1^M (gdb) XPASS: gdb.base/vla-struct-fields.exp: size of inner_vla_struct_o= bject ... =20 Fix this by limiting the xfailing to gcc-11 and earlier. Also, limit t= he xfailing to the equality test. =20 Tested on x86_64-linux. Diff: --- gdb/testsuite/gdb.base/vla-struct-fields.exp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.base/vla-struct-fields.exp b/gdb/testsuite/g= db.base/vla-struct-fields.exp index 384d6881779..eeee6b8d6a1 100644 --- a/gdb/testsuite/gdb.base/vla-struct-fields.exp +++ b/gdb/testsuite/gdb.base/vla-struct-fields.exp @@ -60,8 +60,20 @@ gdb_test "print vla_struct_object_size =3D=3D sizeof(vla= _struct_object)" \ gdb_test "print vla_union_object_size =3D=3D sizeof(vla_union_object)" \ " =3D 1" "size of vla_union_object" =20 -# Fails due to incorrect debugging information generated by GCC. -setup_xfail "*-*-*" -gdb_test \ - "print inner_vla_struct_object_size =3D=3D sizeof(inner_vla_struct_obj= ect)" \ - " =3D 1" "size of inner_vla_struct_object" +set a -1 +gdb_test_multiple "print inner_vla_struct_object_size" "" { + -re -wrap " =3D ($decimal)" { + set a $expect_out(1,string) + } +} +set b -1 +gdb_test_multiple "print sizeof(inner_vla_struct_object)" "" { + -re -wrap " =3D ($decimal)" { + set b $expect_out(1,string) + } +} +if { [test_compiler_info "gcc-*"] && [gcc_major_version] <=3D 11 } { + # Fails due to incorrect debugging information generated by GCC. + setup_xfail "*-*-*" +} +gdb_assert {$a =3D=3D $b} "size of inner_vla_struct_object"