]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.ada/variant-record/value.ads
Update copyright year range in all GDB files
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.ada / variant-record / value.ads
1 -- Copyright 2020-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 package Value is
17 package Value_Name is
18 Length : constant Positive := 8;
19 subtype Name_T is String (1 .. Length);
20
21 type A_Record_T is
22 record
23 X1 : Natural;
24 X2 : Natural;
25 end record;
26
27 type Yes_No_T is (Yes, No);
28 type T (Well : Yes_No_T := Yes) is
29 record
30 case Well is
31 when Yes =>
32 Name : Name_T;
33 when No =>
34 Unique_Name : A_Record_T;
35 end case;
36 end record;
37 end;
38
39 type T is private;
40 function Create return T;
41 function Name (Of_Value : T) return Value_Name.T;
42 private
43 type T is
44 record
45 One : Value_Name.T (Well => Value_Name.No);
46 Two : Value_Name.T (Well => Value_Name.Yes);
47 end record;
48 end;