runtime: copy more of scheduler from Go 1.7 runtime
[official-gcc.git] / gcc / testsuite / gnat.dg / rep_clause1.adb
blobb7f5c7dd41008c4666e61e23188a582a5a376718
1 -- { dg-do compile }
3 with Ada.Text_IO; use Ada.Text_IO;
5 procedure Rep_Clause1 is
7 type Int_16 is range 0 .. 65535;
8 for Int_16'Size use 16;
10 ----------------------------------------------
12 type Rec_A is
13 record
14 Int_1 : Int_16;
15 Int_2 : Int_16;
16 Int_3 : Int_16;
17 Int_4 : Int_16;
18 end record;
21 for Rec_A use record
22 Int_1 at 0 range 0 .. 15;
23 Int_2 at 2 range 0 .. 15;
24 Int_3 at 4 range 0 .. 15;
25 Int_4 at 6 range 0 .. 15;
26 end record;
28 Rec_A_Size : constant := 4 * 16;
30 for Rec_A'Size use Rec_A_Size;
32 ----------------------------------------------
34 type Rec_B_Version_1 is
35 record
36 Rec_1 : Rec_A;
37 Rec_2 : Rec_A;
38 Int_1 : Int_16;
39 end record;
41 for Rec_B_Version_1 use record
42 Rec_1 at 0 range 0 .. 63;
43 Rec_2 at 8 range 0 .. 63;
44 Int_1 at 16 range 0 .. 15;
45 end record;
47 Rec_B_Size : constant := 2 * Rec_A_Size + 16;
49 for Rec_B_Version_1'Size use Rec_B_Size;
50 for Rec_B_Version_1'Alignment use 2;
52 ----------------------------------------------
54 type Rec_B_Version_2 is
55 record
56 Int_1 : Int_16;
57 Rec_1 : Rec_A;
58 Rec_2 : Rec_A;
59 end record;
61 for Rec_B_Version_2 use record
62 Int_1 at 0 range 0 .. 15;
63 Rec_1 at 2 range 0 .. 63;
64 Rec_2 at 10 range 0 .. 63;
65 end record;
67 for Rec_B_Version_2'Size use Rec_B_Size;
69 ----------------------------------------------
71 Arr_A_Length : constant := 2;
72 Arr_A_Size : constant := Arr_A_Length * Rec_B_Size;
74 type Arr_A_Version_1 is array (1 .. Arr_A_Length) of Rec_B_Version_1;
75 type Arr_A_Version_2 is array (1 .. Arr_A_Length) of Rec_B_Version_2;
77 pragma Pack (Arr_A_Version_1);
78 pragma Pack (Arr_A_Version_2);
80 for Arr_A_Version_1'Size use Arr_A_Size;
81 for Arr_A_Version_2'Size use Arr_A_Size;
83 ----------------------------------------------
85 begin
86 -- Put_Line ("Arr_A_Size =" & Arr_A_Size'Img);
88 if Arr_A_Version_1'Size /= Arr_A_Size then
89 Ada.Text_IO.Put_Line
90 ("Version 1 Size mismatch! " &
91 "Arr_A_Version_1'Size =" & Arr_A_Version_1'Size'Img);
92 end if;
94 if Arr_A_Version_2'Size /= Arr_A_Size then
95 Ada.Text_IO.Put_Line
96 ("Version 2 Size mismatch! " &
97 "Arr_A_Version_2'Size =" & Arr_A_Version_2'Size'Img);
99 end if;
101 end;