aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2023-04-28 17:48:33 +0200
committerHans-Peter Nilsson <hp@bitrange.com>2023-04-29 01:18:55 +0200
commit5cf6160a690a9cc829c34163f2de617faa3da341 (patch)
tree22a520a7f23daf8a54cf3b093a20ca5bbff8dbd5
parent0c77a0909456034d34036aa22a8dfcf0258cfa2d (diff)
downloadgcc-5cf6160a690a9cc829c34163f2de617faa3da341.zip
gcc-5cf6160a690a9cc829c34163f2de617faa3da341.tar.gz
gcc-5cf6160a690a9cc829c34163f2de617faa3da341.tar.bz2
testsuite: Handle empty assembly lines in check-function-bodies
I tried to make use of check-function-bodies for cris-elf and was a bit surprised to see it failing. There's a deliberate empty line after the filled delay slot of the return-function which was mishandled. I thought "aha" and tried to add an empty line (containing just a "**" prefix) to the match, but that didn't help. While it was added as input from the function's assembly output to-be-matched like any other line, it couldn't be matched: I had to use "...", which works but is...distracting. Some digging shows that an empty assembly line can't be deliberately matched because all matcher lines (lines starting with the prefix, the ubiquitous "**") are canonicalized by trimming leading whitespace (the "string trim" in check-function-bodies) and instead adding a leading TAB character, thus empty lines end up containing just a TAB. For usability it's better to treat empty lines as fluff than to uglifying the test-case and the code to properly match them. Double-checking, no test-case tries to match an line containing just TAB (by providing an a line containing just "**\s*", i.e. zero or more whitespace characters). * lib/scanasm.exp (parse_function_bodies): Set fluff to include empty lines (besides optionally leading whitespace).
-rw-r--r--gcc/testsuite/lib/scanasm.exp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index fb53544..be2b83a 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -791,7 +791,7 @@ proc parse_function_bodies { filename result } {
set terminator {^\s*\.size}
# Regexp for lines that aren't interesting.
- set fluff {^\s*(?:\.|//|@)}
+ set fluff {^\s*(?:\.|//|@|$)}
set fd [open $filename r]
set in_function 0