public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Bruno Larsen <blarsen@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb/testsuite: allow for Clang style destructors on gdb.cp/m-static.exp
Date: Fri, 11 Nov 2022 09:17:27 +0000 (GMT)	[thread overview]
Message-ID: <20221111091727.972A53858404@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f2f2eb6b0e77eebbbe06a2515053dc874598bee9

commit f2f2eb6b0e77eebbbe06a2515053dc874598bee9
Author: Bruno Larsen <blarsen@redhat.com>
Date:   Fri Sep 9 15:56:25 2022 +0200

    gdb/testsuite: allow for Clang style destructors on gdb.cp/m-static.exp
    
    when running gdb.cp/m-static.exp using Clang, we get the following
    failures:
    
        print test1.~gnu_obj_1^M
        $6 = {void (gnu_obj_1 * const)} 0x555555555470 <gnu_obj_1::~gnu_obj_1()>^M
        (gdb) FAIL: gdb.cp/m-static.exp: simple object instance, print destructor
        ptype test1.~gnu_obj_1^M
        type = void (gnu_obj_1 * const)^M
        (gdb) FAIL: gdb.cp/m-static.exp: simple object instance, ptype destructor
        print test1.'~gnu_obj_1'^M
        $7 = {void (gnu_obj_1 * const)} 0x555555555470 <gnu_obj_1::~gnu_obj_1()>^M
        (gdb) FAIL: gdb.cp/m-static.exp: simple object instance, print quoted destructor
    
    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.
    
    Approved-by: Tom Tromey <tom@tromey.com>

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-static.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 = void \(single_constructor \* const\)} \
 	"simple object class, ptype constructor"
 
-    gdb_test "print test1.~gnu_obj_1" \
-	{ = {void \(gnu_obj_1 \* const, int\)} 0x[0-9a-f]+ <gnu_obj_1::~gnu_obj_1\(\)>} \
+    gdb_test "print test1.~gnu_obj_1"\
+	{ = {void \(gnu_obj_1 \* const(?:, int)?\)} 0x[0-9a-f]+ <gnu_obj_1::~gnu_obj_1\(\)>}\
 	"simple object instance, print destructor"
-    gdb_test "ptype test1.~gnu_obj_1" \
-	{type = void \(gnu_obj_1 \* const, int\)} \
+
+    gdb_test "ptype test1.~gnu_obj_1"\
+	{type = void \(gnu_obj_1 \* const(?:, int)?\)}\
 	"simple object instance, ptype destructor"
 
     gdb_test "print test1.'~gnu_obj_1'" \
-	{ = {void \(gnu_obj_1 \*( const)?, int\)} 0x[0-9a-f]+ <gnu_obj_1::~gnu_obj_1\(\)>} \
+	{ = {void \(gnu_obj_1 \*( const)?(?:, int)?\)} 0x[0-9a-f]+ <gnu_obj_1::~gnu_obj_1\(\)>} \
 	"simple object instance, print quoted destructor"
 
     gdb_test "ptype gnu_obj_1::'~gnu_obj_1'" \

                 reply	other threads:[~2022-11-11  9:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221111091727.972A53858404@sourceware.org \
    --to=blarsen@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).