summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/misaligned_nest.adb
blob: 3b6fd845da4d2e5fa69eb8e8787f9085e75a4ffe (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
-- { dg-do run }
-- { dg-options "-gnatp" }

procedure Misaligned_Nest is

   type Int is record
      V : Integer;
   end record;

   type Block is record
      B : Boolean;
      I : Int;
   end record;
   pragma Pack (Block);
   for Block'Alignment use 1;

   type Pair is array (1 .. 2) of Block;

   P : Pair;
begin
   for K in P'Range loop
      P(K).I.V := 1;
   end loop;
end;