4099fb19fde525570b470bdfd0ac68c138e335da
[external/binutils.git] / gdb / testsuite / gdb.ada / pkd_arr_elem / failure.adb
1 --  Copyright 2014-2017 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 with Pck; use Pck;
17
18 procedure Failure is
19
20    type Funny_Char is
21         (NUL, ' ', '"', '#', '$', TMI, '&', ''',
22          '(', ')', SOT, ND,  ',', '-', '.', '/',
23          '0', '1', '2', '3', '4', '5', '6', '7',
24          '8', '9', ':', ';', UNS, INF, XMT, '?',
25          '!', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
26          'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
27          'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
28          'X', 'Y', 'Z', BEL, SND, CR,  LF,  DLT);
29
30    type Funny_String is array (Positive range <>) of Funny_Char;
31    pragma Pack (Funny_String);
32
33    type Bounded_Funny_String (Size : Natural := 1) is
34       record
35          Str    : Funny_String (1 .. Size) := (others => '0');
36          Length : Natural := 4;
37       end record;
38
39    Test : Bounded_Funny_String (100);
40 begin
41    Test.Str := (1 => 'A', others => NUL);
42    Test.Length := 1;
43    Do_Nothing (Test'Address); -- START
44 end;
45