2016-01-15 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gnat.dg / rep_clause3.adb
blobf4adcc37bf6caf6c8e7a47b99f50a39ec5fea5bb
1 -- { dg-do compile }
2 -- { dg-options "-gnatws" }
4 procedure Rep_Clause3 is
6 subtype U_16 is integer range 0..2**16-1;
8 type TYPE1 is range 0 .. 135;
9 for TYPE1'size use 14;
11 type TYPE2 is range 0 .. 262_143;
12 for TYPE2'size use 18;
14 subtype TYPE3 is integer range 1 .. 21*6;
16 type ARR is array (TYPE3 range <>) of boolean;
17 pragma Pack(ARR);
19 subtype SUB_ARR is ARR(1 .. 5*6);
21 OBJ : SUB_ARR;
23 type R is
24 record
25 N : TYPE1;
26 L : TYPE2;
27 I : SUB_ARR;
28 CRC : U_16;
29 end record;
30 for R use
31 record at mod 4;
32 N at 0 range 0 .. 13;
33 L at 0 range 14 .. 31;
34 I at 4 range 2 .. 37;
35 CRC at 8 range 16 .. 31;
36 end record;
37 for R'size use 12*8;
39 type SUB_R is array (1..4) of R;
41 T : SUB_R;
43 begin
44 if OBJ = T(1).I then
45 raise Program_Error;
46 end if;
47 end;