Commit 7a76132c by Martin Liska Committed by Martin Liska

Improve FAIL message for dump-*-times functions.

2017-10-17  Martin Liska  <mliska@suse.cz>

	* lib/scanasm.exp: Print how many times a regex pattern is
	found.
	* lib/scandump.exp: Likewise.

From-SVN: r253804
parent af297249
2017-10-17 Martin Liska <mliska@suse.cz>
* lib/scanasm.exp: Print how many times a regex pattern is
found.
* lib/scandump.exp: Likewise.
17-10-2017 Olga Makhotina <olga.makhotina@intel.com> 17-10-2017 Olga Makhotina <olga.makhotina@intel.com>
* gcc.target/i386/avx512dq-vreducesd-1.c (_mm_mask_reduce_sd, * gcc.target/i386/avx512dq-vreducesd-1.c (_mm_mask_reduce_sd,
......
...@@ -231,6 +231,7 @@ proc scan-assembler-times { args } { ...@@ -231,6 +231,7 @@ proc scan-assembler-times { args } {
set testcase [testname-for-summary] set testcase [testname-for-summary]
set pattern [lindex $args 0] set pattern [lindex $args 0]
set times [lindex $args 1]
set pp_pattern [make_pattern_printable $pattern] set pp_pattern [make_pattern_printable $pattern]
# This must match the rule in gcc-dg.exp. # This must match the rule in gcc-dg.exp.
...@@ -239,7 +240,7 @@ proc scan-assembler-times { args } { ...@@ -239,7 +240,7 @@ proc scan-assembler-times { args } {
set files [glob -nocomplain $output_file] set files [glob -nocomplain $output_file]
if { $files == "" } { if { $files == "" } {
verbose -log "$testcase: output file does not exist" verbose -log "$testcase: output file does not exist"
unresolved "$testcase scan-assembler-times $pp_pattern [lindex $args 1]" unresolved "$testcase scan-assembler-times $pp_pattern $times"
return return
} }
...@@ -247,10 +248,11 @@ proc scan-assembler-times { args } { ...@@ -247,10 +248,11 @@ proc scan-assembler-times { args } {
set text [read $fd] set text [read $fd]
close $fd close $fd
if { [llength [regexp -inline -all -- $pattern $text]] == [lindex $args 1]} { set result_count [llength [regexp -inline -all -- $pattern $text]]
pass "$testcase scan-assembler-times $pp_pattern [lindex $args 1]" if {$result_count == $times} {
pass "$testcase scan-assembler-times $pp_pattern $times"
} else { } else {
fail "$testcase scan-assembler-times $pp_pattern [lindex $args 1]" fail "$testcase scan-assembler-times $pp_pattern $times (found $result_count times)"
} }
} }
......
...@@ -86,6 +86,7 @@ proc scan-dump-times { args } { ...@@ -86,6 +86,7 @@ proc scan-dump-times { args } {
} }
set testcase [testname-for-summary] set testcase [testname-for-summary]
set times [lindex $args 2]
set suf [dump-suffix [lindex $args 3]] set suf [dump-suffix [lindex $args 3]]
set printable_pattern [make_pattern_printable [lindex $args 1]] set printable_pattern [make_pattern_printable [lindex $args 1]]
set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"$printable_pattern\" [lindex $args 2]" set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"$printable_pattern\" [lindex $args 2]"
...@@ -101,10 +102,11 @@ proc scan-dump-times { args } { ...@@ -101,10 +102,11 @@ proc scan-dump-times { args } {
set text [read $fd] set text [read $fd]
close $fd close $fd
if { [llength [regexp -inline -all -- [lindex $args 1] $text]] == [lindex $args 2]} { set result_count [llength [regexp -inline -all -- [lindex $args 1] $text]]
if {$result_count == $times} {
pass "$testname" pass "$testname"
} else { } else {
fail "$testname" fail "$testname (found $result_count times)"
} }
} }
......
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