summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/addr_slice.adb
blob: 2506148089ef0dddc9eac4d2b1b600479f0c648f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--  { dg-do compile }
--  { dg-options "-gnatws" }

procedure Addr_Slice is
   type Item_Type is record
      I : Integer;
   end record;

   type Index_Type is (A, B);
   for Index_Type use (A => 1, B => 10);

   Item_Array : constant array (Index_Type) of Item_Type
     := (A => (I => 10), B => (I => 22));

   Item : Item_Type;
   for Item'Address use Item_Array(Index_Type)'Address;
begin
   null;
end;