annotate gcc/testsuite/ada/acats/tests/cd/cd70001.a @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 --
kono
parents:
diff changeset
2 -- CD70001.A
kono
parents:
diff changeset
3 --
kono
parents:
diff changeset
4 -- Grant of Unlimited Rights
kono
parents:
diff changeset
5 --
kono
parents:
diff changeset
6 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
kono
parents:
diff changeset
7 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
kono
parents:
diff changeset
8 -- unlimited rights in the software and documentation contained herein.
kono
parents:
diff changeset
9 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
kono
parents:
diff changeset
10 -- this public release, the Government intends to confer upon all
kono
parents:
diff changeset
11 -- recipients unlimited rights equal to those held by the Government.
kono
parents:
diff changeset
12 -- These rights include rights to use, duplicate, release or disclose the
kono
parents:
diff changeset
13 -- released technical data and computer software in whole or in part, in
kono
parents:
diff changeset
14 -- any manner and for any purpose whatsoever, and to have or permit others
kono
parents:
diff changeset
15 -- to do so.
kono
parents:
diff changeset
16 --
kono
parents:
diff changeset
17 -- DISCLAIMER
kono
parents:
diff changeset
18 --
kono
parents:
diff changeset
19 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
kono
parents:
diff changeset
20 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
kono
parents:
diff changeset
21 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
kono
parents:
diff changeset
22 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
kono
parents:
diff changeset
23 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
kono
parents:
diff changeset
24 -- PARTICULAR PURPOSE OF SAID MATERIAL.
kono
parents:
diff changeset
25 --*
kono
parents:
diff changeset
26 --
kono
parents:
diff changeset
27 -- OBJECTIVE:
kono
parents:
diff changeset
28 -- Check that package System includes Max_Base_Digits, Address,
kono
parents:
diff changeset
29 -- Null_Address, Word_Size, functions "<", "<=", ">", ">=", "="
kono
parents:
diff changeset
30 -- (with Address parameters and Boolean results), Bit_Order,
kono
parents:
diff changeset
31 -- Default_Bit_Order, Any_Priority, Interrupt_Priority,
kono
parents:
diff changeset
32 -- and Default_Priority.
kono
parents:
diff changeset
33 --
kono
parents:
diff changeset
34 -- Check that package System.Storage_Elements includes all required
kono
parents:
diff changeset
35 -- types and operations.
kono
parents:
diff changeset
36 --
kono
parents:
diff changeset
37 -- TEST DESCRIPTION:
kono
parents:
diff changeset
38 -- The test checks for the existence of the names additional
kono
parents:
diff changeset
39 -- to package system above those names tested for in 9Xbasic.
kono
parents:
diff changeset
40 --
kono
parents:
diff changeset
41 -- This test checks that the semantics provided in Storage_Elements
kono
parents:
diff changeset
42 -- are present and operate marginally within expectations (to the best
kono
parents:
diff changeset
43 -- extent possible in a portable implementation independent fashion).
kono
parents:
diff changeset
44 --
kono
parents:
diff changeset
45 --
kono
parents:
diff changeset
46 -- CHANGE HISTORY:
kono
parents:
diff changeset
47 -- 09 MAY 95 SAIC Initial version
kono
parents:
diff changeset
48 -- 27 JAN 96 SAIC Revised for 2.1; Allow negative address delta
kono
parents:
diff changeset
49 --
kono
parents:
diff changeset
50 --!
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 with Report;
kono
parents:
diff changeset
53 with Ada.Text_IO;
kono
parents:
diff changeset
54 with System.Storage_Elements;
kono
parents:
diff changeset
55 with System.Address_To_Access_Conversions;
kono
parents:
diff changeset
56 procedure CD70001 is
kono
parents:
diff changeset
57 use System;
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 procedure CD70 is
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 type Int_Max is range Min_Int .. Max_Int;
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 My_Int : Int_Max := System.Max_Base_Digits + System.Word_Size;
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 An_Address : Address;
kono
parents:
diff changeset
66 An_Other_Address : Address := An_Address'Address;
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 begin -- 7.0
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 if Default_Bit_Order not in High_Order_First..Low_Order_First then
kono
parents:
diff changeset
72 Report.Failed ("Default_Bit_Order invalid");
kono
parents:
diff changeset
73 end if;
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 if Bit_Order'Pos(High_Order_First) /= 0 then
kono
parents:
diff changeset
76 Report.Failed ("Bit_Order'Pos(High_Order_First) /= 0");
kono
parents:
diff changeset
77 end if;
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 if Bit_Order'Pos(Low_Order_First) /= 1 then
kono
parents:
diff changeset
80 Report.Failed ("Bit_Order'Pos(Low_Order_First) /= 1");
kono
parents:
diff changeset
81 end if;
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 An_Address := My_Int'Address;
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 if An_Address = Null_Address then
kono
parents:
diff changeset
86 Report.Failed ("Null_Address matched a real address");
kono
parents:
diff changeset
87 end if;
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 if An_Address'Address /= An_Other_Address then
kono
parents:
diff changeset
91 Report.Failed("Value set at elaboration not equal to itself");
kono
parents:
diff changeset
92 end if;
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 if An_Address'Address > An_Other_Address
kono
parents:
diff changeset
95 and An_Address'Address < An_Other_Address then
kono
parents:
diff changeset
96 Report.Failed("Address is both greater and less!");
kono
parents:
diff changeset
97 end if;
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 if not (An_Address'Address >= An_Other_Address
kono
parents:
diff changeset
100 and An_Address'Address <= An_Other_Address) then
kono
parents:
diff changeset
101 Report.Failed("Address comparisons wrong");
kono
parents:
diff changeset
102 end if;
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104
kono
parents:
diff changeset
105 if Priority'First /= Any_Priority'First then
kono
parents:
diff changeset
106 Report.Failed ("Priority'First /= Any_Priority'First");
kono
parents:
diff changeset
107 end if;
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 if Interrupt_Priority'First /= Priority'Last+1 then
kono
parents:
diff changeset
110 Report.Failed ("Interrupt_Priority'First /= Priority'Last+1");
kono
parents:
diff changeset
111 end if;
kono
parents:
diff changeset
112
kono
parents:
diff changeset
113 if Interrupt_Priority'Last /= Any_Priority'Last then
kono
parents:
diff changeset
114 Report.Failed ("Interrupt_Priority'Last /= Any_Priority'Last");
kono
parents:
diff changeset
115 end if;
kono
parents:
diff changeset
116
kono
parents:
diff changeset
117 if Default_Priority /= ((Priority'First + Priority'Last)/2) then
kono
parents:
diff changeset
118 Report.Failed ("Default_Priority wrong value");
kono
parents:
diff changeset
119 end if;
kono
parents:
diff changeset
120
kono
parents:
diff changeset
121 end CD70;
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 procedure CD71 is
kono
parents:
diff changeset
124 use System.Storage_Elements;
kono
parents:
diff changeset
125
kono
parents:
diff changeset
126 Storehouse_1 : Storage_Array(0..127);
kono
parents:
diff changeset
127 Storehouse_2 : Storage_Array(0..127);
kono
parents:
diff changeset
128
kono
parents:
diff changeset
129 House_Offset : Storage_Offset;
kono
parents:
diff changeset
130
kono
parents:
diff changeset
131 begin -- 7.1
kono
parents:
diff changeset
132
kono
parents:
diff changeset
133
kono
parents:
diff changeset
134 if Storage_Count'First /= 0 then
kono
parents:
diff changeset
135 Report.Failed ("Storage_Count'First /= 0");
kono
parents:
diff changeset
136 end if;
kono
parents:
diff changeset
137
kono
parents:
diff changeset
138 if Storage_Count'Last /= Storage_Offset'Last then
kono
parents:
diff changeset
139 Report.Failed ("Storage_Count'Last /= Storage_Offset'Last");
kono
parents:
diff changeset
140 end if;
kono
parents:
diff changeset
141
kono
parents:
diff changeset
142
kono
parents:
diff changeset
143 if Storage_Element'Size /= Storage_Unit then
kono
parents:
diff changeset
144 Report.Failed ("Storage_Element'Size /= Storage_Unit");
kono
parents:
diff changeset
145 end if;
kono
parents:
diff changeset
146
kono
parents:
diff changeset
147 if Storage_Array'Component_Size /= Storage_Unit then
kono
parents:
diff changeset
148 Report.Failed ("Storage_Array'Element_Size /= Storage_Unit");
kono
parents:
diff changeset
149 end if;
kono
parents:
diff changeset
150
kono
parents:
diff changeset
151 if Storage_Element'Last+1 /= 0 then
kono
parents:
diff changeset
152 Report.Failed ("Storage_Element not modular");
kono
parents:
diff changeset
153 end if;
kono
parents:
diff changeset
154
kono
parents:
diff changeset
155
kono
parents:
diff changeset
156 -- "+", "-"( Address, Storage_Offset) and inverse
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 House_Offset := Storehouse_2'Address - Storehouse_1'Address;
kono
parents:
diff changeset
159 -- Address - Address = Offset
kono
parents:
diff changeset
160 -- Note that House_Offset may be a negative value
kono
parents:
diff changeset
161
kono
parents:
diff changeset
162 if House_Offset + Storehouse_1'Address /= Storehouse_2'Address then
kono
parents:
diff changeset
163 -- Offset + Address = Address
kono
parents:
diff changeset
164 Report.Failed ("Storage arithmetic non-linear O+A");
kono
parents:
diff changeset
165 end if;
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 if Storehouse_1'Address + House_Offset /= Storehouse_2'Address then
kono
parents:
diff changeset
168 -- Address + Offset = Address
kono
parents:
diff changeset
169 Report.Failed ("Storage arithmetic non-linear A+O");
kono
parents:
diff changeset
170 end if;
kono
parents:
diff changeset
171
kono
parents:
diff changeset
172 if Storehouse_2'Address - House_Offset /= Storehouse_1'Address then
kono
parents:
diff changeset
173 -- Address - Offset = Address
kono
parents:
diff changeset
174 Report.Failed ("Storage arithmetic non-linear A-O");
kono
parents:
diff changeset
175 end if;
kono
parents:
diff changeset
176
kono
parents:
diff changeset
177 if (Storehouse_2'Address mod abs(House_Offset) > abs(House_Offset)) then
kono
parents:
diff changeset
178 -- "mod"( Address, Storage_Offset)
kono
parents:
diff changeset
179 Report.Failed("Mod arithmetic");
kono
parents:
diff changeset
180 end if;
kono
parents:
diff changeset
181
kono
parents:
diff changeset
182
kono
parents:
diff changeset
183 if Storehouse_1'Address
kono
parents:
diff changeset
184 /= To_Address(To_Integer(Storehouse_1'Address)) then
kono
parents:
diff changeset
185 Report.Failed("To_Address, To_Integer not symmetric");
kono
parents:
diff changeset
186 end if;
kono
parents:
diff changeset
187
kono
parents:
diff changeset
188 end CD71;
kono
parents:
diff changeset
189
kono
parents:
diff changeset
190
kono
parents:
diff changeset
191 begin -- Main test procedure.
kono
parents:
diff changeset
192
kono
parents:
diff changeset
193 Report.Test ("CD70001", "Check package System" );
kono
parents:
diff changeset
194
kono
parents:
diff changeset
195 CD70;
kono
parents:
diff changeset
196
kono
parents:
diff changeset
197 CD71;
kono
parents:
diff changeset
198
kono
parents:
diff changeset
199 Report.Result;
kono
parents:
diff changeset
200
kono
parents:
diff changeset
201 end CD70001;