]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.fortran/whatis_type.exp
15306d7920f675ffe1dcc8a12f7a43cbdd45adf4
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.fortran / whatis_type.exp
1 # Copyright 2013-2019 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 if { [skip_fortran_tests] } { continue }
17
18 standard_testfile type.f90
19 load_lib "fortran.exp"
20
21 if { [prepare_for_testing "failed to prepare" ${testfile} \
22 ${srcfile} {debug f90}] } {
23 return -1
24 }
25
26 if ![runto MAIN__] {
27 fail "run to MAIN__"
28 return
29 }
30
31 # Depending on the compiler being used, the type names can be printed differently.
32 set int [fortran_int4]
33 set real [fortran_real4]
34
35 gdb_breakpoint [gdb_get_line_number "bp1"]
36 gdb_continue_to_breakpoint "bp1"
37
38 set t1_i "$int :: t1_i"
39 set t1_r "$real :: t1_r"
40
41 gdb_test "whatis t1" "type = Type t1"
42 gdb_test "whatis t1v" "type = Type t1"
43 gdb_test "whatis t2" "type = Type t2"
44 gdb_test "whatis t2v" "type = Type t2"
45 gdb_test "whatis t3" "type = Type t3"
46 gdb_test "whatis t3v" "type = Type t3"
47 gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3 \\)"
48
49 gdb_test "ptype t1" \
50 [multi_line "type = Type t1" \
51 " $t1_i" \
52 " $t1_r" \
53 "End Type t1"]
54 gdb_test "ptype t1v" \
55 [multi_line "type = Type t1" \
56 " $t1_i" \
57 " $t1_r" \
58 "End Type t1"]
59
60 gdb_test "ptype t2v" \
61 [multi_line "type = Type t2" \
62 " $int :: t2_i" \
63 " Type t1 :: t1_n" \
64 "End Type t2"]
65
66 gdb_test "ptype t3v" \
67 [multi_line "type = Type t3" \
68 " $int :: t3_i" \
69 " Type t2 :: t2_n" \
70 "End Type t3"]
71
72 gdb_test "ptype t3p" \
73 [multi_line "type = PTR TO -> \\( Type t3" \
74 " $int :: t3_i" \
75 " Type t2 :: t2_n" \
76 "End Type t3 \\)"]