From patchwork Thu May 18 13:03:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 95858 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp477358vqo; Thu, 18 May 2023 06:06:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HtEZQHt/iv3Qe8Vi3tQ1Vb1KMj5A0Tx62QpufULEFxEyCZ9b7FkVXxaIuqI6gaQvzzBtj X-Received: by 2002:a17:907:9445:b0:96a:3e7:b588 with SMTP id dl5-20020a170907944500b0096a03e7b588mr26797652ejc.40.1684415199802; Thu, 18 May 2023 06:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684415199; cv=none; d=google.com; s=arc-20160816; b=JCYOItrbBqsG3N8LxWtDoI/a8RAP3POIJRdp/PwYKTJMNz8kJgvSCm5JYjOpJmtV3X Iw4y3jyk7oN1qvjxWXXvfl+n8cLBygUSEIR+LkAvwW5qnNLZLjIaoLpKNDQXyGHvymX7 sb/5KzLd43rL0TVbGGlsdjHzVOTAgoVOCAxCXJXkTD/XwuQDJ21jSzq6F2+ZdnCdBsFq TWecYYf34YKQCDYn4MmIL7S9gzKTmYfVH0bixpHRzJxIFsjwYfKnE6P1mQ5nk9f9Shwf WB4BJo9Uz1dJI59Ur2+J8+xjebEdR0teyMubkt9wXytVi+Z5Kk8oqAp0dgZfZtUaZgT+ bAcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=jYn/DldPcLNKD3LnJS1ca+tu2+w3au1DsPzTKcWaoYw=; b=ZaeCfCNYXNR8FG837hs1mPUSZCFTXjTkWvhvKGOGdPlHGhWUBuSzdGhU9JmdeqTpWU wug5kJ1sv8RElMDFRTR99G7DDQXPMHF9F7GhO4AAwrJfq+HKL4GOkK6n5/O1AJxdeBD+ 8kwheyX1L4TmKO/or2ZsyrUzQ1nDiozMb2sdP1Ge7O9YLSwd0O/PkxNxlXyP8jaZ4Gg0 btTu0NjnkzcW5qWyb/rVGu2Cudo6KoYlMcuGpIjZI8c2+gGDFFgGrsXRO+ZO+A+0Xp0M +6+rhvij3o590pb245AT7n0MhG9NDO0dQltAPmYpsEyrAxMi//Od0g6Fn3vN06/hVI3g q+Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=x3utaHGg; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id p13-20020a170906604d00b0096f4deef5basi164868ejj.649.2023.05.18.06.06.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 06:06:39 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=x3utaHGg; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2D43538323F1 for ; Thu, 18 May 2023 13:05:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D43538323F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684415108; bh=jYn/DldPcLNKD3LnJS1ca+tu2+w3au1DsPzTKcWaoYw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=x3utaHGgCg+mNWxBhhJjRjWpfu0ZLPWJdlHfSWmiGIpLUrf01AUrCjjRZ2ZRci0rA 8bga6u2CsVPDRHex094+npcTjD9rX4wt7vnj24brpT+MwthZHljm+SCFMeXuB6dhQ0 on3Z8dV7HIck46d19lvbxj/XwOIvUmww0XnZIXrc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4F6DD388204E for ; Thu, 18 May 2023 13:04:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F6DD388204E Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-259-xQJS8Te2OUqkP4KmQoBxYQ-1; Thu, 18 May 2023 09:03:59 -0400 X-MC-Unique: xQJS8Te2OUqkP4KmQoBxYQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 652D828237CC for ; Thu, 18 May 2023 13:03:59 +0000 (UTC) Received: from localhost (unknown [10.42.28.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B6DE2026D16 for ; Thu, 18 May 2023 13:03:59 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH v2 2/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831] Date: Thu, 18 May 2023 14:03:58 +0100 Message-Id: <20230518130358.2106172-1-jwakely@redhat.com> In-Reply-To: <20230518125647.2105203-3-jwakely@redhat.com> References: <20230518125647.2105203-3-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766236839259319727?= X-GMAIL-MSGID: =?utf-8?q?1766237352900935241?= Fixes a fat finger error in the v1 patch, spotted by Jakub. -- >8 -- POSIX sh does not support the == for string comparisons, use = instead. The gen_directive_tests script uses a bash shebang so == does work, but there's no reason this script can't just use the more portable form anyway. PR bootstrap/105831 gcc/ChangeLog: * config.gcc: Use = operator instead of ==. gcc/testsuite/ChangeLog: * gcc.test-framework/gen_directive_tests: Use = operator instead of ==. --- gcc/config.gcc | 2 +- gcc/testsuite/gcc.test-framework/gen_directive_tests | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index e08c67d7cde..d88071773c9 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -2441,7 +2441,7 @@ riscv*-*-elf* | riscv*-*-rtems*) tmake_file="${tmake_file} riscv/t-rtems" ;; *) - if test "x${with_multilib_generator}" == xdefault; then + if test "x${with_multilib_generator}" = xdefault; then case "x${enable_multilib}" in xno) ;; xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;; diff --git a/gcc/testsuite/gcc.test-framework/gen_directive_tests b/gcc/testsuite/gcc.test-framework/gen_directive_tests index 29f0a734877..1cfc8432f60 100644 --- a/gcc/testsuite/gcc.test-framework/gen_directive_tests +++ b/gcc/testsuite/gcc.test-framework/gen_directive_tests @@ -283,8 +283,8 @@ one() { echo "${GOOD_PROG}" >> $FILE1 echo "${GOOD_PROG}" > $FILE2 - if [ "${FAIL_VERSION}" == "yes" ]; then - if [ "${EXP}" == "${EXP_PASS}" ]; then + if [ "${FAIL_VERSION}" = "yes" ]; then + if [ "${EXP}" = "${EXP_PASS}" ]; then NAME=${KIND}-${EXP_FAIL} else NAME=${KIND}-${EXP_XFAIL} @@ -322,8 +322,8 @@ two() { echo "${GOOD_PROG}" >> $FILE1 echo "${GOOD_PROG}" > $FILE2 - if [ "${FAIL_VERSION}" == "yes" ]; then - if [ "${EXP}" == "${EXP_PASS}" ]; then + if [ "${FAIL_VERSION}" = "yes" ]; then + if [ "${EXP}" = "${EXP_PASS}" ]; then NAME=${KIND1}-${KIND2}-${EXP_FAIL} else NAME=${KIND1}-${KIND2}-${EXP_XFAIL} @@ -364,8 +364,8 @@ three() { echo "${GOOD_PROG}" >> $FILE1 echo "${GOOD_PROG}" > $FILE2 - if [ "${FAIL_VERSION}" == "${yes}" ]; then - if [ "${EXP}" == "${EXP_PASS}" ]; then + if [ "${FAIL_VERSION}" = "${yes}" ]; then + if [ "${EXP}" = "${EXP_PASS}" ]; then NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_FAIL} else NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_XFAIL}