2016-11-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gnat.dg / dynamic_bound.adb
blob99720cdfa203d76412fb6979d05065979557ebc7
1 -- { dg-do compile }
2 -- { dg-options "-gnato" }
4 procedure Dynamic_Bound is
6 procedure Define (Count : Integer) is
8 type Count_T is new Integer range 0 .. Count * 1000;
10 type Obj_T is record
11 Count : Count_T;
12 end record;
14 type T is access Obj_T ;
16 procedure Create (S : in out T) is
17 begin
18 S := new Obj_T'(Count => 0);
19 end;
21 procedure Add (To : in out T) is
22 begin
23 To.Count := To.Count + 1;
24 end;
26 My_T : T;
28 begin
29 Create (My_T);
30 end;
32 begin
33 Define (1);
34 end;