]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.ada/arrayidx.exp
Update copyright year range in all GDB files
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.ada / arrayidx.exp
CommitLineData
e2882c85 1# Copyright 2005-2018 Free Software Foundation, Inc.
2336bb58
JB
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
2336bb58
JB
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
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
2336bb58 15
2336bb58
JB
16load_lib "ada.exp"
17
ec3c07fc
NS
18if { [skip_ada_tests] } { return -1 }
19
8223e12c 20standard_ada_testfile p
2336bb58 21
ec3c07fc
NS
22if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
23 return -1
2336bb58
JB
24}
25
4c93b1db 26if [get_compiler_info] {
ae59b1da 27 return -1
3f20c47f
JK
28}
29set old_gcc [expr [test_compiler_info {gcc-[0-3]-*}] \
30 || [test_compiler_info {gcc-4-[0-6]-*}]]
31
09050809 32clean_restart ${testfile}
2336bb58
JB
33
34set bp_location [gdb_get_line_number "START" ${testdir}/p.adb]
35runto "p.adb:$bp_location"
36
37# First, print all the arrays without indexes
38
a7b75dfd 39gdb_test_no_output "set print array-indexes off"
2336bb58 40
3f20c47f
JK
41if $old_gcc {
42 setup_xfail "*-*-*"
43}
2336bb58 44gdb_test "print one_two_three" \
b6db24e5 45 "= \\(1, 2, 3\\)" \
2336bb58
JB
46 "print one_two_three, indexes off"
47
2336bb58 48gdb_test "print e_one_two_three" \
b6db24e5 49 "= \\(1, 2, 3\\)" \
2336bb58
JB
50 "print e_one_two_three, indexes off"
51
2336bb58 52gdb_test "print r_two_three" \
b6db24e5 53 "= \\(two => 2, 3\\)" \
2336bb58
JB
54 "print r_two_three, indexes off"
55
56gdb_test "print u_one_two_three" \
b6db24e5 57 "= \\(1, 2, 3\\)" \
2336bb58
JB
58 "print u_one_two_three, indexes off"
59
60gdb_test "print p_one_two_three" \
99b1c762 61 "= \\(false, true, true\\)" \
2336bb58
JB
62 "print p_one_two_three, indexes off"
63
3f20c47f
JK
64if $old_gcc {
65 setup_xfail "*-*-*"
66}
2336bb58 67gdb_test "print few_reps" \
b6db24e5 68 "= \\(1, 2, 3, 3, 3, 3, 3, 4, 5\\)" \
2336bb58
JB
69 "print few_reps, indexes off"
70
3f20c47f
JK
71if $old_gcc {
72 setup_xfail "*-*-*"
73}
2336bb58 74gdb_test "print many_reps" \
b6db24e5 75 "= \\(1, 2, 3 <repeats 12 times>, 4, 5\\)" \
2336bb58
JB
76 "print many_reps, indexes off"
77
3f20c47f
JK
78if $old_gcc {
79 setup_xfail "*-*-*"
80}
2336bb58 81gdb_test "print empty" \
b6db24e5 82 "= \\(\\)" \
2336bb58
JB
83 "print empty, indexes off"
84
85# Next, print all the arrays with the indexes
86
a7b75dfd 87gdb_test_no_output "set print array-indexes on"
2336bb58 88
3f20c47f
JK
89if $old_gcc {
90 setup_xfail "*-*-*"
91}
2336bb58 92gdb_test "print one_two_three" \
b6db24e5 93 "= \\(1 => 1, 2 => 2, 3 => 3\\)" \
2336bb58
JB
94 "print one_two_three"
95
2336bb58 96gdb_test "print e_one_two_three" \
b6db24e5 97 "= \\(one => 1, two => 2, three => 3\\)" \
2336bb58
JB
98 "print e_one_two_three"
99
2336bb58 100gdb_test "print r_two_three" \
b6db24e5 101 "= \\(two => 2, three => 3\\)" \
2336bb58
JB
102 "print r_two_three"
103
104gdb_test "print u_one_two_three" \
b6db24e5 105 "= \\(1 => 1, 2 => 2, 3 => 3\\)" \
2336bb58
JB
106 "print u_one_two_three"
107
108gdb_test "print p_one_two_three" \
99b1c762 109 "= \\(one => false, two => true, three => true\\)" \
2336bb58
JB
110 "print p_one_two_three"
111
3f20c47f
JK
112if $old_gcc {
113 setup_xfail "*-*-*"
114}
2336bb58 115gdb_test "print few_reps" \
b6db24e5 116 "= \\(1 => 1, 2 => 2, 3 => 3, 4 => 3, 5 => 3, 6 => 3, 7 => 3, 8 => 4, 9 => 5\\)" \
2336bb58
JB
117 "print few_reps"
118
3f20c47f
JK
119if $old_gcc {
120 setup_xfail "*-*-*"
121}
2336bb58 122gdb_test "print many_reps" \
b6db24e5 123 "= \\(1 => 1, 2 => 2, 3 => 3 <repeats 12 times>, 15 => 4, 16 => 5\\)" \
2336bb58
JB
124 "print many_reps"
125
3f20c47f
JK
126if $old_gcc {
127 setup_xfail "*-*-*"
128}
2336bb58 129gdb_test "print empty" \
b6db24e5 130 "= \\(\\)" \
2336bb58
JB
131 "print empty"
132
133