| 1 |
-- { dg-do run } |
| 2 |
|
| 3 |
procedure Pack17 is |
| 4 |
|
| 5 |
type Bitmap_T is array (Natural range <>) of Boolean; |
| 6 |
pragma Pack (Bitmap_T); |
| 7 |
|
| 8 |
type Uint8 is range 0 .. 2 ** 8 - 1; |
| 9 |
for Uint8'Size use 8; |
| 10 |
|
| 11 |
type Record_With_QImode_Variants (D : Boolean) is record |
| 12 |
C_Filler : Bitmap_T (1..7); |
| 13 |
C_Map : Bitmap_T (1..3); |
| 14 |
case D is |
| 15 |
when False => |
| 16 |
F_Bit : Boolean; |
| 17 |
F_Filler : Bitmap_T (1..7); |
| 18 |
when True => |
| 19 |
T_Int : Uint8; |
| 20 |
end case; |
| 21 |
end record; |
| 22 |
pragma Pack (Record_With_QImode_Variants); |
| 23 |
|
| 24 |
procedure Fill (R : out Record_With_QImode_Variants) is |
| 25 |
begin |
| 26 |
R.C_Filler := (True, False, True, False, True, False, True); |
| 27 |
R.C_Map := (True, False, True); |
| 28 |
R.T_Int := 17; |
| 29 |
end; |
| 30 |
|
| 31 |
RT : Record_With_QImode_Variants (D => True); |
| 32 |
|
| 33 |
begin |
| 34 |
Fill (RT); |
| 35 |
if RT.T_Int /= 17 then |
| 36 |
raise Program_Error; |
| 37 |
end if; |
| 38 |
end; |