4 -- Grant of Unlimited Rights
6 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
7 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
8 -- unlimited rights in the software and documentation contained herein.
9 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
10 -- this public release, the Government intends to confer upon all
11 -- recipients unlimited rights equal to those held by the Government.
12 -- These rights include rights to use, duplicate, release or disclose the
13 -- released technical data and computer software in whole or in part, in
14 -- any manner and for any purpose whatsoever, and to have or permit others
19 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
20 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
21 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
22 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
23 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
24 -- PARTICULAR PURPOSE OF SAID MATERIAL.
28 -- Check that package System includes Max_Base_Digits, Address,
29 -- Null_Address, Word_Size, functions "<", "<=", ">", ">=", "="
30 -- (with Address parameters and Boolean results), Bit_Order,
31 -- Default_Bit_Order, Any_Priority, Interrupt_Priority,
32 -- and Default_Priority.
34 -- Check that package System.Storage_Elements includes all required
35 -- types and operations.
38 -- The test checks for the existence of the names additional
39 -- to package system above those names tested for in 9Xbasic.
41 -- This test checks that the semantics provided in Storage_Elements
42 -- are present and operate marginally within expectations (to the best
43 -- extent possible in a portable implementation independent fashion).
47 -- 09 MAY 95 SAIC Initial version
48 -- 27 JAN 96 SAIC Revised for 2.1; Allow negative address delta
54 with System
.Storage_Elements
;
55 with System
.Address_To_Access_Conversions
;
61 type Int_Max
is range Min_Int
.. Max_Int
;
63 My_Int
: Int_Max
:= System
.Max_Base_Digits
+ System
.Word_Size
;
66 An_Other_Address
: Address
:= An_Address
'Address;
71 if Default_Bit_Order
not in High_Order_First
..Low_Order_First
then
72 Report
.Failed
("Default_Bit_Order invalid");
75 if Bit_Order
'Pos(High_Order_First
) /= 0 then
76 Report
.Failed
("Bit_Order'Pos(High_Order_First) /= 0");
79 if Bit_Order
'Pos(Low_Order_First
) /= 1 then
80 Report
.Failed
("Bit_Order'Pos(Low_Order_First) /= 1");
83 An_Address
:= My_Int
'Address;
85 if An_Address
= Null_Address
then
86 Report
.Failed
("Null_Address matched a real address");
90 if An_Address
'Address /= An_Other_Address
then
91 Report
.Failed
("Value set at elaboration not equal to itself");
94 if An_Address
'Address > An_Other_Address
95 and An_Address
'Address < An_Other_Address
then
96 Report
.Failed
("Address is both greater and less!");
99 if not (An_Address
'Address >= An_Other_Address
100 and An_Address
'Address <= An_Other_Address
) then
101 Report
.Failed
("Address comparisons wrong");
105 if Priority
'First /= Any_Priority
'First then
106 Report
.Failed
("Priority'First /= Any_Priority'First");
109 if Interrupt_Priority
'First /= Priority
'Last+1 then
110 Report
.Failed
("Interrupt_Priority'First /= Priority'Last+1");
113 if Interrupt_Priority
'Last /= Any_Priority
'Last then
114 Report
.Failed
("Interrupt_Priority'Last /= Any_Priority'Last");
117 if Default_Priority
/= ((Priority
'First + Priority
'Last)/2) then
118 Report
.Failed
("Default_Priority wrong value");
124 use System
.Storage_Elements
;
126 Storehouse_1
: Storage_Array
(0..127);
127 Storehouse_2
: Storage_Array
(0..127);
129 House_Offset
: Storage_Offset
;
134 if Storage_Count
'First /= 0 then
135 Report
.Failed
("Storage_Count'First /= 0");
138 if Storage_Count
'Last /= Storage_Offset
'Last then
139 Report
.Failed
("Storage_Count'Last /= Storage_Offset'Last");
143 if Storage_Element
'Size /= Storage_Unit
then
144 Report
.Failed
("Storage_Element'Size /= Storage_Unit");
147 if Storage_Array
'Component_Size /= Storage_Unit
then
148 Report
.Failed
("Storage_Array'Element_Size /= Storage_Unit");
151 if Storage_Element
'Last+1 /= 0 then
152 Report
.Failed
("Storage_Element not modular");
156 -- "+", "-"( Address, Storage_Offset) and inverse
158 House_Offset
:= Storehouse_2
'Address - Storehouse_1
'Address;
159 -- Address - Address = Offset
160 -- Note that House_Offset may be a negative value
162 if House_Offset
+ Storehouse_1
'Address /= Storehouse_2
'Address then
163 -- Offset + Address = Address
164 Report
.Failed
("Storage arithmetic non-linear O+A");
167 if Storehouse_1
'Address + House_Offset
/= Storehouse_2
'Address then
168 -- Address + Offset = Address
169 Report
.Failed
("Storage arithmetic non-linear A+O");
172 if Storehouse_2
'Address - House_Offset
/= Storehouse_1
'Address then
173 -- Address - Offset = Address
174 Report
.Failed
("Storage arithmetic non-linear A-O");
177 if (Storehouse_2
'Address mod abs(House_Offset
) > abs(House_Offset
)) then
178 -- "mod"( Address, Storage_Offset)
179 Report
.Failed
("Mod arithmetic");
183 if Storehouse_1
'Address
184 /= To_Address
(To_Integer
(Storehouse_1
'Address)) then
185 Report
.Failed
("To_Address, To_Integer not symmetric");
191 begin -- Main test procedure.
193 Report
.Test
("CD70001", "Check package System" );