aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gnat.dg/specs/last_bit.ads
blob: ecfc2540a8ae73e7ec3d3a1f602a498e51a4a49a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- { dg-do compile }

package Last_Bit is

   Max_Components : constant := 100;
   type Count_Type is new Natural range 0 .. Max_Components;
   subtype Index_Type is Count_Type range 1 .. Count_Type'Last;
   
   type List_Type is array (Index_Type range <>) of Integer;

   type Record_Type (Count : Count_Type := 0) is record
      List : List_Type (1 .. Count);
   end record;

   Null_Record : Record_Type (Count => 0);

   List_Last_Bit : Integer := Null_Record.List'Last_Bit;

end Last_Bit;