gdb/fortran: Handle dynamic string types when printing types
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.fortran / ptype-on-functions.exp
1 # Copyright 2019-2020 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 # This file contains a test for printing the types of functions.
17
18 if { [skip_fortran_tests] } { return -1 }
19
20 standard_testfile .f90
21 load_lib "fortran.exp"
22
23 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
24 return -1
25 }
26
27 if ![fortran_runto_main] then {
28 perror "couldn't run to main"
29 continue
30 }
31
32 gdb_test "ptype some_module::get_number" \
33 "type = integer\\(kind=4\\) \\(Type __class_some_module_Number_t\\)"
34
35 gdb_test "ptype some_module::set_number" \
36 "type = void \\(Type __class_some_module_Number_t, integer\\(kind=4\\)\\)"
37
38 gdb_test "ptype is_bigger" \
39 "type = logical\\(kind=4\\) \\(integer\\(kind=4\\), integer\\(kind=4\\)\\)"
40
41 gdb_test "ptype say_numbers" \
42 "type = void \\(integer\\(kind=4\\), integer\\(kind=4\\), integer\\(kind=4\\)\\)"
43
44 gdb_test "ptype fun_ptr" \
45 "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\) \\)\\) \\)"
46
47 gdb_test "ptype say_string" \
48 "type = void \\(character\\*\\(\\*\\), integer\\(kind=8\\)\\)"
49
50 gdb_test "ptype say_array" \
51 "type = void \\(integer\\(kind=4\\) \\(:,:\\)\\)"
This page took 0.033157 seconds and 4 git commands to generate.