aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorFelix Willgerodt <felix.willgerodt@intel.com>2021-03-09 11:34:55 +0100
committerFelix Willgerodt <felix.willgerodt@intel.com>2021-03-09 11:34:55 +0100
commit611aa09d994fc5a8a9444075e65f0d6d4ebf4922 (patch)
treeeffc6393a6e4c210d02a40ce547454402215ed99 /gdb/testsuite
parenteef32f59988bb0e4514d5395093c9e6d8d073ebb (diff)
downloadgdb-611aa09d994fc5a8a9444075e65f0d6d4ebf4922.zip
gdb-611aa09d994fc5a8a9444075e65f0d6d4ebf4922.tar.gz
gdb-611aa09d994fc5a8a9444075e65f0d6d4ebf4922.tar.bz2
gdb/fortran: Add 'LOC' intrinsic support.
LOC(X) returns the address of X as an integer: https://gcc.gnu.org/onlinedocs/gfortran/LOC.html Before: (gdb) p LOC(r) No symbol "LOC" in current context. After: (gdb) p LOC(r) $1 = 0xffffdf48 gdb/ChangeLog: 2021-03-09 Felix Willgerodt <felix.willgerodt@intel.com> * f-exp.h (eval_op_f_loc): Declare. (expr::fortran_loc_operation): New typedef. * f-exp.y (exp): Handle UNOP_FORTRAN_LOC after parsing an UNOP_INTRINSIC. (f77_keywords): Add LOC keyword. * f-lang.c (eval_op_f_loc): New function. * std-operator.def (UNOP_FORTRAN_LOC): New operator. gdb/testsuite/ChangeLog: 2020-03-09 Felix Willgerodt <felix.willgerodt@intel.com> * gdb.fortran/intrinsics.exp: Add LOC tests.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.fortran/intrinsics.exp5
2 files changed, 9 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ea1401c..9da8a9b 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2020-03-04 Felix Willgerodt <felix.willgerodt@intel.com>
+
+ * gdb.fortran/intrinsics.exp: Add LOC tests.
+
2021-03-09 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.fortran/shape.exp: New file.
diff --git a/gdb/testsuite/gdb.fortran/intrinsics.exp b/gdb/testsuite/gdb.fortran/intrinsics.exp
index d0ac194..84f486f 100644
--- a/gdb/testsuite/gdb.fortran/intrinsics.exp
+++ b/gdb/testsuite/gdb.fortran/intrinsics.exp
@@ -84,3 +84,8 @@ gdb_test "ptype MODULO (3.0,2.0)" "type = real\\*8"
# Test CMPLX
gdb_test "p CMPLX (4.1, 2.0)" " = \\(4.$decimal,2\\)"
+
+# Test LOC
+
+gdb_test "p/x LOC(l)" "= $hex"
+gdb_test "ptype loc(l)" "type = integer(\\*$decimal)?"