diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-01-11 14:14:02 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-01-12 09:40:55 +0000 |
commit | 7c654b719d2c186bd645a560525dd3e9c86d15cd (patch) | |
tree | ca0796d3a81e868c0c293de82474d3ae50af5792 /gdb/testsuite/gdb.fortran | |
parent | e998918e9890d5efc0270ad6f140e098eaf0081f (diff) | |
download | gdb-7c654b719d2c186bd645a560525dd3e9c86d15cd.zip gdb-7c654b719d2c186bd645a560525dd3e9c86d15cd.tar.gz gdb-7c654b719d2c186bd645a560525dd3e9c86d15cd.tar.bz2 |
gdb/fortran: add symbol base comparison operators
Fortran supports symbol based comparison operators as well as the
classic text based comparison operators, so we have:
Text | Symbol
Operator | Operator
---------|---------
.eq. | ==
.ne. | /=
.le. | <=
.ge. | >=
.gt. | >
.lt. | <
This commit adds the symbol based operators as well as some tests.
gdb/ChangeLog:
* f-exp.y (dot_ops): Rename to...
(fortran_operators): ...this. Add a header comment. Add symbol
based operators.
(yylex): Update to use fortran_operators not dot_ops. Remove
special handling for '**', this is now included in
fortran_operators.
gdb/testsuite/ChangeLog:
* gdb.fortran/dot-ops.exp: Add new tests.
Diffstat (limited to 'gdb/testsuite/gdb.fortran')
-rw-r--r-- | gdb/testsuite/gdb.fortran/dot-ops.exp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.fortran/dot-ops.exp b/gdb/testsuite/gdb.fortran/dot-ops.exp index 8454f7e..cc9adf3 100644 --- a/gdb/testsuite/gdb.fortran/dot-ops.exp +++ b/gdb/testsuite/gdb.fortran/dot-ops.exp @@ -109,6 +109,36 @@ proc test_dot_operations {} { gdb_test "p 4 $gt 4" " = .FALSE." gdb_test "p 3 $gt 4" " = .FALSE." } + + # Now test the symbol based comparison operators. + + # Arithmetic EQ + gdb_test "p 5 == 4" " = .FALSE." + gdb_test "p 4 == 4" " = .TRUE." + + # Arithmetic NE + gdb_test "p 5 /= 4" " = .TRUE." + gdb_test "p 4 /= 4" " = .FALSE." + + # Arithmetic LE + gdb_test "p 5 <= 4" " = .FALSE." + gdb_test "p 4 <= 4" " = .TRUE." + gdb_test "p 3 <= 4" " = .TRUE." + + # Arithmetic LT + gdb_test "p 5 < 4" " = .FALSE." + gdb_test "p 4 < 4" " = .FALSE." + gdb_test "p 3 < 4" " = .TRUE." + + # Arithmetic GE + gdb_test "p 5 >= 4" " = .TRUE." + gdb_test "p 4 >= 4" " = .TRUE." + gdb_test "p 3 >= 4" " = .FALSE." + + # Arithmetic GT + gdb_test "p 5 > 4" " = .TRUE." + gdb_test "p 4 > 4" " = .FALSE." + gdb_test "p 3 > 4" " = .FALSE." } # Start of test script. |