c++: Fix g++.dg/ext/attr-section2.C etc. with Solaris/SPARC as

Message ID ydd1qad4rg8.fsf@CeBiTec.Uni-Bielefeld.DE
State Unresolved
Headers
Series c++: Fix g++.dg/ext/attr-section2.C etc. with Solaris/SPARC as |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Rainer Orth Jan. 19, 2024, 9:12 a.m. UTC
  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).

Ok for trunk?

	Rainer
  

Patch

# HG changeset patch
# Parent  7d0c57f448dfceb02583a770e09fa7907720ba7e
c++: Fix g++.dg/ext/attr-section2.C etc. with Solaris/SPARC as

diff --git a/gcc/testsuite/g++.dg/ext/attr-section2.C b/gcc/testsuite/g++.dg/ext/attr-section2.C
--- a/gcc/testsuite/g++.dg/ext/attr-section2.C
+++ b/gcc/testsuite/g++.dg/ext/attr-section2.C
@@ -6,4 +6,4 @@  template<class T>
 
 template int var<int>;
 
-// { 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
--- a/gcc/testsuite/g++.dg/ext/attr-section2a.C
+++ b/gcc/testsuite/g++.dg/ext/attr-section2a.C
@@ -11,4 +11,4 @@  int A<T>::var = 42;
 
 template struct A<int>;
 
-// { 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
--- 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<int>();
 
-// { dg-final { scan-assembler {.(section|csect)[ \t]+.foo} } }
+// { dg-final { scan-assembler {\.(section|csect)[ \t]+"?\.foo} } }