Patchwork [testsuite] Fix g++.dg/debug/dwarf2/pr54508.C on Solaris 9/x86

login
register
mail settings
Submitter Rainer Orth
Date Jan. 8, 2013, 12:11 p.m.
Message ID <ydd4nir50yb.fsf@lokon.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/210355/
State New
Headers show

Comments

Rainer Orth - Jan. 8, 2013, 12:11 p.m.
g++.dg/debug/dwarf2/pr54508.C is FAILing on Solaris 9/x86 (both with as
and gas):

FAIL: g++.dg/debug/dwarf2/pr54508.C -std=gnu++98  scan-assembler "c\\\\\\\\0"[ \\t]+[#;/!|@]+ DW_AT_name[\\r\\n]+[^\\r\\n]+[\\r\\n]+[^\\r\\n]+[\\r\\n]+[^#;/!|@]+[#;/!|@]+ DW_AT_decl_line[\\r\\n]+[^#;/!|@]+[#;/!|@]+ DW_AT_declaration
FAIL: g++.dg/debug/dwarf2/pr54508.C -std=gnu++98  scan-assembler "s\\\\\\\\0"[ \\t]+[#;/!|@]+ DW_AT_name
FAIL: g++.dg/debug/dwarf2/pr54508.C -std=gnu++98  scan-assembler "f1\\\\\\\\0"[ \\t]+[#;/!|@]+ DW_AT_name
FAIL: g++.dg/debug/dwarf2/pr54508.C -std=gnu++98  scan-assembler "u\\\\\\\\0"[ \\t]+[#;/!|@]+ DW_AT_name[\\r\\n]+[^\\r\\n]+[\\r\\n]+[^\\r\\n]+[\\r\\n]+[^#;/!|@]+[#;/!|@]+ DW_AT_decl_line[\\r\\n]+[^#;/!|@]+[#;/!|@]+ DW_AT_declaration

This turns out to be due to whitespace differences in assembler
comments between Solaris 9 and 10:

-       .byte   0x3     /  uleb128 0x3; (DW_AT_name)
+       .byte   0x3     / uleb128 0x3; (DW_AT_name)

I've traced this to different values of ASM_COMMENT_START:

  config/i386/unix.h:#define ASM_COMMENT_START "/ "
  config/i386/sol2-bi.h:#define ASM_COMMENT_START "/"

The following patch fixes this; tested with the appropriate runtest
invocations on i386-pc-solaris2.9, i386-pc-solaris2.10, and
x86_64-unknown-linux-gnu.

Ok for mainline?

	Rainer


2013-01-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* g++.dg/debug/dwarf2/pr54508.C: Allow for more whitespace after
	asm comments.
Jakub Jelinek - Jan. 8, 2013, 12:15 p.m.
On Tue, Jan 08, 2013 at 01:11:24PM +0100, Rainer Orth wrote:
> Ok for mainline?

Yes, thanks.

> 2013-01-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 
> 	* g++.dg/debug/dwarf2/pr54508.C: Allow for more whitespace after
> 	asm comments.

	Jakub

Patch

# HG changeset patch
# Parent 6f6b53ac13329dd89e81296140f3c39de724e7a7
Fix g++.dg/debug/dwarf2/pr54508.C on Solaris 9/x86

diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pr54508.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr54508.C
--- a/gcc/testsuite/g++.dg/debug/dwarf2/pr54508.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr54508.C
@@ -2,17 +2,17 @@ 
 // { dg-do compile }
 // { dg-options "-g2 -dA -fno-merge-debug-strings" }
 
-// { dg-final { scan-assembler-not "\"cbase\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } }
-// { dg-final { scan-assembler "\"c\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ DW_AT_decl_line\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ DW_AT_declaration" } }
-// { dg-final { scan-assembler-not "\"OPCODE\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } }
-// { dg-final { scan-assembler-not "\"bi\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } }
-// { dg-final { scan-assembler-not "\"si\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } }
-// { dg-final { scan-assembler "\"s\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } }
-// { dg-final { scan-assembler-not "\"s\\\\0\"\[^#;/!|@\]+\[#;/!|@\]+ DW_AT_name\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ DW_AT_decl_line\[\r\n\]+\[ \t\]+\[#;/!|@\]+ DW_AT_declaration" } }
-// { dg-final { scan-assembler "\"f1\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } }
-// { dg-final { scan-assembler "\"u\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ DW_AT_decl_line\[\r\n\]+\[^#;/!|@\]+\[#;/!|@\]+ DW_AT_declaration" } }
-// { dg-final { scan-assembler-not "\"f2\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } }
-// { dg-final { scan-assembler-not "\"nc\\\\0\"\[ \t\]+\# DW_AT_name" } }
+// { dg-final { scan-assembler-not "\"cbase\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
+// { dg-final { scan-assembler "\"c\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ +DW_AT_decl_line\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ +DW_AT_declaration" } }
+// { dg-final { scan-assembler-not "\"OPCODE\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
+// { dg-final { scan-assembler-not "\"bi\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
+// { dg-final { scan-assembler-not "\"si\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
+// { dg-final { scan-assembler "\"s\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
+// { dg-final { scan-assembler-not "\"s\\\\0\"\[^#;/!|@\]+\[#;/!|@\]+ +DW_AT_name\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ +DW_AT_decl_line\[\r\n\]+\[ \t\]+\[#;/!|@\]+ +DW_AT_declaration" } }
+// { dg-final { scan-assembler "\"f1\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
+// { dg-final { scan-assembler "\"u\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^\r\n\]+\[\r\n\]+\[\^#;/!|@\]+\[#;/!|@\]+ +DW_AT_decl_line\[\r\n\]+\[^#;/!|@\]+\[#;/!|@\]+ +DW_AT_declaration" } }
+// { dg-final { scan-assembler-not "\"f2\\\\0\"\[ \t\]+\[#;/!|@\]+ +DW_AT_name" } }
+// { dg-final { scan-assembler-not "\"nc\\\\0\"\[ \t\]+\# +DW_AT_name" } }
 
 class cbase