From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT 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 List-Id: 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 -- 2.30.2