| 1 |
-- { dg-do run } |
| 2 |
|
| 3 |
procedure Pack10 is |
| 4 |
|
| 5 |
type U16 is mod 2**16; |
| 6 |
type U8 is mod 2**8; |
| 7 |
|
| 8 |
type R is record |
| 9 |
A : U16; |
| 10 |
B : U8; |
| 11 |
end record; |
| 12 |
|
| 13 |
type M is array (1..2) of R; |
| 14 |
pragma Pack (M); |
| 15 |
-- This size clause can actually be omitted |
| 16 |
for M'Size use 48; |
| 17 |
|
| 18 |
type R2 is record |
| 19 |
C : M; |
| 20 |
D : U8; |
| 21 |
end record; |
| 22 |
for R2 use record |
| 23 |
C at 0 range 0 .. 24*2-1; |
| 24 |
end record; |
| 25 |
|
| 26 |
My_R2 : R2; |
| 27 |
|
| 28 |
begin |
| 29 |
My_R2.D := 1; |
| 30 |
My_R2.C(2).B := 0; |
| 31 |
if My_R2.D /=1 then |
| 32 |
raise Program_Error; |
| 33 |
end if; |
| 34 |
end; |