From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2152) id 5293E3858D37; Fri, 28 Apr 2023 23:19:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5293E3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682723959; bh=AmAZ63n3/niQ5+lhR8InB/V/J3tkwzlckHxCyOW59D4=; h=From:To:Subject:Date:From; b=yYj7/0kw+9wnWLvsLlxIQNZeW6tLWRYh6dDZOM29endUlbOzDoIkueZ0Xrsv0FliE ihXYX45nCU7V/gdqZmE4UoUlTbe32RbmN+uAFrafPJZoEieMUinTuyQO2RRB8xtVYr rnjNIMb4QiDnoDwiFPIvOz9dhP8UDhGprz0C69Tk= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Hans-Peter Nilsson To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-344] testsuite: Handle empty assembly lines in check-function-bodies X-Act-Checkin: gcc X-Git-Author: Hans-Peter Nilsson X-Git-Refname: refs/heads/master X-Git-Oldrev: 0c77a0909456034d34036aa22a8dfcf0258cfa2d X-Git-Newrev: 5cf6160a690a9cc829c34163f2de617faa3da341 Message-Id: <20230428231919.5293E3858D37@sourceware.org> Date: Fri, 28 Apr 2023 23:19:19 +0000 (GMT) List-Id: https://gcc.gnu.org/g:5cf6160a690a9cc829c34163f2de617faa3da341 commit r14-344-g5cf6160a690a9cc829c34163f2de617faa3da341 Author: Hans-Peter Nilsson Date: Fri Apr 28 17:48:33 2023 +0200 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). Diff: --- gcc/testsuite/lib/scanasm.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index fb53544d40c..be2b83a5dd4 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