aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/array36.adb
blob: 9f4314cb9ad630b76aad36890da37c6d28014f6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--  { dg-do run }

procedure Array36 is

   subtype Str is String (1 .. 3);

   type Rec is record
      S : Str;
   end record;

   type T is record
      B : Boolean;
      R : Rec;
   end record;

   for T use record
      B at 0 range 0 .. 0;
      R at 0 range 1 .. 24;
   end record;

   X : T := (B => True, R => (S => "123"));

begin
   X.B := False;
   if X.R.S /= "123" then
      raise Program_Error;
   end if;
end;