Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.ada / packed_array_assign.exp
CommitLineData
88b9d363 1# Copyright 2018-2022 Free Software Foundation, Inc.
2a62dfa9
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
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
16load_lib "ada.exp"
17
7a82e903
PA
18if { [skip_ada_tests] } { return -1 }
19
2a62dfa9
JB
20standard_ada_testfile tester
21
22if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
23 return -1
24}
25
26clean_restart ${testfile}
27
28runto "aggregates.run_test"
29
f26101b1
TV
30set kfail_int128support_re \
31 "That operation is not available on integers of more than 8 bytes\\."
32
33set cmd \
34 [list \
35 "print pra := " \
36 "((packed_array_assign_x => 2," \
37 "packed_array_assign_y => 0," \
38 "packed_array_assign_w => 17)," \
39 "pr," \
40 "(packed_array_assign_x => 7," \
41 "packed_array_assign_y => 1," \
42 "packed_array_assign_w => 23))"]
43set cmd [join $cmd]
44set re \
45 [list \
46 " = \\(\\(packed_array_assign_w => 17," \
47 "packed_array_assign_x => 2," \
48 "packed_array_assign_y => 0\\)," \
49 "\\(packed_array_assign_w => 104," \
50 "packed_array_assign_x => 2," \
51 "packed_array_assign_y => 3\\)," \
52 "\\(packed_array_assign_w => 23," \
53 "packed_array_assign_x => 7," \
54 "packed_array_assign_y => 1\\)\\)"]
55set re [join $re]
56gdb_test_multiple $cmd "value of pra" {
57 -re -wrap $re {
58 pass $gdb_test_name
59 }
60 -re -wrap $kfail_int128support_re {
61 kfail gdb/20991 $gdb_test_name
62 }
63}
64
65set cmd "print pra(1) := pr"
66set re \
67 [list \
68 " = \\(packed_array_assign_w => 104," \
69 "packed_array_assign_x => 2," \
70 "packed_array_assign_y => 3\\)"]
71set re [join $re]
72gdb_test_multiple $cmd "" {
73 -re -wrap $re {
74 pass $gdb_test_name
75 }
76 -re -wrap $kfail_int128support_re {
77 kfail gdb/20991 $gdb_test_name
78 }
79}
80
81set cmd "print pra(1)"
82set re \
83 [list \
84 " = \\(packed_array_assign_w => 104," \
85 "packed_array_assign_x => 2," \
86 "packed_array_assign_y => 3\\)"]
87set re [join $re]
88gdb_test_multiple $cmd "" {
89 -re -wrap $re {
90 pass $gdb_test_name
91 }
92 -re -wrap $kfail_int128support_re {
93 kfail gdb/20991 $gdb_test_name
94 }
95}
4504bbde
TT
96
97gdb_test "print npr := (q000 => 3, r000 => (packed_array_assign_x => 6, packed_array_assign_y => 1, packed_array_assign_w => 117))" \
ba3e70b0
KS
98 " = \\(q000 => 3, r000 => \\(packed_array_assign_w => 117, packed_array_assign_x => 6, packed_array_assign_y => 1\\)\\)" \
99 "value of npr"
This page took 0.427667 seconds and 4 git commands to generate.