+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>
* gcc.target/i386/avx512dq-vreducesd-1.c (_mm_mask_reduce_sd,
set testcase [testname-for-summary]
set pattern [lindex $args 0]
+ set times [lindex $args 1]
set pp_pattern [make_pattern_printable $pattern]
# This must match the rule in gcc-dg.exp.
set files [glob -nocomplain $output_file]
if { $files == "" } {
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
}
set text [read $fd]
close $fd
- if { [llength [regexp -inline -all -- $pattern $text]] == [lindex $args 1]} {
- pass "$testcase scan-assembler-times $pp_pattern [lindex $args 1]"
+ set result_count [llength [regexp -inline -all -- $pattern $text]]
+ if {$result_count == $times} {
+ pass "$testcase scan-assembler-times $pp_pattern $times"
} else {
- fail "$testcase scan-assembler-times $pp_pattern [lindex $args 1]"
+ fail "$testcase scan-assembler-times $pp_pattern $times (found $result_count times)"
}
}
}
set testcase [testname-for-summary]
+ set times [lindex $args 2]
set suf [dump-suffix [lindex $args 3]]
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 text [read $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"
} else {
- fail "$testname"
+ fail "$testname (found $result_count times)"
}
}