From patchwork Fri Apr 28 15:58:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 88678 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1029802vqo; Fri, 28 Apr 2023 08:59:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HMMRQX4g/mv8jqnLlgO3+HzzOYT/R2SwsOHpSW9G7XuW1f/O6ue5H3B4q11AN6TGgCRsZ X-Received: by 2002:a05:6402:1145:b0:506:6bd3:a53a with SMTP id g5-20020a056402114500b005066bd3a53amr4657196edw.0.1682697556584; Fri, 28 Apr 2023 08:59:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682697556; cv=none; d=google.com; s=arc-20160816; b=jyJ3wZ5tzm5VlkAnrDs4XoNEpGechtx4obQYi5mtfgpSzsizqYfJ0tlzRP3sZCqi7r AjJadbZod4Pwbm9j+s6oWiRUc7EBewzfb7R4Ey8FERjDC1VB3SVLwE5A8hjblS5WNe6j X8FzIB6s+PgPcJcDhwB87PL2IKC3N2FvXSJh3kieh1aDsFFTnzk+fyCX8JSTNoP9wpIX lACnuWamXJ7lamTzSoTeWJ+VsMbQqtZQdthc48sRu/WqzKJ5Ikt6p4a+7i3HwVOylY/C Tn3aO+Hoyd9iRTWlxDz/mLrfOFs6b+m/LO1apsnx8K3V0u0a4eC+1nBSHcO6yfjQE3q8 2jlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :content-transfer-encoding:mime-version:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=Nns+iWDQvA2sJB0vmoDamVWFjN4SVhaHlL6TS66GkcU=; b=O6Sj6E91FIhlJdmT1Y/BJYuNfF/reiKkhGWdieDIKflL0VRPI7jN9caG4iI4KpGixp EEYDLSVKeitPrqT7oJOXxBLZUTL0Lhl94JWlVVFwj6wETl0fZycIZ98H7t+KniFgaVjh 8/wjpQXpTXerkI6Nuslev/sq5mJka94ddS3rGiWpipqWdBjT2w32CVCgXlgERJDs8dOx mQjKj97XHi8lU7SN5fhS7w4d5MND+Y6s567CQdy0nEEZBycKDZLSbolR/rnvpnhSh9M8 eayQo4T+6tupPOFHJg8UZAW5pKTTYuDfHllMdBMhosAkZJrn8vD1NhXo5hLOmVmKfYFP sy2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hxqAK9Vt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q2-20020aa7da82000000b0050841a6c204si16589723eds.642.2023.04.28.08.59.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Apr 2023 08:59:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hxqAK9Vt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 414343858C2D for ; Fri, 28 Apr 2023 15:59:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 414343858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682697555; bh=Nns+iWDQvA2sJB0vmoDamVWFjN4SVhaHlL6TS66GkcU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=hxqAK9VtxHAfmQ8cUovKyl4OX0oFEGSfSQTa1VmzEJZdTi5UvpGZ+FR3silIsEGq4 oqvmP38rolcqDGd0+c0BJnxPZHwTxray6O8BJm+jqL8OqRKA188KlRxbR5kNf5SvLK yfamQ8hY6i/Z8yAVwdukwhyYfqJF+3I9YeERuR/U= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 To: Subject: [PATCH] testsuite: Handle empty assembly lines in check-function-bodies MIME-Version: 1.0 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764436273078093078?= X-GMAIL-MSGID: =?utf-8?q?1764436273078093078?= 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