From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2152) id CF2473858D33; Thu, 2 Mar 2023 01:15:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF2473858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677719730; bh=Rmsh2FqpHkex2zkNpajOMorc9vQV7i1iLGF8aK6FMMc=; h=From:To:Subject:Date:From; b=aBdNbA0VXdZaN80SiTcR6mS58GRYm9khKIRo7MMIs/haejyiCScOHaQrpLMIFtffA KmTSg56EUu8CkMlzl1exLf7cHNQbs8NF33UHC1u4Hz5uALJY2On6cuGrc/H6ulcUb+ 3aJJV6hyug7rrXLzEgPE5HQS9PWAVbdkws8loCZ8= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Hans-Peter Nilsson To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-6404] testsuite: Fix gcc.dg/attr-copy-6.c for user-label-prefixed targets X-Act-Checkin: gcc X-Git-Author: Hans-Peter Nilsson X-Git-Refname: refs/heads/master X-Git-Oldrev: 8590e4d096e4636c9384f7f885b979026861c29f X-Git-Newrev: b838a9f65f68f9ebe87d4cbd10ae18911a05b6ea Message-Id: <20230302011530.CF2473858D33@sourceware.org> Date: Thu, 2 Mar 2023 01:15:30 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b838a9f65f68f9ebe87d4cbd10ae18911a05b6ea commit r13-6404-gb838a9f65f68f9ebe87d4cbd10ae18911a05b6ea Author: Hans-Peter Nilsson Date: Wed Mar 1 17:30:07 2023 +0100 testsuite: Fix gcc.dg/attr-copy-6.c for user-label-prefixed targets 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__. Diff: --- 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 cf578bddb1b..30a1317bf92 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) {