From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by sourceware.org (Postfix) with ESMTPS id 9AA7C3858430 for ; Thu, 31 Mar 2022 18:49:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9AA7C3858430 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f42.google.com with SMTP id d7so1019643wrb.7 for ; Thu, 31 Mar 2022 11:49:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=g17Cj1Mt8KvgOaqucv2XW716JVLSionB0eaPMWVaLbo=; b=hLJlffj+9ILNwAobyme+8TLa06k5spbLg+p1QMy7QwEJFAL+L9Pyw3oQBqN+bORj1K GVlSz7eyUvWQsADe2yb6pw0AUWGUn72OQEboX8D+K9UbIBu6iIt5D3dfT7iCuM9N23PH SklqQDSzjxIa/DHAeVcQ2cDNsTwYaVRZZS8ysxt53Tv4HGBVq+L43yrK0ux5aPKNLT4g NkroCfezm7KUaic1xsBDuQ9BDADDkqwgVtJ1+Rt/kdOei2HS2K1PvUn3GGZd4wYbQodK f//6sdXBZDrwtHIK4Yary/S96OusaL7gBbhGq93pBNtFRukGPFXfy3gKauK8Id/JbmTd P8rA== X-Gm-Message-State: AOAM530TcKg7gTw1gd7N8z1+41GlEU6i29Rxqyh51s9baDWrf2PaDZzQ VWmR/Z0vg52TrBYfiV77MR6BCW4TETV9xQ== X-Google-Smtp-Source: ABdhPJwSl2dUQ8dNPsoRPJb8UZGAWCDCAdlQHbo05xfzw2HGM2i0SbeehNQemgl878Tadyb1Yux4ww== X-Received: by 2002:a5d:61c4:0:b0:203:ee2c:e0aa with SMTP id q4-20020a5d61c4000000b00203ee2ce0aamr5247878wrv.101.1648752552527; Thu, 31 Mar 2022 11:49:12 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id o8-20020a5d6488000000b002051f1028f6sm232297wri.111.2022.03.31.11.49.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Mar 2022 11:49:11 -0700 (PDT) Message-ID: Date: Thu, 31 Mar 2022 19:49:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 09/11] gdb/testsuite: don't test gdb.base/msym-bp-shl with clang Content-Language: en-US To: Bruno Larsen , gdb-patches@sourceware.org References: <20220126195053.69559-1-blarsen@redhat.com> <20220126195053.69559-10-blarsen@redhat.com> <9c0115ea-7178-91ee-9614-586d243b578c@redhat.com> From: Pedro Alves In-Reply-To: <9c0115ea-7178-91ee-9614-586d243b578c@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, BODY_8BITS, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2022 18:49:15 -0000 On 2022-03-30 13:19, Bruno Larsen wrote: > On 3/2/22 16:33, Pedro Alves wrote: >> On 2022-01-26 19:50, Bruno Larsen via Gdb-patches wrote: >>> Clang will optimize away the static function in one of the files, and >>> the test is here to specifically test GDB's behavior when that function >>> is present, so it makes no sense to have this test run with that >>> compiler. >> >> Please expand this info to include a snippet of the failing test. >> Also, it's best if the the body of the commit log, doesn't assume the subject is read >> as part of it.  You will notice that if you read the body in isolation, without the >> subject line, and also without the diff context, the commit log is vague as is. > > Will do! Sorry for the delay, got sidetracked with another issue. > >> >>> --- >>>   gdb/testsuite/gdb.base/msym-bp-shl.exp | 7 +++++++ >>>   1 file changed, 7 insertions(+) >>> >>> diff --git a/gdb/testsuite/gdb.base/msym-bp-shl.exp b/gdb/testsuite/gdb.base/msym-bp-shl.exp >>> index 42adcb191dd..95d5c393505 100644 >>> --- a/gdb/testsuite/gdb.base/msym-bp-shl.exp >>> +++ b/gdb/testsuite/gdb.base/msym-bp-shl.exp >>> @@ -22,6 +22,13 @@ if {[skip_shlib_tests]} { >>>       return 0 >>>   } >>>   +# clang will optimize away the static foo, making a single breakpoint >>> +# so there is no point testing it here. >> >> Uppercase Clang. >> >> The patch doesn't give enough info to understand why this is the best approach. >> I could imagine using atttribute used to make sure the function isn't optimized >> away, as alternative approach, for example.  Please make the case for the approach >> taken. > > I tried using the attribute approach (after you mentioned it here), but clang still optimized the static foo away. I'll document it on the commit message and the comment here for v2. Odd, this makes it pass for me, with both Clang 10 and Clang 14: ~~~ diff --git c/gdb/testsuite/gdb.base/msym-bp-shl-main-2.c w/gdb/testsuite/gdb.base/msym-bp-shl-main-2.c index e047ac1145a..009656fd9ea 100644 --- c/gdb/testsuite/gdb.base/msym-bp-shl-main-2.c +++ w/gdb/testsuite/gdb.base/msym-bp-shl-main-2.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -static void +static void __attribute__ ((used)) foo (void) { } ~~~ Can you double check?