From: Rainer Orth Date: Thu, 1 Feb 2024 11:46:20 +0000 (+0100) Subject: c++: Fix g++.dg/ext/attr-section2.C etc. with Solaris/SPARC as X-Git-Tag: basepoints/gcc-15~1450 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e98edc6a3cdfcdad71a2f7be5818033ea15cdde7;p=thirdparty%2Fgcc.git 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 --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} } }