1-- { dg-do run }
2
3with System;
4
5procedure SSO5 is
6
7   type Short_Int is mod 2**16;
8
9   type Rec1 is record
10      F1 : Short_Int;
11      F2 : Short_Int;
12   end record;
13   for Rec1 use record
14      F1 at 0 range  0 .. 15;
15      F2 at 0 range 16 .. 31;
16   end record;
17   for Rec1'Bit_Order use System.High_Order_First;
18   for Rec1'Scalar_Storage_Order use System.High_Order_First;
19
20   type Rec2 is record
21      R1 : Rec1;
22   end record;
23   for Rec2 use record
24      R1 at 0 range 1 .. 32;
25   end record;
26   for Rec2'Bit_Order use System.High_Order_First;
27   for Rec2'Scalar_Storage_Order use System.High_Order_First;
28
29   type Rec3 is record
30      Data : Rec1;
31   end record;
32   for Rec3 use record
33      Data at 0 range 0 .. 31;
34   end record;
35   for Rec3'Bit_Order use System.High_Order_First;
36   for Rec3'Scalar_Storage_Order use System.High_Order_First;
37
38   procedure Copy (Message : in Rec3) is
39      Local : Rec2;
40   begin
41      Local := (R1 => Message.Data);
42      if Local.R1 /= Message.Data then
43         raise Program_Error;
44      end if;
45   end;
46
47   Message : Rec3;
48
49begin
50   Message := (Data => (2, 3));
51   Copy(Message);
52end;
53