From patchwork Tue Nov 28 13:23:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 1869275 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=cebitec.uni-bielefeld.de header.i=@cebitec.uni-bielefeld.de header.a=rsa-sha256 header.s=20200306 header.b=mp8SH/JR; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sfjpj11jyz1yST for ; Wed, 29 Nov 2023 00:24:13 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3772C382F90B for ; Tue, 28 Nov 2023 13:24:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 98A8438493C2 for ; Tue, 28 Nov 2023 13:23:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 98A8438493C2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cebitec.uni-bielefeld.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 98A8438493C2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=129.70.160.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701177839; cv=none; b=ksVnQj3l1WVBbNsIMHkd4VRpBSrxjIbS6NDUD7Hwt88f78I7t4+mH5EOi77bYL0TebFhz5tGXDUfktpXyC6eYCIEH9/jkKx/H6Qk4kDNwKt+JTt2KodS2ql3hxRsU+N8ebssNJ8SmSYxgxZpqjESJL9Joxfg7HAt2D/2vQtLb3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701177839; c=relaxed/simple; bh=KvFIC0Hi1SBgqybkgTZXKt4Z04ATdC6ltA0mLt4M6RI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UDTX69cQCMQxbItnHfM3EJIhbP3QyKghqKxj/QPpjHz1PG58Nf2Bxy3+sN5FH8Ct+yKzilL8JvFl7f/nkE2YbMYUW98j9EYgzfcu1BAyFptbGAQV3Miw0UVZubV7ZI/MWYcQ/Y2z+8NmnDKpNk/35pR6wM5unzN5ZkL7EOTZiYg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 4FBF4C03F9; Tue, 28 Nov 2023 14:23:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= cebitec.uni-bielefeld.de; h=content-type:content-type :mime-version:user-agent:message-id:date:date:subject:subject :from:from:received:received; s=20200306; t=1701177835; bh=KvFIC 0Hi1SBgqybkgTZXKt4Z04ATdC6ltA0mLt4M6RI=; b=mp8SH/JRIHYmo3ciDSS6t 25+pDS72NczNnkV0AK5mTiLi1X6Ajfcndu3nD+Rsqdn38+QKFUc5+73BHRtnnvX1 +XgKkv+8b++XwKuQS/xdm1Tvmh9gEi7PLaIlh2xID8VMS8BfeEyZfAJ/fXvyQxQj yz+7CC2eP5Hwf1puXbo+k8mhMp61IjprGbSTniIRy03Q49OWJXDNhINP7CZyvHHv Gnk94wSf84/xeBp8cg94uGFjbmIrlxmX0R98Kmr0c5T6aJllrYJbHM32tCB5N7d3 vm1Q38HPq/OTYIbeiDt25P2K3dVZEi4IBVdbVYavwKbTQMH9bITRJakMxHGn/TSC A== X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Z1BKIUEuXUeW; Tue, 28 Nov 2023 14:23:55 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p4fddb508.dip0.t-ipconnect.de [79.221.181.8]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id D6A2ABFDFE; Tue, 28 Nov 2023 14:23:55 +0100 (CET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Joern Rennecke Subject: [PATCH] testsuite: Handle double-quoted LTO section names [PR112728] Date: Tue, 28 Nov 2023 14:23:55 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 X-Spam-Status: No, score=-3791.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org The gcc.dg/scantest-lto.c test FAILs on Solaris/SPARC with the native as: FAIL: gcc.dg/scantest-lto.c scan-assembler-not ascii FAIL: gcc.dg/scantest-lto.c scan-assembler-times ascii 0 It requires double-quoting the section name which scanasm.exp doesn't allow for. This patch fixes that. Tested on sparc-sun-solaris2.11 (as and gas) and i386-pc-solaris2.11 (as and gas). As reported in PR testsuite/112728, there are more targets where this test FAILs, but I cannot say why and those are probably different issues. I guess this patch is pretty obvious and can be committed under my testsuite maintainership, but I may be overlooking something? Thanks. Rainer # HG changeset patch # Parent 00ba0ae2e7291afbbcee5f4abe6fb041e3cc5448 testsuite: Handle double-quoted LTO section names diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp --- a/gcc/testsuite/lib/scanasm.exp +++ b/gcc/testsuite/lib/scanasm.exp @@ -82,8 +82,8 @@ proc dg-scan { name positive testcase ou if { [string compare -length 14 $name scan-assembler] == 0 } { # Remove LTO sections. # ??? Somehow, .*? is still greedy. - # regsub -all {(^|\n)[[:space:]]*\.section[[:space:]]*\.gnu\.lto_.*?\n(?=[[:space:]]*\.text\n)} $text {\1} text - regsub -all {(^|\n)[[:space:]]*\.section[[:space:]]*\.gnu\.lto_(?:[^\n]*\n(?![[:space:]]*\.(section|text|data|bss)))*[^\n]*\n} $text {\1} text + # regsub -all {(^|\n)[[:space:]]*\.section[[:space:]]*"?\.gnu\.lto_.*?\n(?=[[:space:]]*\.text\n)} $text {\1} text + regsub -all {(^|\n)[[:space:]]*\.section[[:space:]]*"?\.gnu\.lto_(?:[^\n]*\n(?![[:space:]]*\.(section|text|data|bss)))*[^\n]*\n} $text {\1} text } set match [regexp -- $pattern $text] @@ -503,7 +503,7 @@ proc scan-assembler-times { args } { set fd [open $output_file r] set text [read $fd] close $fd - regsub -all {(^|\n)[[:space:]]*\.section[[:space:]]*\.gnu\.lto_(?:[^\n]*\n(?![[:space:]]*\.(section|text|data|bss)))*[^\n]*\n} $text {\1} text + regsub -all {(^|\n)[[:space:]]*\.section[[:space:]]*"?\.gnu\.lto_(?:[^\n]*\n(?![[:space:]]*\.(section|text|data|bss)))*[^\n]*\n} $text {\1} text set result_count [llength [regexp -inline -all -- $pattern $text]] if {$result_count == $times} { @@ -565,7 +565,7 @@ proc scan-assembler-dem { args } { set output [remote_exec host "$cxxfilt" "" "$output_file"] set text [lindex $output 1] - regsub -all {(^|\n)[[:space:]]*\.section[[:space:]]*\.gnu\.lto_(?:[^\n]*\n(?![[:space:]]*\.(section|text|data|bss)))*[^\n]*\n} $text {\1} text + regsub -all {(^|\n)[[:space:]]*\.section[[:space:]]*"?\.gnu\.lto_(?:[^\n]*\n(?![[:space:]]*\.(section|text|data|bss)))*[^\n]*\n} $text {\1} text if [regexp -- $pattern $text] { pass "$testcase scan-assembler-dem $pp_pattern" @@ -622,7 +622,7 @@ proc scan-assembler-dem-not { args } { set output [remote_exec host "$cxxfilt" "" "$output_file"] set text [lindex $output 1] - regsub -all {(^|\n)[[:space:]]*\.section[[:space:]]*\.gnu\.lto_(?:[^\n]*\n(?![[:space:]]*\.(section|text|data|bss)))*[^\n]*\n} $text {\1} text + regsub -all {(^|\n)[[:space:]]*\.section[[:space:]]*"?\.gnu\.lto_(?:[^\n]*\n(?![[:space:]]*\.(section|text|data|bss)))*[^\n]*\n} $text {\1} text if ![regexp -- $pattern $text] { pass "$testcase scan-assembler-dem-not $pp_pattern"