diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-02-24 17:35:18 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-02-25 10:07:44 +0000 |
commit | 170f4b23b6df18f6f9eb178530b96d3b056818ed (patch) | |
tree | 9fbdbc267782aed3346fe1efe5f809850f422d30 /gdb | |
parent | bbaddd4bbeba65200ee805d87c2e3a845842e3eb (diff) | |
download | gdb-170f4b23b6df18f6f9eb178530b96d3b056818ed.zip gdb-170f4b23b6df18f6f9eb178530b96d3b056818ed.tar.gz gdb-170f4b23b6df18f6f9eb178530b96d3b056818ed.tar.bz2 |
gdb/fortran: add support for legacy .xor. operator
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.".
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/f-exp.y | 1 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.fortran/dot-ops.exp | 8 |
4 files changed, 17 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2ca7d3c..8219a1f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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 diff --git a/gdb/f-exp.y b/gdb/f-exp.y index e95a2c9..64f5fd5 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/ChangeLog b/gdb/testsuite/ChangeLog index 922ba8c..2bf9e41 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -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. diff --git a/gdb/testsuite/gdb.fortran/dot-ops.exp b/gdb/testsuite/gdb.fortran/dot-ops.exp index cc9adf3..f71a821 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." |