]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.ada/mi_var_access/mi_access.adb
ee71eee202b9e846815cfe00b802e4aad207da0b
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.ada / mi_var_access / mi_access.adb
1 -- Copyright 2020-2023 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 Mi_Access is
19 A_String : String (3 .. 5) := "345"; -- STOP
20 A_String_Access : String_Access;
21 A_Pointer : Pointer;
22 begin
23 Do_Nothing (A_String'Address);
24 A_String (4) := '6';
25 A_String_Access := Copy (A_String);
26 A_Pointer.P := A_String_Access;
27 Do_Nothing (A_String_Access'Address); -- STOP2
28 A_String_Access (4) := 'a';
29 Do_Nothing (A_Pointer'Address);
30 A_String_Access := Copy("Hi");
31 A_Pointer.P := A_String_Access;
32 Do_Nothing (A_String_Access'Address);
33 A_String_Access := null;
34 A_Pointer.P := null;
35 Do_Nothing (A_Pointer'Address); -- STOP3
36 Do_Nothing (A_String'Address);
37 end Mi_Access;