From patchwork Sun Jul 14 19:45:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B8rgen_Kvalsvik?= X-Patchwork-Id: 1960371 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; secure) header.d=kolabnow.com header.i=@kolabnow.com header.a=rsa-sha256 header.s=dkim20240523 header.b=IleJow8T; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4WMbS46Hkqz1xqc for ; Mon, 15 Jul 2024 05:46:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 098DB3864824 for ; Sun, 14 Jul 2024 19:46:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx.kolabnow.com (mx.kolabnow.com [212.103.80.154]) by sourceware.org (Postfix) with ESMTPS id B0A093858CDB for ; Sun, 14 Jul 2024 19:46:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0A093858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lambda.is Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lambda.is ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B0A093858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=212.103.80.154 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720986369; cv=none; b=ln4km8DqoZ6mj+ZOQU4iGKph5sLrDU5AtUqqZDlPgA2MZGFWgLMK+D/xGj4Esb9LjzkctHRYMycv3wOkLrYGmC+6+dqF8SnCimJKjaSgAjLUtfb9US8nJc2WCdtaP6rvvVrpmb9FubUEwl6D70ipYFjNJf6X9kGOnWTX9HHQ9Qk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720986369; c=relaxed/simple; bh=vUV+9Zig/d8JNfADIe44HsfKasA+ZDvP2n0LrXaF6Qk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=J1XrOK3+Jiz1W8CnFbkrgo1Sm2HqC3I2O+/2otEtil++vDly4NCslWC/gLn0Ux3w4W+8/c+eox5QudxO/MDm8LbBpzoLRmzXiF1eHGmGwpW3NdRmpxsA1XIDvxuryCeUjDAN9IEPXW7VrU8iVzEuXkzT4BC61ibmUryLyyv1B+c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 4950734E77AC; Sun, 14 Jul 2024 21:46:05 +0200 (CEST) Authentication-Results: ext-mx-out013.mykolab.com (amavis); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:mime-version:message-id:date:date :subject:subject:from:from:received:received:received; s= dkim20240523; t=1720986364; x=1722800765; bh=6I4SLSKYRr0MRkUDKfa ejiojdwrUlJnLgXFfD/+tbY0=; b=IleJow8Tq+QttnDkAOapV80X43UE+2oFxjq U9ktW3pWyBiIPLvgnpgei9nmjJT5ha1cXaFc3+SqCr+L6u1UANFmn1YcnKlysaDJ nY7YNXrKAun6VWnm60ArFDoarRnMvsHBdpk3k1kCeh/+19lxZRoKrk6Q4dJmibKz AGWP+LnSZ3xXWrp48sjFlq/g900HLfYmfOI8q4XF65dI6uZTFY6EAvwe9Li9XVxX LA7Myml2ei1YBPZ5R8Grl5R/HZa8DAA39euDoFZ4V8Uo5q+zvaXdEDU/zQd9qhrz TCuwOmQ8sBC5oOXMPSvRGxk7gvhIwgZXUJca/VndDujnso5ULfQ== X-Virus-Scanned: amavis at mykolab.com X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out013.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id 3MLuIvoK9Bnr; Sun, 14 Jul 2024 21:46:04 +0200 (CEST) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id 8F95B34E77AB; Sun, 14 Jul 2024 21:46:04 +0200 (CEST) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id 581402096A0D; Sun, 14 Jul 2024 21:46:04 +0200 (CEST) From: =?utf-8?q?J=C3=B8rgen_Kvalsvik?= To: gcc-patches@gcc.gnu.org Cc: jeffreyalaw@gmail.com, roger@nextmovesoftware.com, =?utf-8?q?J=C3=B8rgen?= =?utf-8?q?_Kvalsvik?= Subject: [PATCH] Use foreach, not lmap, for tcl <= 8.5 compat Date: Sun, 14 Jul 2024 21:45:52 +0200 Message-Id: <20240714194552.2871802-1-j@lambda.is> MIME-Version: 1.0 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 lmap was introduced in tcl 8.6, and while it was released in 2012, lmap does not really make too much of a difference to warrant the friction on consverative (and relevant) systems. gcc/testsuite/ChangeLog: * lib/gcov.exp: Use foreach for tcl <= 8.5. --- gcc/testsuite/lib/gcov.exp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/gcc/testsuite/lib/gcov.exp b/gcc/testsuite/lib/gcov.exp index 3fc7b65bee5..68696c9aa50 100644 --- a/gcc/testsuite/lib/gcov.exp +++ b/gcc/testsuite/lib/gcov.exp @@ -512,25 +512,29 @@ proc verify-filters { testname testcase file expected unexpected } { set seen [lsort -unique $seen] - set expected [lmap key $expected { - if { $key in $seen } continue - set key - }] - set unexpected [lmap key $unexpected { - if { $key ni $seen } continue - set key - }] - - foreach sym $expected { + set ex {} + foreach key $expected { + if { $key ni $seen } { + lappend ex $key + } + } + set unex {} + foreach key $unexpected { + if { $key in $seen } { + lappend unex $key + } + } + + foreach sym $ex { fail "Did not see expected symbol '$sym'" } - foreach sym $unexpected { + foreach sym $unex { fail "Found unexpected symbol '$sym'" } close $fd - return [expr [llength $expected] + [llength $unexpected]] + return [expr [llength $ex] + [llength $unex]] } proc verify-prime-paths { testname testcase file } {