Debian Codegraph @

gcc/testsuite/gnat.dg/specs/discr4_pkg.ads

raw
1 package Discr4_Pkg is
2
3 type Enum is (One, Two, Three);
4
5 type Rec is private;
6
7 Rec_One : constant Rec;
8 Rec_Three : constant Rec;
9
10 function Get (Value : Integer) return Rec;
11
12 private
13
14 type Rec (D : Enum := Two) is record
15 case D is
16 when One => null;
17 when Two => Value : Integer;
18 when Three => null;
19 end case;
20 end record;
21
22 Rec_One : constant Rec := (D => One);
23 Rec_Three : constant Rec := (D => Three);
24
25 function Get (Value : Integer) return Rec is (Two, Value);
26
27 end Discr4_Pkg;