From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YUbYEK6TNmC4GwAAWB0awg (envelope-from ) for ; Wed, 24 Feb 2021 12:58:06 -0500 Received: by simark.ca (Postfix, from userid 112) id 3987A1EF78; Wed, 24 Feb 2021 12:58:06 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=DKIM_SIGNED,MAILING_LIST_MULTI, RDNS_NONE,T_DKIM_INVALID,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 947D71E590 for ; Wed, 24 Feb 2021 12:58:05 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 148DB38708D9; Wed, 24 Feb 2021 17:58:05 +0000 (GMT) Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 5CF3238708D9 for ; Wed, 24 Feb 2021 17:58:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5CF3238708D9 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wm1-x333.google.com with SMTP id k66so2634795wmf.1 for ; Wed, 24 Feb 2021 09:58:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YFziqxjyrGwpUVMp5WcwA9vW7Oj2FX6Hv2RD6E3Nnm4=; b=gY5lLUen3uQkeYFEPSFk6ME9I70eiVUY43hkN7h/zowHyVgQstNpNJa4bv48xkjSfZ mQfjmKPErKoWRQWgpKMVwtVTR94nurVT/cJkQ+NFM56sES/GNGZAJ4NAFfk7GwKYobDS wXSi683BExgwngzbOXJ2qci4whRdShNiGwYwIAj1OrrzelI/gNrbMInREGaI91t4qPND l7GWEtwv5za1sI0LVLzeQ40KaZ/01mnINTtkBgkqSgk0cSvaqePoKKAMwtHIOSiKytWA zVb1YyuQbmdYwQW6vSn7HIIPqJ2grKU7XESQ7ikr5ZH9EJrW1+/l4hT7Vn5fk3/GSOmq 1b3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YFziqxjyrGwpUVMp5WcwA9vW7Oj2FX6Hv2RD6E3Nnm4=; b=pmswWUD9DDrxWyHQWKYT2ofNxoOgxKRi2AhIr7PghnHKP+w8QNFsFrz9ayV9CRu4FK EQHF1wnxEAfYSV48Lvcb6R4BA+xmrkVie2HF470FcJFm0aGPrLHoRlLK5FiO+5/L0fNq FKv1qQw/JvK+rliigw8CDMc+eDpfgT6F6hrFzr7k2d3W6AFyroOc8Yj/Z51vKy8YRgYh IqPn0llywwPYX0c6JvQNsmeWievZ7kQXE+a0+91qZi0hTmyFqOxs95XE6KwcjLMO5hNz LN2rck9pB4pJThK4ZzrRR2tqjQh+WSEYTDuwE8W/FvSNWMLLpxuZ7kCbOKHoNwxQQGTw G7Pg== X-Gm-Message-State: AOAM532VuoDuI2pUi4qOrKEUdtLcJfTtSH/xNePCkIThHvcmMDDka4Nm SEdrAW92oiLgQAWPdqTjpYvxrrQSiZduvQ== X-Google-Smtp-Source: ABdhPJz60K1XXxqUCqlWIENWWwUGGw2Gzl54HEOAp63XZDDOIKvTp/74GAMsnOfh7/vUI7TyINUezg== X-Received: by 2002:a1c:dd09:: with SMTP id u9mr4727671wmg.183.1614189480767; Wed, 24 Feb 2021 09:58:00 -0800 (PST) Received: from localhost (host86-186-80-154.range86-186.btcentralplus.com. [86.186.80.154]) by smtp.gmail.com with ESMTPSA id 19sm4394457wmg.2.2021.02.24.09.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 09:58:00 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCH] gdb/fortran: add support for legacy .xor. operator Date: Wed, 24 Feb 2021 17:57:57 +0000 Message-Id: <20210224175757.2010947-1-andrew.burgess@embecosm.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" gfortran supports .xor. as an alias for .neqv., see: https://gcc.gnu.org/onlinedocs/gfortran/_002eXOR_002e-operator.html this commit adds support for this operator to GDB. gdb/ChangeLog: * f-exp.y (fortran_operators): Add ".xor.". gdb/testsuite/ChangeLog: * gdb.fortran/dot-ops.exp (dot_operations): Test ".xor.". --- gdb/ChangeLog | 4 ++++ gdb/f-exp.y | 1 + gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.fortran/dot-ops.exp | 8 ++++++++ 4 files changed, 17 insertions(+) diff --git a/gdb/f-exp.y b/gdb/f-exp.y index e95a2c974ca..64f5fd50857 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -982,6 +982,7 @@ static const struct token fortran_operators[] = { ".eq.", EQUAL, BINOP_END, false }, { ".eqv.", EQUAL, BINOP_END, false }, { ".neqv.", NOTEQUAL, BINOP_END, false }, + { ".xor.", NOTEQUAL, BINOP_END, false }, { "==", EQUAL, BINOP_END, false }, { ".ne.", NOTEQUAL, BINOP_END, false }, { "/=", NOTEQUAL, BINOP_END, false }, diff --git a/gdb/testsuite/gdb.fortran/dot-ops.exp b/gdb/testsuite/gdb.fortran/dot-ops.exp index cc9adf37aa4..f71a821c55d 100644 --- a/gdb/testsuite/gdb.fortran/dot-ops.exp +++ b/gdb/testsuite/gdb.fortran/dot-ops.exp @@ -31,6 +31,7 @@ proc test_dot_operations {} { set not ".NOT." set eqv ".EQV." set neqv ".NEQV." + set xor ".XOR." set eq ".EQ." set ne ".NE." set le ".LE." @@ -45,6 +46,7 @@ proc test_dot_operations {} { set not ".not." set eqv ".eqv." set neqv ".neqv." + set xor ".xor." set eq ".eq." set ne ".ne." set le ".le." @@ -81,6 +83,12 @@ proc test_dot_operations {} { gdb_test "p $false $neqv $true" " = .TRUE." gdb_test "p $false $neqv $false" " = .FALSE." + # And the legacy alias for NEQV, XOR + gdb_test "p $true $xor $true" " = .FALSE." + gdb_test "p $true $xor $false" " = .TRUE." + gdb_test "p $false $xor $true" " = .TRUE." + gdb_test "p $false $xor $false" " = .FALSE." + # Arithmetic EQ gdb_test "p 5 $eq 4" " = .FALSE." gdb_test "p 4 $eq 4" " = .TRUE." -- 2.25.4