From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id F1CF5385D0C0 for ; Wed, 26 Oct 2022 13:04:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F1CF5385D0C0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666789477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hZUMt3gosQpUB6A7PILla0h2yaPbcLHo4SnfsH76LHg=; b=TjEveWc/ZZ0UkULOyYqB5x98aGBIJf9LYs8NRE47RjmQKnX6HtQTcliQEAW/+qUE4U+X9E WzNQkZmygy5ubAbrpxbi42sOxp7LUC0Jkzbn5CF8KKhJDr1VVeKqtqN/hWz4olOSrpbfDU x37NwIxJi/ZxrO0efbgR5g2jwCTokO4= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-124-QxtP_2FnMcyB2p714CWNRw-1; Wed, 26 Oct 2022 09:04:36 -0400 X-MC-Unique: QxtP_2FnMcyB2p714CWNRw-1 Received: by mail-wr1-f69.google.com with SMTP id p7-20020adfba87000000b0022cc6f805b1so6039753wrg.21 for ; Wed, 26 Oct 2022 06:04:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hZUMt3gosQpUB6A7PILla0h2yaPbcLHo4SnfsH76LHg=; b=UrOQe84xepAT1J+TvZgEEGyYiaPFHJUj5ALi8ObRKBFOFM3vFvpxEJYd0TWa+RDZ/A N780WHkAwiSuGXmlzatrW96i3eBkwiFO7bItkr7jPRH5NDDbhqgKbGEQDUX0JUwfzum/ io5Iui93QVBs1AfNBFczMo8+hyqP96Jg1d7QfXneVZXnSJo2Q8jb/RCnqczz0WYOjxct +JPQ23mx2amLptf38arwnON0kBqnYBnw4KzPVWsEbC8a/NqUu8s/Oc+jHrZRal66aKA6 JFLgqS+xLrJZfstRIjdI6LV22HjToRe468GdrEDsKVB20B+zfq/uBzTl7yLoQoBjTZuj xNZw== X-Gm-Message-State: ACrzQf0kGFMtcez7wYkgHWTIDJkaAj5vYuyRcM/h6lSGZs9VuLUu5Rfx ZH0cN0c3aSOX5UhmHOgD3dnPqgL3SSOtM05557B+dSYSbe1tsuk2j3Z93rPbEhVBbXS7t9HJGZ8 9SQnpe53qZofEWifcwgDpxg== X-Received: by 2002:a5d:5a18:0:b0:22f:4f72:213a with SMTP id bq24-20020a5d5a18000000b0022f4f72213amr29554781wrb.57.1666789474938; Wed, 26 Oct 2022 06:04:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6CgiK1eWX/lb/vG2dQ6AoRcUWT1ET8XHCC3xyMUfhQSGxDSLnGPjGOvOJDOfK6pDsx7WiLpw== X-Received: by 2002:a5d:5a18:0:b0:22f:4f72:213a with SMTP id bq24-20020a5d5a18000000b0022f4f72213amr29554761wrb.57.1666789474677; Wed, 26 Oct 2022 06:04:34 -0700 (PDT) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id bg33-20020a05600c3ca100b003a6125562e1sm1842134wmb.46.2022.10.26.06.04.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:04:34 -0700 (PDT) From: Andrew Burgess To: Bruno Larsen , gdb-patches@sourceware.org Subject: Re: [PATCH 05/11] gdb/testsuite: allow for clang style destructors on gdb.cp/m-static.exp In-Reply-To: <20221004170747.154307-7-blarsen@redhat.com> References: <20221004170747.154307-1-blarsen@redhat.com> <20221004170747.154307-7-blarsen@redhat.com> Date: Wed, 26 Oct 2022 14:04:33 +0100 Message-ID: <875yg67n32.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Bruno Larsen via Gdb-patches writes: > 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 ^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 ^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. > --- > gdb/testsuite/gdb.cp/m-static.exp | 36 ++++++++++++++++++++++--------- > 1 file changed, 26 insertions(+), 10 deletions(-) > > diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp > index 979de23a44f..332e1cbe1f9 100644 > --- a/gdb/testsuite/gdb.cp/m-static.exp > +++ b/gdb/testsuite/gdb.cp/m-static.exp > @@ -102,16 +102,32 @@ 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]+ } \ > - "simple object instance, print destructor" Rather than switching to gdb_test_multiple, it might be better to just update the regexp, like: { = {void \(gnu_obj_1 \* const(?:, int)?\)} 0x[0-9a-f]+ } We already use something like this (though without the '?:' modifier) in one of the tests below, so I think there's precedent. Thanks, Andrew > - 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]+ } \ > - "simple object instance, print quoted destructor" > + gdb_test_multiple "print test1.~gnu_obj_1" "simple object instance, print destructor" { > + -re -wrap { = {void \(gnu_obj_1 \* const, int\)} 0x[0-9a-f]+ } { > + pass $gdb_test_name > + } > + -re -wrap { = {void \(gnu_obj_1 \* const\)} 0x[0-9a-f]+ } { > + pass $gdb_test_name > + } > + } > + > + gdb_test_multiple "ptype test1.~gnu_obj_1" "simple object instance, ptype destructor" { > + -re -wrap {type = void \(gnu_obj_1 \* const, int\)} { > + pass $gdb_test_name > + } > + -re -wrap {type = void \(gnu_obj_1 \* const\)} { > + pass $gdb_test_name > + } > + } > + > + gdb_test_multiple "print test1.'~gnu_obj_1'" "simple object instance, print quoted destructor" { > + -re -wrap { = {void \(gnu_obj_1 \*( const)?, int\)} 0x[0-9a-f]+ } { > + pass $gdb_test_name > + } > + -re -wrap { = {void \(gnu_obj_1 \*( const)?\)} 0x[0-9a-f]+ } { > + pass $gdb_test_name > + } > + } > > gdb_test "ptype gnu_obj_1::'~gnu_obj_1'" \ > {type = void \(gnu_obj_1 \* const\)} \ > -- > 2.37.3