gdb/testsuite: remove actual addresses from some test names
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.fortran / vla-value-sub.exp
1 # Copyright 2015-2021 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 "vla-sub.f90"
17 load_lib fortran.exp
18
19 if {[skip_fortran_tests]} { return -1 }
20
21 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
22 {debug f90 quiet}] } {
23 return -1
24 }
25
26 if ![fortran_runto_main] {
27 untested "could not run to main"
28 return -1
29 }
30
31 # Check the values of VLA's in subroutine can be evaluated correctly
32
33 # Try to access values from a fixed array handled as VLA in subroutine.
34 gdb_breakpoint [gdb_get_line_number "not-filled"]
35 gdb_continue_to_breakpoint "not-filled (1st)"
36 gdb_test "print array1" " = \\(\[()1, .\]*\\)" \
37 "print passed array1 in foo (passed fixed array)"
38
39 gdb_breakpoint [gdb_get_line_number "array1-filled"]
40 gdb_continue_to_breakpoint "array1-filled (1st)"
41 gdb_test "print array1(5, 7)" " = 5" \
42 "print array1(5, 7) after filled in foo (passed fixed array)"
43 gdb_test "print array1(1, 1)" " = 30" \
44 "print array1(1, 1) after filled in foo (passed fixed array)"
45
46 gdb_breakpoint [gdb_get_line_number "array2-almost-filled"]
47 gdb_continue_to_breakpoint "array2-almost-filled (1st)"
48 # array2 size is 296352 bytes.
49 gdb_test_no_output "set max-value-size 1024*1024"
50 gdb_test "print array2" " = \\( *\\( *\\( *30, *3, *3,\[()3, .\]*\\)" \
51 "print array2 in foo after it was filled (passed fixed array)"
52 gdb_test "print array2(2,1,1)=20" " = 20" \
53 "set array(2,2,2) to 20 in subroutine (passed fixed array)"
54 gdb_test "print array2" " = \\( *\\( *\\( *30, *20, *3,\[()3, .\]*\\)" \
55 "print array2 in foo after it was mofified in debugger (passed fixed array)"
56
57
58 # Try to access values from a fixed sub-array handled as VLA in subroutine.
59 gdb_continue_to_breakpoint "not-filled (2nd)"
60 gdb_test "print array1" " = \\(\[()5, .\]*\\)" \
61 "print passed array1 in foo (passed sub-array)"
62
63 gdb_continue_to_breakpoint "array1-filled (2nd)"
64 gdb_test "print array1(5, 5)" " = 5" \
65 "print array1(5, 5) after filled in foo (passed sub-array)"
66 gdb_test "print array1(1, 1)" " = 30" \
67 "print array1(1, 1) after filled in foo (passed sub-array)"
68
69 gdb_continue_to_breakpoint "array2-almost-filled (2nd)"
70 gdb_test "print array2" " = \\( *\\( *\\( *30, *3, *3,\[()3, .\]*\\)" \
71 "print array2 in foo after it was filled (passed sub-array)"
72 gdb_test "print array2(2,1,1)=20" " = 20" \
73 "set array(2,2,2) to 20 in subroutine (passed sub-array)"
74 gdb_test "print array2" " = \\( *\\( *\\( *30, *20, *3,\[()3, .\]*\\)" \
75 "print array2 in foo after it was mofified in debugger (passed sub-array)"
76
77
78 # Try to access values from a VLA passed to subroutine.
79 gdb_continue_to_breakpoint "not-filled (3rd)"
80 gdb_test "print array1" " = \\(\[()42, .\]*\\)" \
81 "print passed array1 in foo (passed vla)"
82
83 gdb_continue_to_breakpoint "array1-filled (3rd)"
84 gdb_test "print array1(5, 5)" " = 5" \
85 "print array1(5, 5) after filled in foo (passed vla)"
86 gdb_test "print array1(1, 1)" " = 30" \
87 "print array1(1, 1) after filled in foo (passed vla)"
88
89 gdb_continue_to_breakpoint "array2-almost-filled (3rd)"
90 gdb_test "print array2" " = \\( *\\( *\\( *30, *3, *3,\[()3, .\]*\\)" \
91 "print array2 in foo after it was filled (passed vla)"
92 gdb_test "print array2(2,1,1)=20" " = 20" \
93 "set array(2,2,2) to 20 in subroutine (passed vla)"
94 gdb_test "print array2" " = \\( *\\( *\\( *30, *20, *3,\[()3, .\]*\\)" \
95 "print array2 in foo after it was mofified in debugger (passed vla)"
This page took 0.031397 seconds and 4 git commands to generate.