From patchwork Thu Mar 2 01:20:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 63153 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3972239wrd; Wed, 1 Mar 2023 17:20:49 -0800 (PST) X-Google-Smtp-Source: AK7set+cRLO6/r15e6Mj6qYk7l7gQigO8S9zthtXiJE3lNSBf1RFSRPn332so/PiYO+x+US3tYBU X-Received: by 2002:a05:6402:134b:b0:4ab:4c5e:b0ed with SMTP id y11-20020a056402134b00b004ab4c5eb0edmr9662159edw.21.1677720049161; Wed, 01 Mar 2023 17:20:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677720049; cv=none; d=google.com; s=arc-20160816; b=JUhwmxYf7djtHvvxE2vStQtZvU96FiC1CgLOnOBHQcGtPe4Iln2+43OvIxXBIhTKrr QC3ipRgBa8A6mWUSMxD+qQNGKEBZGiVygumZzUPCqn04ow7nsxVutAFQM0z5OWTAbG/t vcY0X+8wEq/Gu0793kI4nOWywWwF/mUDSLZLbc2GfWHRPFkSrZi1J5HpIPMCSUckTcAc 7T3fBMN7UP21YoI2c1qpr1a8Zl0z6ylQDEHWr5FaH26NQMCyxsIoLNwoBFmOQNKvnu7L hovSVw3jPHTlNEPzBOCkucGWSlibjIgmF1XsjGU09KD1NAU6ZxtjYzrRpygcKukCdgOO C6+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :content-transfer-encoding:mime-version:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=cmFZa9rPW6czv6IUW+P1PKY6vPals+SZL3uozLNLo/I=; b=ux5GSJ4GUSD9oyBAR6USvOPSi2Mxwscf/HWHMckvCNdt7sxWHyiTAFGVRqhQCByNxt pt1/IKS6GnjaOxQAPRk6U66RmIc5WHspjkUp55B1g+gI+eG5+aTkTfrb5wtUyC39JnUj 92ZdFzomrTwpgHcsZXTttvbgx3UbYejXcnffwFlNU2JbqZGjiNcdfXFPB5p23S5HmgAG OswUszqfmDlbPFb/ceYxcd2H9Q7iS3XE8RLFKB5qXxp+52fmKLzZDQeO7CivbSUBbkWO lMpnz/SbLKvCJW1Ti532qAL5SxF9SR1t35qlLAYylgeUCY6ibbcuI6QUqH8gDfGU8bAh 3lZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uO8azT5I; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id g15-20020a056402180f00b004aeeb0e1654si15649578edy.431.2023.03.01.17.20.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Mar 2023 17:20:49 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uO8azT5I; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 280943858C2C for ; Thu, 2 Mar 2023 01:20:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 280943858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677720048; bh=cmFZa9rPW6czv6IUW+P1PKY6vPals+SZL3uozLNLo/I=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=uO8azT5IWLSEasgnlOqsfE8+ulMiB6J926FBoWh0t+IkDw7mox9YYCK7K5NQdvQgd ewGkVAvzsOd5MUgm3t5qgr9itdWdulP+n+f0T3XMwtBek05uRpbPjHr70i5o8anmLw 928U2uxjBr4xmhCD1sN+hQczvAKbSE4a7TJg1sLQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id DE3033858D33 for ; Thu, 2 Mar 2023 01:20:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DE3033858D33 To: Subject: [COMMITTED] testsuite: Fix gcc.dg/attr-copy-6.c for user-label-prefixed targets MIME-Version: 1.0 Message-ID: <20230302012003.6A0D52040C@pchp3.se.axis.com> Date: Thu, 2 Mar 2023 02:20:03 +0100 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759216977754831418?= X-GMAIL-MSGID: =?utf-8?q?1759216977754831418?= Trivia: I copied that ASMNAME construct from the 18-year-minus-a-month old commit of r0-66993-gc5221531453e02, where it fixed a similar testsuite error. Committed as obvious. -- >8 -- This fixes: Running /x/gcc/testsuite/gcc.dg/dg.exp ... ... FAIL: gcc.dg/attr-copy-6.c (test for excess errors) for cris-elf, where gcc.log has: Excess errors: /x/gcc/testsuite/gcc.dg/attr-copy-6.c:91:3: error: 'fnoreturn_alias' aliased to undefined symbol 'fnoreturn_name' Asm-declared identifiers need to prepend __USER_LABEL_PREFIX__ to the asm-name, something which is often overlooked because it's empty for most targets. N.B: attribute-alias does not need the same treatment. The identical construct added here, is in several tests. * gcc.dg/attr-copy-6.c: Prefix asm-declared name with __USER_LABEL_PREFIX__. --- gcc/testsuite/gcc.dg/attr-copy-6.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/attr-copy-6.c b/gcc/testsuite/gcc.dg/attr-copy-6.c index cf578bddb1b0..30a1317bf928 100644 --- a/gcc/testsuite/gcc.dg/attr-copy-6.c +++ b/gcc/testsuite/gcc.dg/attr-copy-6.c @@ -9,6 +9,10 @@ #define ATTR(...) __attribute__ ((__VA_ARGS__)) #define ASRT(expr) _Static_assert (expr, #expr) +#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) +#define ASMNAME2(prefix, cname) STRING (prefix) cname +#define STRING(x) #x + /* Variable that is local to this translation unit but that can be modified from other units by calling reset_unit_local(). */ static int unit_local; @@ -79,7 +83,7 @@ extern _Noreturn void fnoreturn (void); extern __typeof (fnoreturn) ATTR (visibility ("hidden")) - fnoreturn __asm__ ("fnoreturn_name"); + fnoreturn __asm__ (ASMNAME ("fnoreturn_name")); void fnoreturn (void) {