From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 7S5VFHDQ32KD2RoAWB0awg (envelope-from ) for ; Tue, 26 Jul 2022 07:30:56 -0400 Received: by simark.ca (Postfix, from userid 112) id 42D6F1E9ED; Tue, 26 Jul 2022 07:30:56 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=O563qIRE; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 4B9341E9E9 for ; Tue, 26 Jul 2022 07:30:55 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8DDA33857BB3 for ; Tue, 26 Jul 2022 11:30:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8DDA33857BB3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1658835053; bh=7N71QkQKSXDSGJE6V5dl/aAHw6sU2yts1enGExILFNE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=O563qIREqVKjnuuAe7wocTuhLVrm81ckjmv6k/cSC8CTBa+sYQ3kSqAFpRe5vwLtd 9oWOemQvuuIcKiyhKILL60pL0BFOSJHmJmLpIxwJtsSrYEfCNCDqaOMkU82WUt18Mt fqh5XaWVDTehVkWKdE7vnNxYIRwbXSV9PH2HHchA= Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id C8E0E3858D32 for ; Tue, 26 Jul 2022 11:30:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C8E0E3858D32 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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-out2.suse.de (Postfix) with ESMTPS id E5AC31FB8F; Tue, 26 Jul 2022 11:30:32 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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 imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CDD7513A7C; Tue, 26 Jul 2022 11:30:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qL0NMVjQ32KvYgAAMHmgww (envelope-from ); Tue, 26 Jul 2022 11:30:32 +0000 Date: Tue, 26 Jul 2022 13:30:26 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix gdb.opt/inline-small-func.exp with clang Message-ID: <20220726113024.GA17827@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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 Cc: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, When running test-case gdb.opt/inline-small-func.exp with clang 12.0.1, I run into: ... gdb compile failed, /usr/bin/ld: inline-small-func0.o: in function `main': inline-small-func.c:21: undefined reference to `callee' clang-12.0: error: linker command failed with exit code 1 \ (use -v to see invocation) UNTESTED: gdb.opt/inline-small-func.exp: failed to prepare ... Fix this by using __attribute__((always_inline)). Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/testsuite] Fix gdb.opt/inline-small-func.exp with clang --- gdb/testsuite/gdb.opt/inline-small-func.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.opt/inline-small-func.h b/gdb/testsuite/gdb.opt/inline-small-func.h index 66323952cf4..44b6e86fc15 100644 --- a/gdb/testsuite/gdb.opt/inline-small-func.h +++ b/gdb/testsuite/gdb.opt/inline-small-func.h @@ -13,9 +13,15 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#ifdef __GNUC__ +#define ATTR __attribute__((always_inline)) +#else +#define ATTR +#endif + int counter = 42; -inline void +inline ATTR void callee () { counter = 0; /* callee: body. */ }