4 with Ada
.Unchecked_Conversion
;
5 with Ada
.Streams
; use Ada
.Streams
;
10 type Unsigned_Integer_4
is mod 2 ** 32;
11 for Unsigned_Integer_4
'Size use 32;
13 Default_Bit_Order_Pos
: constant Natural := System
.Bit_Order
'Pos (System
.Default_Bit_Order
);
15 Opposite_Bit_Order_Pos
: constant Natural := 1 - Default_Bit_Order_Pos
;
17 Opposite_Bit_Order
: constant System
.Bit_Order
:= System
.Bit_Order
'Val (Opposite_Bit_Order_Pos
);
21 X
, Y
: Unsigned_Integer_4
;
23 for Rec
'Bit_Order use System
.Default_Bit_Order
;
24 for Rec
'Scalar_Storage_Order use System
.Default_Bit_Order
;
28 X
at 0 * 4 range 0 .. 31;
29 Y
at 1 * 4 range 0 .. 31;
34 I
: Unsigned_Integer_4
;
36 J
: Unsigned_Integer_4
;
40 I
at 0 * 4 range 0 .. 31;
41 R
at 1 * 4 range 0 .. 63;
42 J
at 3 * 4 range 0 .. 31;
45 for Nested_Rec
'Bit_Order use Opposite_Bit_Order
;
46 for Nested_Rec
'Scalar_Storage_Order use Opposite_Bit_Order
;
54 subtype Nested_Rec_As_Stream
is Ada
.Streams
.Stream_Element_Array
(1 ..16);
57 new Ada
.Unchecked_Conversion
(Nested_Rec
, Nested_Rec_As_Stream
);
59 Nr_Stream
: constant Nested_Rec_As_Stream
:= To_Stream
(Nr
);
61 Expected
: constant array (System
.Bit_Order
) of Nested_Rec_As_Stream
:=
62 (System
.Low_Order_First
=>
67 System
.High_Order_First
=>
74 if Nr_Stream
/= Expected
(System
.Default_Bit_Order
) then