testsuite: make check-functions-body dump expected and seen cases on failure.

Often times when a check_function_body check fails it can be quite hard to
figure out why as no additional information is provided.

This changes it so that on failures it prints out the regex expression it's
using and the text it's comparing against to the verbose log.

This makes it much easier to figure out why a test has failed.

gcc/testsuite/ChangeLog:

	* lib/scanasm.exp (check_function_body): Add debug output to verbose log
	on failure.
This commit is contained in:
Tamar Christina 2022-09-23 10:56:30 +01:00
parent b7fd7fb501
commit 50324a0d39

View file

@ -803,7 +803,12 @@ proc check_function_body { functions name body_regexp } {
if { ![info exists up_functions($name)] } {
return 0
}
return [regexp "^$body_regexp\$" $up_functions($name)]
set fn_res [regexp "^$body_regexp\$" $up_functions($name)]
if { !$fn_res } {
verbose -log "body: $body_regexp"
verbose -log "against: $up_functions($name)"
}
return $fn_res
}
# Check the implementations of functions against expected output. Used as: