]>
Commit | Line | Data |
---|---|---|
213516ef | 1 | # Copyright 2013-2023 Free Software Foundation, Inc. |
7f9b20bb KB |
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 | if { [skip_fortran_tests] } { continue } | |
17 | ||
18 | standard_testfile type.f90 | |
0c13f7e5 | 19 | load_lib "fortran.exp" |
7f9b20bb | 20 | |
5b362f04 | 21 | if { [prepare_for_testing "failed to prepare" ${testfile} \ |
7f9b20bb KB |
22 | ${srcfile} {debug f90}] } { |
23 | return -1 | |
24 | } | |
25 | ||
86cd6bc8 | 26 | if ![fortran_runto_main] { |
7f9b20bb KB |
27 | return |
28 | } | |
29 | ||
0c13f7e5 BH |
30 | # Depending on the compiler being used, the type names can be printed differently. |
31 | set int [fortran_int4] | |
32 | set real [fortran_real4] | |
33 | ||
7f9b20bb KB |
34 | gdb_breakpoint [gdb_get_line_number "bp1"] |
35 | gdb_continue_to_breakpoint "bp1" | |
36 | ||
0c13f7e5 BH |
37 | set t1_i "$int :: t1_i" |
38 | set t1_r "$real :: t1_r" | |
7f9b20bb | 39 | |
9b2db1fd BH |
40 | gdb_test "whatis t1" "type = Type t1" |
41 | gdb_test "whatis t1v" "type = Type t1" | |
e188eb36 BH |
42 | gdb_test "whatis t2" "type = Type t2" |
43 | gdb_test "whatis t2v" "type = Type t2" | |
44 | gdb_test "whatis t3" "type = Type t3" | |
45 | gdb_test "whatis t3v" "type = Type t3" | |
2bbad2ea | 46 | gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3 \\)" |
7f9b20bb KB |
47 | |
48 | gdb_test "ptype t1" \ | |
3cd81d8d BH |
49 | [multi_line "type = Type t1" \ |
50 | " $t1_i" \ | |
51 | " $t1_r" \ | |
d1e36019 | 52 | "End Type t1"] |
7f9b20bb | 53 | gdb_test "ptype t1v" \ |
3cd81d8d BH |
54 | [multi_line "type = Type t1" \ |
55 | " $t1_i" \ | |
56 | " $t1_r" \ | |
d1e36019 | 57 | "End Type t1"] |
e188eb36 BH |
58 | |
59 | gdb_test "ptype t2v" \ | |
60 | [multi_line "type = Type t2" \ | |
61 | " $int :: t2_i" \ | |
62 | " Type t1 :: t1_n" \ | |
63 | "End Type t2"] | |
64 | ||
65 | gdb_test "ptype t3v" \ | |
66 | [multi_line "type = Type t3" \ | |
67 | " $int :: t3_i" \ | |
68 | " Type t2 :: t2_n" \ | |
69 | "End Type t3"] | |
2bbad2ea BH |
70 | |
71 | gdb_test "ptype t3p" \ | |
72 | [multi_line "type = PTR TO -> \\( Type t3" \ | |
73 | " $int :: t3_i" \ | |
74 | " Type t2 :: t2_n" \ | |
75 | "End Type t3 \\)"] |