From patchwork Thu Nov 23 17:07:36 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: 169054 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp590007vqx; Thu, 23 Nov 2023 09:08:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwdgLV4B3aPcz22UCC1h6MpS7rETcayKNlWYnMs30+hfsBefEU4J5KbtqhFprurZAobnlY X-Received: by 2002:a05:622a:44a:b0:418:152d:bf4 with SMTP id o10-20020a05622a044a00b00418152d0bf4mr7117081qtx.51.1700759284875; Thu, 23 Nov 2023 09:08:04 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1700759284; cv=pass; d=google.com; s=arc-20160816; b=XYo0rwUbPvLDK07g2cZKYw8Mq3YMqEe8Uf8t7Mfa0qHieRi5NUJ5hAt3QR0kRo3otC Zxl877wd2tBcOWIXcnGX3Hh8Pwr3bzsC/Ks15VOmacm2jImPgaCgdgv+X5mULpktA6zM 9CHxfh+S8Ob71iOdslRQoOqluJQhd/Sh7KsBzis9b+Ts3HY34DANNDDqIm6UhgbY97UF T9MHWePU8b58pn7QiIln43PbAFzsAHjy9fJKt+KxhISflt1/8uD7UtguLDfYscnx3uoC 5L6+kJS2RJ/xMptEg3zrwLQwiMjAKb35YiFGhWU/iy7Za4zHzViz3KtCrbxie4t8A3vh 0ZWw== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:date:message-id :content-transfer-encoding:mime-version:subject:cc:to:from :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=Tqyh2Zk08FmjVNE+pUa3brpDBZqwt4is6osvI6a3w80=; fh=oeK/P5AJE/SiZ4W15OGZY5BmuJv0674peXLd85mgKOY=; b=BrtAheIPLjJqibw5nqxfDEwmKqxuXpnIKJjlsYCGnomj82xlkZAG6e0//6NI/CJqAi UKlT8ern6+6TjbX0ub2gwQqrU9SS/71rdKSueaA/xfSvOf1Yi22PHNKXDpme27N55cRZ LML/t1uJ5M+Gd1CJTJm2xMBTy5e67ecD8sd32p2GcMN4f/SaVEMlL/K577V91+S6uHG3 hcexLusZhbq7DmSjdsKWWNc5N1XCDcXC4ENTV2lpcXE+huntLHb9vwgkqYD725lDpmD9 1Kxw0FYVAG9kq8AcwpdC3V/ZrsccLpByhJ2PYPf5Gim02e2TZUUQqaSJ3nzL/7zlOT7w T4eA== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@axis.com header.s=selector1 header.b=rIjHw5AE; arc=pass (i=2); 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=axis.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id e2-20020a05622a110200b004237ff3789esi1438428qty.363.2023.11.23.09.08.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 09:08:04 -0800 (PST) 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=@axis.com header.s=selector1 header.b=rIjHw5AE; arc=pass (i=2); 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=axis.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A021F386186A for ; Thu, 23 Nov 2023 17:08:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2070.outbound.protection.outlook.com [40.107.247.70]) by sourceware.org (Postfix) with ESMTPS id 8099838618A6 for ; Thu, 23 Nov 2023 17:07:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8099838618A6 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8099838618A6 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.247.70 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1700759260; cv=pass; b=hRgaFImhQMIXbS/xCIej3ptkiOA8cOR4n5BCxnjz1hXh9t2FAI8Di/3o5W1+8Pl+8Hzh3kdgNlBogUP3J8webkJE8ZnIh62UiJ73ZVB7X3BhJw/tcRXx4VUf7eaz2+zpG+wsRKvRDZESqgFOA1ZAlpvi+UC83NwJjJdz57u0w5s= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1700759260; c=relaxed/simple; bh=iZC9x2s4GFbKaWMT//56Sm1RxPQR14C7Cn87hXxMUkk=; h=DKIM-Signature:From:To:Subject:MIME-Version:Message-ID:Date; b=EmlZI/83BG97XDezzYh54jWuxoxOkAGet54WUhM7BQK0ugSyUgS/E9QUb4n6b3CUzLuawEdaqxAXlyOMixJPbEJX7lET1aX8Z+qlPKJAFKJnfbcAveN2bcMSLtUfN+3OHA+zd/Cvxha1lOESKETtqMkZl/ydOf37PQE56pz0Flo= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a2Ho7/+XHv9EZ1pO+Nq6HXLUC7F7IDg9a7iWkGIwd+kELJdBNOGlQacfHxOYD3kvYo5JSoDfHHPYlCjFWmaq9+gmP38CHckP3PncYF8GuzTIWub2oVoo2+DKEG2WKduyMCalcByHn/ubEofZdhbrbIPJ5jR9vrvTcStrKJc2Xas6loAa7GQa9wbkpmPe/T6SroRPJWM22nze/Df45xsRZHgi+VbF8+Zdp7ttYSFtw3kWHh4jgwkz6ejMtf3maEWsyKYQZ40CZu8S+3PykqVfeM+lELCs/uPRP2w7e3Nc7A6jdWagyWhVsnPHMHcYtVL5JDFnN51jbfaSizuoa/oNyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Tqyh2Zk08FmjVNE+pUa3brpDBZqwt4is6osvI6a3w80=; b=nhsUNIliKwiPfKqTl9kQTBIdfuLLrUmqsY2FSFxSQ5kymYcdpVG3SA0oBQrMjmfyy/w3k0X0vTnZfj5XmhhwfRpTfloLGBOCQ+3iehwBMxUgJHApkaEDnqhjfDLIfGJhAVTKqMAwYCCiK+4IAbCSz11TZZvqdLfb6CcBaYipJj9f/sonCkmAnVjsGQ233c2Br8KOhtnr1yUuqVU/oPHKhmhOHfWBC6V10nz/7ST0jmQqLEQj1kryt+EmiYNe06HMexe0A1/C+udKxKmmdEkP4f5c1p8E7wzN7/a8CnFn4yYN4lS9q1XG2KK2dnQ05rYFu8Yu7K+mWnr6xDeSeVm6sQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 195.60.68.100) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=axis.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Tqyh2Zk08FmjVNE+pUa3brpDBZqwt4is6osvI6a3w80=; b=rIjHw5AEclnjvNLHoOd94T+nlDQSIxBqpPIRDIMWix9pgHJNlwT7xdBf9Sys4gWSUVsP5EVzGxx7TLgzLfxVVyHlgpzE6b9apYAM6qFh+s4z9dgu2jxi+F2wis751rAQVsNJ2fi5quJ1xxC7cf36d17O/Xz6ofNQFBuyXXE8uE0= Received: from AS9PR06CA0540.eurprd06.prod.outlook.com (2603:10a6:20b:49d::32) by PAVPR02MB9111.eurprd02.prod.outlook.com (2603:10a6:102:323::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20; Thu, 23 Nov 2023 17:07:37 +0000 Received: from AM2PEPF0001C708.eurprd05.prod.outlook.com (2603:10a6:20b:49d:cafe::b1) by AS9PR06CA0540.outlook.office365.com (2603:10a6:20b:49d::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18 via Frontend Transport; Thu, 23 Nov 2023 17:07:37 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=axis.com; Received-SPF: Fail (protection.outlook.com: domain of axis.com does not designate 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; Received: from mail.axis.com (195.60.68.100) by AM2PEPF0001C708.mail.protection.outlook.com (10.167.16.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 17:07:36 +0000 Received: from SE-MAILARCH01W.axis.com (10.20.40.15) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 23 Nov 2023 18:07:36 +0100 Received: from se-mail01w.axis.com (10.20.40.7) by SE-MAILARCH01W.axis.com (10.20.40.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 23 Nov 2023 18:07:36 +0100 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Thu, 23 Nov 2023 18:07:36 +0100 Received: from pchp3.se.axis.com (pchp3.se.axis.com [10.88.21.53]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 44652E7D7; Thu, 23 Nov 2023 18:07:36 +0100 (CET) Received: by pchp3.se.axis.com (Postfix, from userid 171) id 40CD020427; Thu, 23 Nov 2023 18:07:36 +0100 (CET) From: Hans-Peter Nilsson To: CC: Subject: [PATCH 1/3] contrib/regression/btest-gcc.sh: Handle multiple options. MIME-Version: 1.0 Message-ID: <20231123170736.40CD020427@pchp3.se.axis.com> Date: Thu, 23 Nov 2023 18:07:36 +0100 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C708:EE_|PAVPR02MB9111:EE_ X-MS-Office365-Filtering-Correlation-Id: f46e3f3e-c307-4254-f7ce-08dbec46b146 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qvLggkt464/6G2ITooANq+U7IN6gU4gReQl7+oZx67unkjVCw9ixuDtDPY0wGVmLbY43/DqOvJa2kjMoiTCao5+LGggcuw7v/7mxH4E9IjhfbfvODRhi/AI7YmKgAIttuqxLXI5s5Og/oJY4URxfimnurs0c8B4X6D4Q1jeAxjzTwyXDFIJCXq+WgiC5aNiflx54TaEeWa+Ja1ltuVPqmcq1HsFbi8DCiMGbA4rJV0OZlehRWGTb/gIwz08pVb0XV/tvhUybKwsXTk73DsKifhrcNEemSP4kIwC8O9/sZZJCBGDpsLjOcTA/1Lri4PVIY6iD+ylB4Y+mS1qnsMCCazb0r8NjUAEO+HtdYTzBbvXK9j7r7BP6f1Jg8TIxAIcT+OELNSQdNSkbsgBb1fw8dsaDON+wAN3zw2xVDsRnOt+hnLelTYPrC59aYTjzGpQjfQ0NnPHhI/5ceDQl6vNmJuvCFDyC0Fr7a5VcfEZNWDJqbBDCsccv8gG1R0Ujv/SXWm4vO4yRRkKqzQ0h+NE17pFSPDFuezbRO5ci6FJB9M+BOKL3Zo0cosvSG4SgEDfeLGEW2Y7hpWdwSVZUJt70tkgObISmt+VR0KjK7qJZ6sgi+4cDCYjUM9VakxHycTAZlz136bKujK1facEbDj2MKzFU+w15D2Au5EvElABz9NOy2Q57BXQOJIR5EpG2pEMt3i9gPn5b/k5uNCSzrdKTD3r3vmt3fVrKqR/19Lzb2mQQdbCQPbL4LxzKUtFqqkhp+CGvhgztMo4R5j7uOy967Q== X-Forefront-Antispam-Report: CIP:195.60.68.100; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.axis.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(136003)(346002)(396003)(376002)(39860400002)(230922051799003)(451199024)(82310400011)(1800799012)(64100799003)(186009)(40470700004)(46966006)(36840700001)(40460700003)(83380400001)(4326008)(8676002)(316002)(6916009)(42186006)(426003)(6266002)(336012)(70206006)(5660300002)(70586007)(36860700001)(2906002)(47076005)(478600001)(26005)(1076003)(8936002)(82740400003)(40480700001)(81166007)(41300700001)(33656002)(356005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 17:07:36.8672 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f46e3f3e-c307-4254-f7ce-08dbec46b146 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af; Ip=[195.60.68.100]; Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C708.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR02MB9111 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783375368284498667 X-GMAIL-MSGID: 1783375368284498667 Deliberately not using getopt. Tested by adding a line right after this code echoing $dashj, $add_passes_despite_regression, and $1 (then exit) and checking that I got it right for combinations of -j j4 --add-passes-despite-regression. -- >8 -- This is a long-standing bug: passing "-j --add-passes-despite-regression" or "--add-passes-despite-regression -j" caused the second option to be treated as TARGET; the first non-option parameter. * btest-gcc.sh (Option handling): Handle multiple options. --- contrib/regression/btest-gcc.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/contrib/regression/btest-gcc.sh b/contrib/regression/btest-gcc.sh index 1808fcc392fa..22e8f0398662 100755 --- a/contrib/regression/btest-gcc.sh +++ b/contrib/regression/btest-gcc.sh @@ -29,13 +29,16 @@ dashj='' # -j: # Pass '-j' to make. -case "$1" in - --add-passes-despite-regression) - add_passes_despite_regression=1; shift;; - -j*) - dashj=$1; shift;; - -*) echo "Invalid option: $1"; exit 2;; -esac +while : ; do + case "$1" in + --add-passes-despite-regression) + add_passes_despite_regression=1; shift;; + -j*) + dashj=$1; shift;; + -*) echo "Invalid option: $1"; exit 2;; + *) break;; + esac +done # TARGET is the target triplet. It should be the same one as used in # constructing PREFIX. Or it can be the keyword 'native', indicating