GDB copyright headers update after running GDB's copyright.py script.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.fortran / vla-ptype.exp
CommitLineData
618f726f 1# Copyright 2015-2016 Free Software Foundation, Inc.
3f2f83dd
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
16standard_testfile "vla.f90"
17
18if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
19 {debug f90 quiet}] } {
20 return -1
21}
22
23if ![runto_main] {
24 untested "could not run to main"
25 return -1
26}
27
28# Check the ptype of various VLA states and pointer to VLA's.
29gdb_breakpoint [gdb_get_line_number "vla1-init"]
30gdb_continue_to_breakpoint "vla1-init"
31gdb_test "ptype vla1" "type = <not allocated>" "ptype vla1 not initialized"
32gdb_test "ptype vla2" "type = <not allocated>" "ptype vla2 not initialized"
33gdb_test "ptype pvla" "type = <not associated>" "ptype pvla not initialized"
34gdb_test "ptype vla1(3, 6, 9)" "no such vector element \\\(vector not allocated\\\)" \
35 "ptype vla1(3, 6, 9) not initialized"
36gdb_test "ptype vla2(5, 45, 20)" \
37 "no such vector element \\\(vector not allocated\\\)" \
38 "ptype vla1(5, 45, 20) not initialized"
39
40gdb_breakpoint [gdb_get_line_number "vla1-allocated"]
41gdb_continue_to_breakpoint "vla1-allocated"
42gdb_test "ptype vla1" "type = real\\\(kind=4\\\) \\\(10,10,10\\\)" \
43 "ptype vla1 allocated"
44
45gdb_breakpoint [gdb_get_line_number "vla2-allocated"]
46gdb_continue_to_breakpoint "vla2-allocated"
47gdb_test "ptype vla2" "type = real\\\(kind=4\\\) \\\(7,42:50,13:35\\\)" \
48 "ptype vla2 allocated"
49
50gdb_breakpoint [gdb_get_line_number "vla1-filled"]
51gdb_continue_to_breakpoint "vla1-filled"
52gdb_test "ptype vla1" "type = real\\\(kind=4\\\) \\\(10,10,10\\\)" \
53 "ptype vla1 filled"
54gdb_test "ptype vla1(3, 6, 9)" "type = real\\\(kind=4\\\)" \
55 "ptype vla1(3, 6, 9)"
56
57gdb_breakpoint [gdb_get_line_number "vla2-filled"]
58gdb_continue_to_breakpoint "vla2-filled"
59gdb_test "ptype vla2" "type = real\\\(kind=4\\\) \\\(7,42:50,13:35\\\)" \
60 "ptype vla2 filled"
61gdb_test "ptype vla2(5, 45, 20)" "type = real\\\(kind=4\\\)" \
62 "ptype vla1(5, 45, 20) filled"
63
64gdb_breakpoint [gdb_get_line_number "pvla-associated"]
65gdb_continue_to_breakpoint "pvla-associated"
66gdb_test "ptype pvla" "type = real\\\(kind=4\\\) \\\(10,10,10\\\)" \
67 "ptype pvla associated"
68gdb_test "ptype pvla(3, 6, 9)" "type = real\\\(kind=4\\\)" \
69 "ptype pvla(3, 6, 9)"
70
71gdb_breakpoint [gdb_get_line_number "pvla-re-associated"]
72gdb_continue_to_breakpoint "pvla-re-associated"
73gdb_test "ptype pvla" "type = real\\\(kind=4\\\) \\\(7,42:50,13:35\\\)" \
74 "ptype pvla re-associated"
75gdb_test "ptype vla2(5, 45, 20)" "type = real\\\(kind=4\\\)" \
76 "ptype vla1(5, 45, 20) re-associated"
77
78gdb_breakpoint [gdb_get_line_number "pvla-deassociated"]
79gdb_continue_to_breakpoint "pvla-deassociated"
80gdb_test "ptype pvla" "type = <not associated>" "ptype pvla deassociated"
81gdb_test "ptype pvla(5, 45, 20)" \
82 "no such vector element \\\(vector not associated\\\)" \
83 "ptype pvla(5, 45, 20) not associated"
84
85gdb_breakpoint [gdb_get_line_number "vla1-deallocated"]
86gdb_continue_to_breakpoint "vla1-deallocated"
87gdb_test "ptype vla1" "type = <not allocated>" "ptype vla1 not allocated"
88gdb_test "ptype vla1(3, 6, 9)" "no such vector element \\\(vector not allocated\\\)" \
89 "ptype vla1(3, 6, 9) not allocated"
90
91gdb_breakpoint [gdb_get_line_number "vla2-deallocated"]
92gdb_continue_to_breakpoint "vla2-deallocated"
93gdb_test "ptype vla2" "type = <not allocated>" "ptype vla2 not allocated"
94gdb_test "ptype vla2(5, 45, 20)" \
95 "no such vector element \\\(vector not allocated\\\)" \
96 "ptype vla2(5, 45, 20) not allocated"
This page took 0.049234 seconds and 4 git commands to generate.