Patchwork [committed] Fix g++.dg/debug/dwarf2/nested-3.C to handle hppa assembler comment

login
register
mail settings
Submitter Hans-Peter Nilsson
Date Sept. 19, 2012, 1:37 a.m.
Message ID <201209190137.q8J1bbWu025300@ignucius.se.axis.com>
Download mbox | patch
Permalink /patch/184902/
State New
Headers show

Comments

Hans-Peter Nilsson - Sept. 19, 2012, 1:37 a.m.
> From: John David Anglin <dave@hiauly1.hia.nrc.ca>
> Date: Sun, 16 Sep 2012 19:13:19 +0200

> This adjusts the regexp to work on hppa.  Tested on hppa2.0w-hp-hpux11.11
> and hppa64-hp-hpux11.11.  Committed to trunk.

> 2012-09-16  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
> 
> 	PR debug/54460
> 	* g++.dg/debug/dwarf2/nested-3.C: Add hppa assembler comment character
> 	to scary regexp.

(Changing "\[^#/!|@\]*\[#/!|@\]"
     into "\[^#;/!|@\]*\[#;/!|@\]")

The pa/pa.h ASM_COMMENT_START is ";".

This caused a regression for cris-elf which is apparently one of
the few targets to use the *default* value of ";#" for
ASM_COMMENT_START.  A very portable sequence, by the way, too
bad almost all other targets define their own.  FWIW, the port
most of you'd want to look up has "#".

I committed the following, adding a + after the set of matched
comment characters to match any repetition and combination of
them.  The sibling test-case, nested-2.C, had a similar flaw.

	* g++.dg/debug/dwarf2/nested-3.C: Match a sequence
	of asm-comment characters instead of a single one.
	* g++.dg/debug/dwarf2/nested-2.C: Similar.


brgds, H-P

Patch

--- g++.dg/debug/dwarf2/nested-3.C	(revision 191314)
+++ g++.dg/debug/dwarf2/nested-3.C	(working copy)
@@ -59,4 +59,4 @@ 
 //
 //     Hence the scary regexp:
 //
-//     { dg-final { scan-assembler "\[^\n\r\]*\\(DIE \\(0x(\[0-9a-f\]+)\\) DW_TAG_namespace\\)\[\n\r\]+\[^\n\r\]*\"thread\[\^\n\r]+\[\n\r\]+(\[^\n\r\]*\[\n\r\]+)+\[^\n\r\]*\\(DIE \\(0x(\[0-9a-f\]+)\\) DW_TAG_class_type\\)(\[\n\r\]+\[^\n\r\]*)+\"Executor\[^\n\r\]+\[\n\r\]+\[^\n\r\]*DW_AT_declaration\[\n\r\]+\[^\n\r\]*DW_AT_signature\[^#;/!|@\]*\[#;/!|@\] \[^\n\r\]*\\(DIE\[^\n\r\]*DW_TAG_subprogram\\)\[\n\r\]+(\[^\n\r\]*\[\n\r\]+)+\[^\n\r\]*\"CurrentExecutor\[^\n\r\]+\[\n\r\]+(\[^\n\r\]*\[\n\r\]+)+(\[^\n\r\]*\[\n\r\]+)+\[^\n\r\]*end of children of DIE 0x\\3\[\n\r]+\[^\n\r\]*end of children of DIE 0x\\1\[\n\r]+" } }
+//     { dg-final { scan-assembler "\[^\n\r\]*\\(DIE \\(0x(\[0-9a-f\]+)\\) DW_TAG_namespace\\)\[\n\r\]+\[^\n\r\]*\"thread\[\^\n\r]+\[\n\r\]+(\[^\n\r\]*\[\n\r\]+)+\[^\n\r\]*\\(DIE \\(0x(\[0-9a-f\]+)\\) DW_TAG_class_type\\)(\[\n\r\]+\[^\n\r\]*)+\"Executor\[^\n\r\]+\[\n\r\]+\[^\n\r\]*DW_AT_declaration\[\n\r\]+\[^\n\r\]*DW_AT_signature\[^#;/!|@\]*\[#;/!|@\]+ \[^\n\r\]*\\(DIE\[^\n\r\]*DW_TAG_subprogram\\)\[\n\r\]+(\[^\n\r\]*\[\n\r\]+)+\[^\n\r\]*\"CurrentExecutor\[^\n\r\]+\[\n\r\]+(\[^\n\r\]*\[\n\r\]+)+(\[^\n\r\]*\[\n\r\]+)+\[^\n\r\]*end of children of DIE 0x\\3\[\n\r]+\[^\n\r\]*end of children of DIE 0x\\1\[\n\r]+" } }

--- g++.dg/debug/dwarf2/nested-2.C	(revision 191455)
+++ g++.dg/debug/dwarf2/nested-2.C	(working copy)
@@ -32,6 +32,6 @@  We want to express that the DIE of S::T<
 
 Hence the slightly odd regexp:
 
-  { dg-final { scan-assembler "\[^\n\r\]*\\(DIE\[^\n\r\]*DW_TAG_structure_type\\)\[\n\r\]+\[^\n\r\]*\"S\\\\0\"\[ \t\]+\(\[@|#;!\]|//?\)\[ \t\]+DW_AT_name\[\n\r\]+\(.*\)?\\(DIE\[^\n\r\]*DW_TAG_structure_type\\)\[\n\r\]+\[^\n\r\]*\"T<int>\\\\0\"\[ \t\]+\(.*\)?\\(DIE\[^\n\r\]*DW_TAG_template_type_param\\)\[\n\r\]+\[^\n\r\]*\[\n\r\]+\[^\n\r\]*\[\n\r\]+\[^\n\r\]*\(\[@|#;!\]|//?\)\[ \t\]+end of children of DIE\[^\n\r\]*\[\n\r\]+\[^\n\r\]*end of children of DIE\[^\n\r\]*" } }
+  { dg-final { scan-assembler "\[^\n\r\]*\\(DIE\[^\n\r\]*DW_TAG_structure_type\\)\[\n\r\]+\[^\n\r\]*\"S\\\\0\"\[ \t\]+\(\[@|#;!\]+|//?\)\[ \t\]+DW_AT_name\[\n\r\]+\(.*\)?\\(DIE\[^\n\r\]*DW_TAG_structure_type\\)\[\n\r\]+\[^\n\r\]*\"T<int>\\\\0\"\[ \t\]+\(.*\)?\\(DIE\[^\n\r\]*DW_TAG_template_type_param\\)\[\n\r\]+\[^\n\r\]*\[\n\r\]+\[^\n\r\]*\[\n\r\]+\[^\n\r\]*\(\[@|#;!\]+|//?\)\[ \t\]+end of children of DIE\[^\n\r\]*\[\n\r\]+\[^\n\r\]*end of children of DIE\[^\n\r\]*" } }
 
  */