From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 5A5573858D37 for ; Fri, 28 Apr 2023 15:58:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A5573858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1682697512; x=1714233512; h=from:to:subject:mime-version:content-transfer-encoding: message-id:date; bh=Nns+iWDQvA2sJB0vmoDamVWFjN4SVhaHlL6TS66GkcU=; b=iD7ImuD7H/7i3B7glklEFEVtTDJ6fh7KxP0pfORCeh3CqqpyqTWYPvxR ct7JoFEt3R3mGpczv46dCxhHKXx3dCX4oRAdFHjl2AHkYCnVWO+Km1JJ0 8QLWQobYcnOVA0duwZgi1mNmX0heBkwHRzrMayhjGu6jtsNT0s+kKFEiR b+bIWI0suGyQKd1s5Q9+LTnMnShmBRZYCNTauWFtd04z+k0FS1l4ZaZaJ gWCIyMX3DFzUmMbL7mKgNN4M9CkajmBruFWehrrgExD6jCwJitW9/wZqu Hgeik8cCkhfV3H3YcT00pIgLXsnHrnIENgwyQi4B1cfhdhfCspHlMnHbg w==; From: Hans-Peter Nilsson To: Subject: [PATCH] testsuite: Handle empty assembly lines in check-function-bodies MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-ID: <20230428155829.F20D120438@pchp3.se.axis.com> Date: Fri, 28 Apr 2023 17:58:29 +0200 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Ok to commit? -- >8 -- 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). --- 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 fb53544d40c7..be2b83a5dd48 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 -- 2.30.2