diff mbox

[testsuite] Adapt gcc.dg/debug/dwarf2/prod-options.c for Solaris assembler

Message ID yddziuqmaij.fsf@lokon.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Feb. 24, 2016, 2:46 p.m. UTC
gcc.dg/debug/dwarf2/prod-options.c currently FAILs on Solaris when the
native assembler is used:

FAIL: gcc.dg/debug/dwarf2/prod-options.c scan-assembler DW_AT_producer: "GNU C

This happens because the DW_AT_producer line scanned for is formatted
slightly differently: on Solaris/x86 with as, I see

        .ascii "GNU C11 6.0.0 20160205 (experimental) [trunk revision 233172] -mtune=generic -march=pentium4 -gdwarf -O2\0"     / DW_AT_producer

while with gas, the following is produced:

        .long   .LASF0  / DW_AT_producer: "GNU C11 6.0.0 20160205 (experimental) [trunk revision 233172] -mtune=generic -march=pentium4 -gdwarf -O2"

Solaris/SPARC as is slightly different again due to the use of a
different comment character:

        .ascii "GNU C11 6.0.0 20160219 (experimental) [trunk revision 233556] -mcpu=v9 -gdwarf -O2\0"   ! DW_AT_producer

The following patch allows for those variations, tested with the
appropriate runtest invocations on i386-pc-solaris2.12,
sparc-sun-solaris2.12, and x86_64-pc-linux-gnu, installed on mainline.

	Rainer


2016-02-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.dg/debug/dwarf2/prod-options.c: Use different DW_AT_producer
	pattern on Solaris with as.
diff mbox

Patch

# HG changeset patch
# Parent  4426c5674eb0f7a0b8dcc53bdb4372dcd66a1ef4
Adapt gcc.dg/debug/dwarf2/prod-options.c for Solaris assembler

diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c b/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c
@@ -4,7 +4,8 @@ 
    as well.  */
 /* { dg-do compile } */
 /* { dg-options "-O2 -gdwarf -dA -fdebug-prefix-map=a=b" } */
-/* { dg-final { scan-assembler "DW_AT_producer: \"GNU C" } } */
+/* { dg-final { scan-assembler "DW_AT_producer: \"GNU C" { target { { ! *-*-solaris2* } || gas } } } } */
+/* { dg-final { scan-assembler "\"GNU C\[^\\n\\r\]+ DW_AT_producer" { target { *-*-solaris2* && { ! gas } } } } } */
 /* { dg-final { scan-assembler-not "debug-prefix-map" } } */
 
 void func (void)