Commit | Line | Data |
---|---|---|
b811d2c2 | 1 | # Copyright 2019-2020 Free Software Foundation, Inc. |
bf7a4de1 AB |
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 | ||
86cd6bc8 AKS |
27 | if ![fortran_runto_main] then { |
28 | perror "couldn't run to main" | |
bf7a4de1 AB |
29 | continue |
30 | } | |
31 | ||
32 | gdb_test "ptype some_module::get_number" \ | |
6cc64caa | 33 | "type = integer\\(kind=4\\) \\(Type __class_some_module_Number(_t)?\\)" |
bf7a4de1 AB |
34 | |
35 | gdb_test "ptype some_module::set_number" \ | |
6cc64caa | 36 | "type = void \\(Type __class_some_module_Number(_t)?, integer\\(kind=4\\)\\)" |
bf7a4de1 AB |
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" \ | |
f1fdc960 | 45 | "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\) \\)\\) \\)" |
3dcc261c AB |
46 | |
47 | gdb_test "ptype say_string" \ | |
fe07b572 | 48 | "type = void \\(character\\*\\(\\*\\), integer\\(kind=\\d+\\)\\)" |
3dcc261c AB |
49 | |
50 | gdb_test "ptype say_array" \ | |
51 | "type = void \\(integer\\(kind=4\\) \\(:,:\\)\\)" |