summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/varsize_copy.adb
blob: 4fa0ff8622e7885e50d93add2da85697b9c81d7a (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
-- { dg-do compile }
-- { dg-options "-O -gnatws" }

package body Varsize_Copy is

   type Key_Mapping_Type is record
      Page : Page_Type;
      B    : Boolean;
   end record;

   type Key_Mapping_Array is array (Key_Type) of Key_Mapping_Type;

   type Set is record
      Key_Mappings : Key_Mapping_Array;
   end record;

   S : Set;

   function F (Key : Key_Type) return Page_Type is
   begin
      return S.Key_Mappings (Key).Page;
   end;

end Varsize_Copy;