From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1147) id A3FF13858C62; Thu, 1 Feb 2024 11:46:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3FF13858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706788012; bh=L37XgvTJJ2CAT1vm+POS8prNjCk/Pvx9+kvMoso4hww=; h=From:To:Subject:Date:From; b=AkCviwCnmOVbO2YFD/n7r6KrIAkMuF6CAoYsfiFGL5OGDHGxbag+4smQgNKkpMPDy aa4DaWBaxP6kkP9XSpn9QZApACLzG+JlXY5rlL288D7KZ7Rjd2Pdc7zXZn6/wsB5EF VqAtPlydPRZhOnGsdBv5UNbibXLa3XP46D1ct0wk= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Rainer Orth To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-8689] c++: Fix g++.dg/ext/attr-section2.C etc. with Solaris/SPARC as X-Act-Checkin: gcc X-Git-Author: Rainer Orth X-Git-Refname: refs/heads/master X-Git-Oldrev: dd3455f69577eed9d65e7e00161666fcfbbf444c X-Git-Newrev: e98edc6a3cdfcdad71a2f7be5818033ea15cdde7 Message-Id: <20240201114652.A3FF13858C62@sourceware.org> Date: Thu, 1 Feb 2024 11:46:52 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e98edc6a3cdfcdad71a2f7be5818033ea15cdde7 commit r14-8689-ge98edc6a3cdfcdad71a2f7be5818033ea15cdde7 Author: Rainer Orth Date: Thu Feb 1 12:46:20 2024 +0100 c++: Fix g++.dg/ext/attr-section2.C etc. with Solaris/SPARC as The new g++.dg/ext/attr-section2*.C tests FAIL on Solaris/SPARC with the native assembler: +FAIL: g++.dg/ext/attr-section2.C -std=c++14 scan-assembler .(section|csect)[ \\\\t]+.foo +FAIL: g++.dg/ext/attr-section2.C -std=c++17 scan-assembler .(section|csect)[ \\\\t]+.foo +FAIL: g++.dg/ext/attr-section2.C -std=c++20 scan-assembler .(section|csect)[ \\\\t]+.foo The problem is that the SPARC assembler requires the section name to be double-quoted, like .section ".foo%_Z3varIiE",#alloc,#write,#progbits This patch allows for that. At the same time, it quotes literal dots in the REs. Tested on sparc-sun-solaris2.11 (as and gas) and i386-pc-solaris2.11 (as and gas). 2024-01-18 Rainer Orth gcc/testsuite: * g++.dg/ext/attr-section2.C (scan-assembler): Quote dots. Allow for double-quoted section name. * g++.dg/ext/attr-section2a.C: Likewise. * g++.dg/ext/attr-section2b.C: Likewise. Diff: --- gcc/testsuite/g++.dg/ext/attr-section2.C | 2 +- gcc/testsuite/g++.dg/ext/attr-section2a.C | 2 +- gcc/testsuite/g++.dg/ext/attr-section2b.C | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/g++.dg/ext/attr-section2.C b/gcc/testsuite/g++.dg/ext/attr-section2.C index 7c9221b73aa5..81567c10b774 100644 --- a/gcc/testsuite/g++.dg/ext/attr-section2.C +++ b/gcc/testsuite/g++.dg/ext/attr-section2.C @@ -6,4 +6,4 @@ template template int var; -// { dg-final { scan-assembler {.(section|csect)[ \t]+.foo} } } +// { dg-final { scan-assembler {\.(section|csect)[ \t]+"?\.foo} } } diff --git a/gcc/testsuite/g++.dg/ext/attr-section2a.C b/gcc/testsuite/g++.dg/ext/attr-section2a.C index 4fa898c54edd..97b3a10a178c 100644 --- a/gcc/testsuite/g++.dg/ext/attr-section2a.C +++ b/gcc/testsuite/g++.dg/ext/attr-section2a.C @@ -11,4 +11,4 @@ int A::var = 42; template struct A; -// { dg-final { scan-assembler {.(section|csect)[ \t]+.foo} } } +// { dg-final { scan-assembler {\.(section|csect)[ \t]+"?\.foo} } } diff --git a/gcc/testsuite/g++.dg/ext/attr-section2b.C b/gcc/testsuite/g++.dg/ext/attr-section2b.C index 93987733ff2f..bef0377016d1 100644 --- a/gcc/testsuite/g++.dg/ext/attr-section2b.C +++ b/gcc/testsuite/g++.dg/ext/attr-section2b.C @@ -9,4 +9,4 @@ int* fun() { template int* fun(); -// { dg-final { scan-assembler {.(section|csect)[ \t]+.foo} } } +// { dg-final { scan-assembler {\.(section|csect)[ \t]+"?\.foo} } }