aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.fortran
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.fortran')
-rw-r--r--gdb/testsuite/gdb.fortran/types.exp31
1 files changed, 27 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.fortran/types.exp b/gdb/testsuite/gdb.fortran/types.exp
index 8122cbc..5ab44b1 100644
--- a/gdb/testsuite/gdb.fortran/types.exp
+++ b/gdb/testsuite/gdb.fortran/types.exp
@@ -71,13 +71,35 @@ proc test_float_literal_types_accepted {} {
gdb_test "pt 10e20" "type = real\\*\[0-9\]+"
}
+# Test the default primitive Fortran types.
+proc test_default_types {} {
+ gdb_test "ptype integer*4" "type = integer"
+ gdb_test "ptype integer_4" "type = integer"
+
+ gdb_test "ptype logical" "type = logical*4"
+
+ gdb_test "ptype real*4" "type = real"
+ gdb_test "ptype real_4" "type = real"
+
+ gdb_test "ptype complex" "type = complex*4"
+}
+
# Test the the primitive Fortran types, those that GDB should always
# know, even if the program does not define them, are in fact, known.
proc test_primitive_types_known {} {
- foreach type {void character logical*1 integer*1 integer*2 integer*8 \
- logical*2 logical*8 integer logical*4 real \
- real*8 real*16 complex*4 complex*8 complex*16} {
- gdb_test "ptype $type" [string_to_regexp "type = $type"]
+ foreach type {void character \
+ integer*1 integer*2 integer integer*8 \
+ integer_1 integer_2 integer_8 \
+ logical*1 logical*2 logical*4 logical*8 \
+ logical_1 logical_2 logical_4 logical_8 \
+ real real*8 real*16 real_8 real_16 \
+ complex*4 complex*8 complex*16 \
+ complex_4 complex_8 complex_16} {
+
+ # While TYPE_KIND is allowed as input, GDB will always return the
+ # Fortran notation TYPE*KIND
+ regsub -all "_" $type "\*" type_res
+ gdb_test "ptype $type" [string_to_regexp "type = $type_res"]
}
}
@@ -91,6 +113,7 @@ gdb_test "set print sevenbit-strings" ""
if [set_lang_fortran] then {
test_primitive_types_known
+ test_default_types
test_integer_literal_types_accepted
test_integer_literal_types_rejected
test_logical_literal_types_accepted