2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gnat.dg / discr27.adb
blob4b77f8efab9910f9e3098a60e545b92acf9b45d2
1 -- { dg-do compile }
3 package body Discr27 is
5 subtype Index is Positive range 1..4096;
7 function F return String is
8 S : String(1..1) := (others =>'w');
9 begin
10 return S;
11 end;
13 type Enum is (One, Two);
15 type Rec (D : Enum := One; Len : Index := 1) is record
16 case D is
17 when One => I : Integer;
18 when Two => A : String(1..Len);
19 end case;
20 end record;
22 procedure Nothing is
23 M : constant String := F;
24 C : constant Rec := (Two, M'Length, M);
25 begin
26 null;
27 end;
29 procedure Proc is begin
30 null;
31 end;
33 end Discr27;