4 with System
; use System
;
6 procedure Boolean_Bitfield
is
8 Units_Per_Integer
: constant :=
9 (Integer'Size + System
.Storage_Unit
- 1) / System
.Storage_Unit
;
11 type E_type
is (Red
, Blue
, Green
);
13 type Parent_Type
is record
14 I
: Integer range 0 .. 127 := 127;
20 for Parent_Type
use record
21 C
at 0 * Units_Per_Integer
range 0 .. Character'Size - 1;
22 B
at 1 * Units_Per_Integer
range 0 .. Boolean'Size - 1;
23 I
at 2 * Units_Per_Integer
range 0 .. Integer'Size/2 - 1;
24 E
at 3 * Units_Per_Integer
range 0 .. Character'Size - 1;
27 type Derived_Type
is new Parent_Type
;
29 for Derived_Type
use record
30 C
at 1 * Units_Per_Integer
range 1 .. Character'Size + 1;
31 B
at 3 * Units_Per_Integer
range 1 .. Boolean'Size + 1;
32 I
at 5 * Units_Per_Integer
range 1 .. Integer'Size/2 + 1;
33 E
at 7 * Units_Per_Integer
range 1 .. Character'Size + 1;
39 Rec
:= (12, 'T', True, Red
);
41 if (Rec
.I
/= 12) or (Rec
.C
/= 'T') or (not Rec
.B
) or (Rec
.E
/= Red
) then