From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id B756E3858C52 for ; Fri, 23 Sep 2022 09:32:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B756E3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F1700139F; Fri, 23 Sep 2022 02:32:24 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CBED33FA27; Fri, 23 Sep 2022 02:32:17 -0700 (PDT) From: Richard Sandiford To: Tamar Christina Mail-Followup-To: Tamar Christina ,gcc-patches@gcc.gnu.org, nd@arm.com, richard.sandiford@arm.com Cc: gcc-patches@gcc.gnu.org, nd@arm.com Subject: Re: [PATCH][testsuite]: make check-functions-body dump expected and seen cases on failure. References: Date: Fri, 23 Sep 2022 10:32:16 +0100 In-Reply-To: (Tamar Christina's message of "Fri, 23 Sep 2022 10:23:03 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-47.5 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP 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: Tamar Christina writes: > Hi All, > > 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. > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > Ok for master? > > Thanks, > Tamar > > gcc/testsuite/ChangeLog: > > * lib/scanasm.exp (check_function_body): Add debug output to verbose log > on failure. OK, thanks. Richard > > --- inline copy of patch -- > diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp > index a80630bb2a819812ce1fe05184535011a12f1288..7c9dcfc9b2e49093355219f76838161f4c3302df 100644 > --- a/gcc/testsuite/lib/scanasm.exp > +++ b/gcc/testsuite/lib/scanasm.exp > @@ -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: