fort_dyn_array: add basic fortran dyn array support
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.fortran / vla-datatypes.exp
1 # Copyright 2015 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 standard_testfile ".f90"
17
18 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
19 {debug f90 quiet}] } {
20 return -1
21 }
22
23 # check that all fortran standard datatypes will be
24 # handled correctly when using as VLA's
25
26 if ![runto_main] {
27 untested "could not run to main"
28 return -1
29 }
30
31 gdb_breakpoint [gdb_get_line_number "vlas-allocated"]
32 gdb_continue_to_breakpoint "vlas-allocated"
33 gdb_test "next" " = allocated\\\(realvla\\\)" \
34 "next to allocation status of intvla"
35 gdb_test "print l" " = \\.TRUE\\." "intvla allocated"
36 gdb_test "next" " = allocated\\\(complexvla\\\)" \
37 "next to allocation status of realvla"
38 gdb_test "print l" " = \\.TRUE\\." "realvla allocated"
39 gdb_test "next" " = allocated\\\(logicalvla\\\)" \
40 "next to allocation status of complexvla"
41 gdb_test "print l" " = \\.TRUE\\." "complexvla allocated"
42 gdb_test "next" " = allocated\\\(charactervla\\\)" \
43 "next to allocation status of logicalvla"
44 gdb_test "print l" " = \\.TRUE\\." "logicalvla allocated"
45 gdb_test "next" "intvla\\\(:,:,:\\\) = 1" \
46 "next to allocation status of charactervla"
47 gdb_test "print l" " = \\.TRUE\\." "charactervla allocated"
48
49 gdb_breakpoint [gdb_get_line_number "vlas-initialized"]
50 gdb_continue_to_breakpoint "vlas-initialized"
51 gdb_test "ptype intvla" "type = integer\\\(kind=4\\\) \\\(11,22,33\\\)" \
52 "ptype intvla"
53 gdb_test "ptype realvla" "type = real\\\(kind=4\\\) \\\(11,22,33\\\)" \
54 "ptype realvla"
55 gdb_test "ptype complexvla" "type = complex\\\(kind=4\\\) \\\(11,22,33\\\)" \
56 "ptype complexvla"
57 gdb_test "ptype logicalvla" "type = logical\\\(kind=4\\\) \\\(11,22,33\\\)" \
58 "ptype logicalvla"
59 gdb_test "ptype charactervla" "type = character\\\*1 \\\(11,22,33\\\)" \
60 "ptype charactervla"
61
62 gdb_test "print intvla(5,5,5)" " = 1" "print intvla(5,5,5) (1st)"
63 gdb_test "print realvla(5,5,5)" " = 3.14\\d+" \
64 "print realvla(5,5,5) (1st)"
65 gdb_test "print complexvla(5,5,5)" " = \\\(2,-3\\\)" \
66 "print complexvla(5,5,5) (1st)"
67 gdb_test "print logicalvla(5,5,5)" " = \\.TRUE\\." \
68 "print logicalvla(5,5,5) (1st)"
69 gdb_test "print charactervla(5,5,5)" " = 'K'" \
70 "print charactervla(5,5,5) (1st)"
71
72 gdb_breakpoint [gdb_get_line_number "vlas-modified"]
73 gdb_continue_to_breakpoint "vlas-modified"
74 gdb_test "print intvla(5,5,5)" " = 42" "print intvla(5,5,5) (2nd)"
75 gdb_test "print realvla(5,5,5)" " = 4.13\\d+" \
76 "print realvla(5,5,5) (2nd)"
77 gdb_test "print complexvla(5,5,5)" " = \\\(-3,2\\\)" \
78 "print complexvla(5,5,5) (2nd)"
79 gdb_test "print logicalvla(5,5,5)" " = \\.FALSE\\." \
80 "print logicalvla(5,5,5) (2nd)"
81 gdb_test "print charactervla(5,5,5)" " = 'X'" \
82 "print charactervla(5,5,5) (2nd)"
This page took 0.03229 seconds and 4 git commands to generate.