Commit ea094d1f by Janis Johnson Committed by Janis Johnson

re PR testsuite/32076 ("gcc.dg/tree-ssa/pr17141-1.c scan-tree-dump locp.*->i ="…

re PR testsuite/32076 ("gcc.dg/tree-ssa/pr17141-1.c scan-tree-dump locp.*->i =" is the same name twice)

	PR testsuite/32076
	* lib/scandump.exp (dump-suffix): New.
	(scan-dump, scan-dump-times, scan-dump-dem, scan-dump-dem-not):
	Include dump suffix in pass/fail messages, put regexp in quotes.

From-SVN: r129858
parent 30972689
2007-11-02 Janis Johnson <janis187@us.ibm.com>
PR testsuite/32076
* lib/scandump.exp (dump-suffix): New.
(scan-dump, scan-dump-times, scan-dump-dem, scan-dump-dem-not):
Include dump suffix in pass/fail messages, put regexp in quotes.
2007-11-02 Paolo Carlini <pcarlini@suse.de> 2007-11-02 Paolo Carlini <pcarlini@suse.de>
PR c++/33495 PR c++/33495
...@@ -19,6 +19,13 @@ ...@@ -19,6 +19,13 @@
# #
# This is largely borrowed from scanasm.exp. # This is largely borrowed from scanasm.exp.
# Extract the constant part of the dump file suffix from the regexp.
# Argument 0 is the regular expression.
proc dump-suffix { arg } {
set idx [expr [string last "." $arg] + 1]
return [string range $arg $idx end]
}
# Utility for scanning compiler result, invoked via dg-final. # Utility for scanning compiler result, invoked via dg-final.
# Call pass if pattern is present, otherwise fail. # Call pass if pattern is present, otherwise fail.
# #
...@@ -49,10 +56,11 @@ proc scan-dump { args } { ...@@ -49,10 +56,11 @@ proc scan-dump { args } {
set text [read $fd] set text [read $fd]
close $fd close $fd
set suf [dump-suffix [lindex $args 2]]
if [regexp -- [lindex $args 1] $text] { if [regexp -- [lindex $args 1] $text] {
pass "$testcase scan-[lindex $args 0]-dump [lindex $args 1]" pass "$testcase scan-[lindex $args 0]-dump $suf \"[lindex $args 1]\""
} else { } else {
fail "$testcase scan-[lindex $args 0]-dump [lindex $args 1]" fail "$testcase scan-[lindex $args 0]-dump $suf \"[lindex $args 1]\""
} }
} }
...@@ -85,10 +93,11 @@ proc scan-dump-times { args } { ...@@ -85,10 +93,11 @@ proc scan-dump-times { args } {
set text [read $fd] set text [read $fd]
close $fd close $fd
set suf [dump-suffix [lindex $args 3]]
if { [llength [regexp -inline -all -- [lindex $args 1] $text]] == [lindex $args 2]} { if { [llength [regexp -inline -all -- [lindex $args 1] $text]] == [lindex $args 2]} {
pass "$testcase scan-[lindex $args 0]-dump-times [lindex $args 1] [lindex $args 2]" pass "$testcase scan-[lindex $args 0]-dump-times $suf \"[lindex $args 1]\" [lindex $args 2]"
} else { } else {
fail "$testcase scan-[lindex $args 0]-dump-times [lindex $args 1] [lindex $args 2]" fail "$testcase scan-[lindex $args 0]-dump-times $suf \"[lindex $args 1]\" [lindex $args 2]"
} }
} }
...@@ -120,10 +129,11 @@ proc scan-dump-not { args } { ...@@ -120,10 +129,11 @@ proc scan-dump-not { args } {
set text [read $fd] set text [read $fd]
close $fd close $fd
set suf [dump-suffix [lindex $args 2]]
if ![regexp -- [lindex $args 1] $text] { if ![regexp -- [lindex $args 1] $text] {
pass "$testcase scan-[lindex $args 0]-dump-not [lindex $args 1]" pass "$testcase scan-[lindex $args 0]-dump-not $suf \"[lindex $args 1]\""
} else { } else {
fail "$testcase scan-[lindex $args 0]-dump-not [lindex $args 1]" fail "$testcase scan-[lindex $args 0]-dump-not $suf \"[lindex $args 1]\""
} }
} }
...@@ -165,10 +175,11 @@ proc scan-dump-dem { args } { ...@@ -165,10 +175,11 @@ proc scan-dump-dem { args } {
set text [read $fd] set text [read $fd]
close $fd close $fd
set suf [dump-suffix [lindex $args 2]]
if [regexp -- [lindex $args 1] $text] { if [regexp -- [lindex $args 1] $text] {
pass "$testcase scan-[lindex $args 0]-dump-dem [lindex $args 1]" pass "$testcase scan-[lindex $args 0]-dump-dem $suf \"[lindex $args 1]\""
} else { } else {
fail "$testcase scan-[lindex $args 0]-dump-dem [lindex $args 1]" fail "$testcase scan-[lindex $args 0]-dump-dem $suf \"[lindex $args 1]\""
} }
} }
...@@ -209,9 +220,10 @@ proc scan-dump-dem-not { args } { ...@@ -209,9 +220,10 @@ proc scan-dump-dem-not { args } {
set text [read $fd] set text [read $fd]
close $fd close $fd
set suf [dump-suffix [lindex $args 2]]
if ![regexp -- [lindex $args 1] $text] { if ![regexp -- [lindex $args 1] $text] {
pass "$testcase scan-[lindex $args 0]-dump-dem-not [lindex $args 1]" pass "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"[lindex $args 1]\""
} else { } else {
fail "$testcase scan-[lindex $args 0]-dump-dem-not [lindex $args 1]" fail "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"[lindex $args 1]\""
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment