]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/fortran: add support for legacy .xor. operator
authorAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 24 Feb 2021 17:35:18 +0000 (17:35 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 25 Feb 2021 10:07:44 +0000 (10:07 +0000)
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
gdb/f-exp.y
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/dot-ops.exp

index 2ca7d3c6a05380193a3412d72b6639fd5676caec..8219a1fdb7d36f5e522b2dae39aa97bfb359df70 100644 (file)
@@ -1,3 +1,7 @@
+2021-02-25  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * f-exp.y (fortran_operators): Add ".xor.".
+
 2021-02-24  Tom de Vries  <tdevries@suse.de>
 
        PR symtab/27336
index e95a2c974ca9168952bbc229469f094e8f8f893b..64f5fd50857539780671e13ec57243231462fd9a 100644 (file)
@@ -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 },
index 922ba8caeca83da4d5a7dc517259cb49effd1d30..2bf9e41945f6e6d84e9fa3c7a4a8cc8e58075cf1 100644 (file)
@@ -1,3 +1,7 @@
+2021-02-25  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdb.fortran/dot-ops.exp (dot_operations): Test ".xor.".
+
 2021-02-24  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * gdb.base/sect-cmd.exp: Update expected results.
index cc9adf37aa4f0fa04d665c8225d40c083c3723f0..f71a821c55df3f9f48f39098a300eceb4bb274a0 100644 (file)
@@ -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."