[COMMITTED] testsuite: Fix gcc.dg/pr111409.c on Solaris/SPARC with as

Message ID ydd1qcayr31.fsf@CeBiTec.Uni-Bielefeld.DE
State Unresolved
Headers
Series [COMMITTED] testsuite: Fix gcc.dg/pr111409.c on Solaris/SPARC with as |

Checks

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

Commit Message

Rainer Orth Nov. 28, 2023, 12:56 p.m. UTC
  gcc.dg/pr111409.c FAILs on Solaris/SPARC with the native as:

FAIL: gcc.dg/pr111409.c scan-assembler-times .section\\\\s+.debug_macro 1

Unlike most other ELF targets, that assembler requires the section name to
be double-quoted.  This patch allows for that.  It also expects \t to
separate .section directive and name like other similar tests, and escapes
literal dots.

Tested on sparc-sun-solaris2.11 (as and gas) and i386-pc-solaris2.11 (as
and gas).

According to gcc-testresults, the test also FAILs on
powerpc-ibm-aix7.2.5.0 and hppa64-hp-hpux11.11.  AIX seems to be the
same issue, while HP/UX apparently has a different section syntax.

	Rainer
  

Patch

# HG changeset patch
# Parent  fd39a5a60b8433590aee9d4e91f3683675d37a0b
testsuite: Fix gcc.dg/pr111409.c on Solaris/SPARC with as

diff --git a/gcc/testsuite/gcc.dg/pr111409.c b/gcc/testsuite/gcc.dg/pr111409.c
--- a/gcc/testsuite/gcc.dg/pr111409.c
+++ b/gcc/testsuite/gcc.dg/pr111409.c
@@ -1,7 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-skip-if "split DWARF unsupported" { *-*-darwin* } } */
 /* { dg-options "-gsplit-dwarf -g3 -dA" } */
-/* { dg-final { scan-assembler-times {.section\s+.debug_macro} 1 } } */
-/* { dg-final { scan-assembler-not {.byte\s+0x7\s*#\s*Import} } } */
+/* { dg-final { scan-assembler-times {\.section\t"?\.debug_macro} 1 } } */
+/* { dg-final { scan-assembler-not {\.byte\s+0x7\s*#\s*Import} } } */
 
 #define foo 1