gcc.dg/debug/dwarf2/inline5.c currently FAILs with Solaris as (both sparc and x86):
FAIL: gcc.dg/debug/dwarf2/inline5.c scan-assembler-not \\\\(DIE \\\\(0x([0-9a-f]*)\\\\) DW_TAG_lexical_block\\\\)[^#/!]*[#/!] [^(].*DW_TAG_lexical_block\\\\)[^#/!x]*x\\\\1[^#/!]*[#/!] DW_AT_abstract_origin FAIL: gcc.dg/debug/dwarf2/inline5.c scan-assembler-times DW_TAG_lexical_block\\\\)[^#/!]*[#/!] \\\\(DIE \\\\(0x[0-9a-f]*\\\\) DW_TAG_variable 1 The first failure seems to be caused because .* performs multiline matches by default in Tcl; tightening it to [^\n]* avoids the problem. The second failures happens because Solaris as doesn't support .uleb128, so we get e.g. .byte 0xc / uleb128 0xc; (DIE (0x19f) DW_TAG_lexical_block) .byte 0xd / uleb128 0xd; (DIE (0x1a0) DW_TAG_variable) instead of .uleb128 0xc / (DIE (0xad) DW_TAG_lexical_block) .uleb128 0xd / (DIE (0xae) DW_TAG_variable) To fix this, the patch allows for additional non-comment text before (DIE. Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and x86_64-pc-linux-gnu. Ok for mainline? Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University 2019-01-03 Rainer Orth <r...@cebitec.uni-bielefeld.de> PR debug/87451 * gcc.dg/debug/dwarf2/inline5.c: Allow for non-comment before "(DIE (0x[0-9a-f]*) DW_TAG_variable". Avoid multiline matches.
# HG changeset patch # Parent 9265ca22ad184b53589ea032b85a14f545ba564a Fix gcc.dg/debug/dwarf2/inline5.c with Solaris as (PR debug/87451) diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c b/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c --- a/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c @@ -5,12 +5,12 @@ /* { dg-do compile } */ /* { dg-final { scan-assembler-times "DW_TAG_inlined_subroutine" 2 } } */ /* { dg-final { scan-assembler-times "DW_TAG_lexical_block\\)\[^#/!\]*\[#/!\] DW_AT_abstract_origin" 2 } } */ -/* { dg-final { scan-assembler-times "DW_TAG_lexical_block\\)\[^#/!\]*\[#/!\] \\(DIE \\(0x\[0-9a-f\]*\\) DW_TAG_variable" 1 } } */ +/* { dg-final { scan-assembler-times "DW_TAG_lexical_block\\)\[^#/!\]*\[#/!\] \[^#/!\]*\\(DIE \\(0x\[0-9a-f\]*\\) DW_TAG_variable" 1 } } */ /* We do not know which is output first so look for both invalid abstract origins on the lexical blocks (knowing that the abstract instance has no attribute following the DW_TAG_lexical_block. */ -/* { dg-final { scan-assembler-not "\\(DIE \\(0x(\[0-9a-f\]*)\\) DW_TAG_lexical_block\\)\[^#/!\]*\[#/!\] \[^(\].*DW_TAG_lexical_block\\)\[^#/!x\]*x\\1\[^#/!\]*\[#/!\] DW_AT_abstract_origin" } } */ -/* { dg-final { scan-assembler-not "DW_TAG_lexical_block\\)\[^#/!x\]*x(\[0-9a-f\]*)\[^#/!\]*\[#/!\] DW_AT_abstract_origin.*\\(DIE \\(0x\\1\\) DW_TAG_lexical_block\\)\[^#/!\]*\[#/!\] DW_AT" } } */ +/* { dg-final { scan-assembler-not "\\(DIE \\(0x(\[0-9a-f\]*)\\) DW_TAG_lexical_block\\)\[^#/!\]*\[#/!\] \[^(\]\[^\\n\]*DW_TAG_lexical_block\\)\[^#/!x\]*x\\1\[^#/!\]*\[#/!\] DW_AT_abstract_origin" } } */ +/* { dg-final { scan-assembler-not "DW_TAG_lexical_block\\)\[^#/!x\]*x(\[0-9a-f\]*)\[^#/!\]*\[#/!\] DW_AT_abstract_origin\[^\\n\]*\\(DIE \\(0x\\1\\) DW_TAG_lexical_block\\)\[^#/!\]*\[#/!\] DW_AT" } } */ int foo (int i) {