RISC-V: Add support for riscv-*-*.
[official-gcc.git] / gcc / testsuite / gnat.dg / sso4.adb
blob6a409e92a5f7e754917aa20c1f9ae1ffa9f63f28
1 -- { dg-do run }
3 with System;
5 procedure SSO4 is
7 type Short_Int is mod 2**16;
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;
18 for Rec1'Bit_Order use System.High_Order_First;
19 for Rec1'Scalar_Storage_Order use System.High_Order_First;
21 type Rec2 is record
22 I1 : Integer;
23 R1 : Rec1;
24 end record;
25 for Rec2 use record
26 I1 at 0 range 0 .. 31;
27 R1 at 4 range 0 .. 31;
28 end record;
29 for Rec2'Bit_Order use System.High_Order_First;
30 for Rec2'Scalar_Storage_Order use System.High_Order_First;
32 type Rec3 is record
33 Data : Rec1;
34 end record;
35 for Rec3 use record
36 Data at 0 range 0 .. 31;
37 end record;
38 for Rec3'Bit_Order use System.High_Order_First;
39 for Rec3'Scalar_Storage_Order use System.High_Order_First;
41 procedure Copy (Message : in Rec3) is
42 Local : Rec2;
43 begin
44 Local := (I1 => 1, R1 => Message.Data);
45 if Local.R1 /= Message.Data then
46 raise Program_Error;
47 end if;
48 end;
50 Message : Rec3;
52 begin
53 Message := (Data => (2, 3));
54 Copy(Message);
55 end;