From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wHyeCwY0MmGmDwAAWB0awg (envelope-from ) for ; Fri, 03 Sep 2021 10:41:10 -0400 Received: by simark.ca (Postfix, from userid 112) id 2BC861EE22; Fri, 3 Sep 2021 10:41:10 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C67081EDF5 for ; Fri, 3 Sep 2021 10:41:09 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A7A933848418 for ; Fri, 3 Sep 2021 14:41:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7A933848418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1630680068; bh=tiO9Wnumb0iIedy+cOFk37/vfcwXChEvpTTrPooFQy8=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=joWfPWZxeg/DDk+iC6PqeYfWJ3kPsw6LOxiMJ6tGWW1SYHX760qTRyohW9LgQkb9B HMDPfTzJQMgib+Gzs3ei4fwFfjBp61VqLuadL6H1GVuCeZrXmmiMa5HLbcV57ydlHy 5leCJgN7LZeLDO7ccpTnQrg8EpQpVmZRtzg3qz4o= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 6D457385840F for ; Fri, 3 Sep 2021 14:40:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6D457385840F Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7A85022666; Fri, 3 Sep 2021 14:40:49 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 660F9137DE; Fri, 3 Sep 2021 14:40:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id 4teuF/EzMmFXTgAAGKfGzw (envelope-from ); Fri, 03 Sep 2021 14:40:49 +0000 Subject: [committed][gdb/testsuite] Add untested case in gdb.gdb/complaints.exp To: Simon Marchi , gdb-patches@sourceware.org References: <20210902061325.GA29918@delia> <89921d12-57b6-5fef-4adf-04ce9d3940e3@polymtl.ca> Message-ID: <6428cc1d-0291-72d5-f0d6-bc5b5b7a5b27@suse.de> Date: Fri, 3 Sep 2021 16:40:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <89921d12-57b6-5fef-4adf-04ce9d3940e3@polymtl.ca> Content-Type: multipart/mixed; boundary="------------CB42B04C3F6B8E34289B895F" Content-Language: en-US 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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" This is a multi-part message in MIME format. --------------CB42B04C3F6B8E34289B895F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit [ was: re: [PATCH][gdb/testsuite] Add untested case in selftest_setup ] On 9/3/21 2:24 PM, Simon Marchi wrote: > On 2021-09-02 2:13 a.m., Tom de Vries via Gdb-patches wrote: >> Any comments? > > I don't see what else we could do in this case, so LGTM. > Thanks for the review, pushed. Also pushed a similar fix for a similar problem in gdb.gdb/complaints.exp. Thanks, - Tom --------------CB42B04C3F6B8E34289B895F Content-Type: text/x-patch; charset=UTF-8; name="0001-gdb-testsuite-Add-untested-case-in-gdb.gdb-complaints.exp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-gdb-testsuite-Add-untested-case-in-gdb.gdb-complaints.e"; filename*1="xp.patch" [gdb/testsuite] Add untested case in gdb.gdb/complaints.exp When building gdb with "-Wall -O2 -g -flto=auto", I run into: ... (gdb) call clear_complaints()^M No symbol "clear_complaints" in current context.^M (gdb) FAIL: gdb.gdb/complaints.exp: clear complaints ... The problem is that lto has optimized away clear_complaints, and consequently the selftests cannot run. Fix this by: - using info function to detect presence of clear_complaints - handling the absence of clear_complaints by calling untested ... (gdb) UNTESTED: gdb.gdb/complaints.exp: \ Cannot find clear_complaints, skipping test ... Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-09-03 Tom de Vries * gdb.gdb/complaints.exp: Use untested if clear_complaints cannot be found. --- gdb/testsuite/gdb.gdb/complaints.exp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gdb/testsuite/gdb.gdb/complaints.exp b/gdb/testsuite/gdb.gdb/complaints.exp index c70825b6623..2391d661250 100644 --- a/gdb/testsuite/gdb.gdb/complaints.exp +++ b/gdb/testsuite/gdb.gdb/complaints.exp @@ -104,6 +104,26 @@ proc test_empty_complaint { cmd msg } { } proc test_empty_complaints { } { + global decimal + + set re [multi_line \ + "All functions matching regular expression \[^:\]*:" \ + "" \ + "File \[^\r\n\]*/complaints\\.c:" \ + "$decimal:\tvoid clear_complaints\\(\\);"] + + set found 0 + gdb_test_multiple "info function ^clear_complaints()$" "" { + -re -wrap $re { + set found 1 + } + -re -wrap "" { + } + } + if { ! $found } { + untested "Cannot find clear_complaints, skipping test" + return 0 + } test_empty_complaint "call clear_complaints()" \ "clear complaints" --------------CB42B04C3F6B8E34289B895F--