From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7862) id 972A53858404; Fri, 11 Nov 2022 09:17:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 972A53858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668158247; bh=rfGW8qSVPzpMCtWwjrmi9GEBJalkg6X0t0kMHI/E5yY=; h=From:To:Subject:Date:From; b=IMyyaYP3H3QbSTjjs6qVpN0nHUSKYlIxtpGdqkm19rYH8iF66NLBBvqqgoOxoI9NO 5XrsPRb1umHvTSQqSXg27ojlQLvHTa5Mce4RiW+j5N7GRJUN5xI/6u4w55mcUmZS5E hOTOT/+cTdXQ8DCxUkpsqAAvCUnPHjzgZgry2l4g= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Bruno Larsen To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: allow for Clang style destructors on gdb.cp/m-static.exp X-Act-Checkin: binutils-gdb X-Git-Author: Bruno Larsen X-Git-Refname: refs/heads/master X-Git-Oldrev: 42dde3f3643cdf372b8f40beafa3f2c888aaf92a X-Git-Newrev: f2f2eb6b0e77eebbbe06a2515053dc874598bee9 Message-Id: <20221111091727.972A53858404@sourceware.org> Date: Fri, 11 Nov 2022 09:17:27 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df2f2eb6b0e77= eebbbe06a2515053dc874598bee9 commit f2f2eb6b0e77eebbbe06a2515053dc874598bee9 Author: Bruno Larsen Date: Fri Sep 9 15:56:25 2022 +0200 gdb/testsuite: allow for Clang style destructors on gdb.cp/m-static.exp =20 when running gdb.cp/m-static.exp using Clang, we get the following failures: =20 print test1.~gnu_obj_1^M $6 =3D {void (gnu_obj_1 * const)} 0x555555555470 ^M (gdb) FAIL: gdb.cp/m-static.exp: simple object instance, print dest= ructor ptype test1.~gnu_obj_1^M type =3D void (gnu_obj_1 * const)^M (gdb) FAIL: gdb.cp/m-static.exp: simple object instance, ptype dest= ructor print test1.'~gnu_obj_1'^M $7 =3D {void (gnu_obj_1 * const)} 0x555555555470 ^M (gdb) FAIL: gdb.cp/m-static.exp: simple object instance, print quot= ed destructor =20 This is because the test is expecting an extra integer parameter on the destructor. Looking at the debuginfo, it seems that there is nothing actually wrong with this output, so these tests were changed to test multiple possible regexps. =20 Approved-by: Tom Tromey Diff: --- gdb/testsuite/gdb.cp/m-static.exp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-sta= tic.exp index 979de23a44f..1239dbc0f1d 100644 --- a/gdb/testsuite/gdb.cp/m-static.exp +++ b/gdb/testsuite/gdb.cp/m-static.exp @@ -102,15 +102,16 @@ if { [is_aarch32_target] } { {type =3D void \(single_constructor \* const\)} \ "simple object class, ptype constructor" =20 - gdb_test "print test1.~gnu_obj_1" \ - { =3D {void \(gnu_obj_1 \* const, int\)} 0x[0-9a-f]+ } \ + gdb_test "print test1.~gnu_obj_1"\ + { =3D {void \(gnu_obj_1 \* const(?:, int)?\)} 0x[0-9a-f]+ }\ "simple object instance, print destructor" - gdb_test "ptype test1.~gnu_obj_1" \ - {type =3D void \(gnu_obj_1 \* const, int\)} \ + + gdb_test "ptype test1.~gnu_obj_1"\ + {type =3D void \(gnu_obj_1 \* const(?:, int)?\)}\ "simple object instance, ptype destructor" =20 gdb_test "print test1.'~gnu_obj_1'" \ - { =3D {void \(gnu_obj_1 \*( const)?, int\)} 0x[0-9a-f]+ } \ + { =3D {void \(gnu_obj_1 \*( const)?(?:, int)?\)} 0x[0-9a-f]+ } \ "simple object instance, print quoted destructor" =20 gdb_test "ptype gnu_obj_1::'~gnu_obj_1'" \