diff options
author | Bernhard Heckel <bernhard.heckel@intel.com> | 2022-04-05 17:44:46 +0200 |
---|---|---|
committer | Nils-Christian Kempke <nils-christian.kempke@intel.com> | 2022-04-08 12:17:13 +0200 |
commit | 110aae55a8b7e19fa5f04998851968e48822605f (patch) | |
tree | a8b16eddd2715eb752f6fee43e29636a253ec374 /gdb/testsuite | |
parent | 87e10e9c288c2f6c933f235b623522c8d9a2d727 (diff) | |
download | gdb-110aae55a8b7e19fa5f04998851968e48822605f.zip gdb-110aae55a8b7e19fa5f04998851968e48822605f.tar.gz gdb-110aae55a8b7e19fa5f04998851968e48822605f.tar.bz2 |
gdb/fortran: print fortran extended types with ptype
Add the print of the base-class of an extended type to the output of
ptype. This requires the Fortran compiler to emit DW_AT_inheritance
for the extended type.
Co-authored-by: Nils-Christian Kempke <nils-christian.kempke@intel.com>
Diffstat (limited to 'gdb/testsuite')
-rwxr-xr-x | gdb/testsuite/gdb.fortran/oop_extend_type.exp | 65 |
1 files changed, 48 insertions, 17 deletions
diff --git a/gdb/testsuite/gdb.fortran/oop_extend_type.exp b/gdb/testsuite/gdb.fortran/oop_extend_type.exp index eefc66c..00cfffa 100755 --- a/gdb/testsuite/gdb.fortran/oop_extend_type.exp +++ b/gdb/testsuite/gdb.fortran/oop_extend_type.exp @@ -60,12 +60,24 @@ gdb_test "p wp%point" " = \\( coo = \\(1, 2, 1\\) \\)" gdb_test "p wp" " = \\( point = \\( coo = \\(1, 2, 1\\) \\), angle = 100 \\)" gdb_test "whatis wp" "type = Type waypoint" -gdb_test "ptype wp" \ - [multi_line "type = Type waypoint" \ - " Type point :: point" \ - " $real :: angle" \ - "End Type waypoint"] - +set output_pass_wp [multi_line "type = Type, extends\\(point\\) :: waypoint" \ + " Type point :: point" \ + " $real :: angle" \ + "End Type waypoint(, allocatable)?"] +set output_kfail_wp [multi_line "type = Type waypoint" \ + " Type point :: point" \ + " $real :: angle" \ + "End Type waypoint(, allocatable)?"] + +set test "ptype wp" +gdb_test_multiple "$test" "$test" { + -re "$output_pass_wp\r\n$gdb_prompt $" { + pass "$test" + } + -re "$output_kfail_wp\r\n$gdb_prompt $" { + kfail "gcc/49475" "$test" + } +} set test "ptype wp%coo" gdb_test_multiple "$test" "$test" { -re "$real \\(3\\)\r\n$gdb_prompt $" { @@ -105,11 +117,27 @@ gdb_test_multiple "$test" "$test" { } gdb_test "whatis fwp" "type = Type fancywaypoint" -gdb_test "ptype fwp" \ - [multi_line "type = Type fancywaypoint" \ - " Type waypoint :: waypoint" \ - " $logical :: is_fancy" \ - "End Type fancywaypoint"] +set test "ptype fwp" + +set output_pass_fwp \ + [multi_line "type = Type, extends\\(waypoint\\) :: fancywaypoint" \ + " Type waypoint :: waypoint" \ + " $logical :: is_fancy" \ + "End Type fancywaypoint"] +set output_kfail_fwp \ + [multi_line "type = Type fancywaypoint" \ + " Type waypoint :: waypoint" \ + " $logical :: is_fancy" \ + "End Type fancywaypoint"] + +gdb_test_multiple "$test" "$test" { + -re "$output_pass_fwp\r\n$gdb_prompt $" { + pass "$test" + } + -re "$output_kfail_fwp\r\n$gdb_prompt $" { + kfail "gcc/49475" "$test" + } +} set test "ptype fwp%coo" gdb_test_multiple "$test" "$test" { @@ -140,12 +168,15 @@ gdb_test "p wp_vla(1)" " = \\( point = \\( coo = \\(10, 12, 10\\) \\), angle = 1 gdb_test "whatis wp_vla" "type = Type waypoint, allocatable \\(3\\)" \ "whatis wp_vla after allocation" -gdb_test "ptype wp_vla" \ - [multi_line "type = Type waypoint" \ - " Type point :: point" \ - " $real :: angle" \ - "End Type waypoint, allocatable \\(3\\)"] - +set test "ptype wp_vla" +gdb_test_multiple "$test" "$test" { + -re "$output_pass_wp \\(3\\)\r\n$gdb_prompt $" { + pass "$test" + } + -re "$output_kfail_wp \\(3\\)\r\n$gdb_prompt $" { + kfail "gcc/49475" "$test" + } +} set test "ptype wp_vla(1)%coo" gdb_test_multiple "$test" "$test" { -re "$real \\(3\\)\r\n$gdb_prompt $" { |