3 -- Grant of Unlimited Rights
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
7 -- unlimited rights in the software and documentation contained herein.
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
9 -- this public release, the Government intends to confer upon all
10 -- recipients unlimited rights equal to those held by the Government.
11 -- These rights include rights to use, duplicate, release or disclose the
12 -- released technical data and computer software in whole or in part, in
13 -- any manner and for any purpose whatsoever, and to have or permit others
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
27 -- Check that Component_Sizes that are multiples of the word
28 -- size are supported.
30 -- Check that for such Component_Sizes arrays contain no gaps between
34 -- This test defines three array types and specifies their layouts
35 -- using representation specifications for the 'Component_Size and
36 -- pragma Packs for each. It then checks that the implied assumptions
37 -- about the resulting layout actually can be made.
39 -- APPLICABILITY CRITERIA:
40 -- All implementations must attempt to compile this test.
42 -- For implementations validating against Systems Programming Annex (C):
43 -- this test must execute and report PASSED.
45 -- For implementations not validating against Annex C:
46 -- this test may report compile time errors at one or more points
47 -- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
48 -- Otherwise, the test must execute and report PASSED.
52 -- 22 JUL 95 SAIC Initial version
53 -- 07 MAY 96 SAIC Revised for 2.1
54 -- 24 AUG 96 SAIC Additional 2.1 revisions
55 -- 16 FEB 98 EDS Modify documentation.
58 ----------------------------------------------------------------- CD33002_0
63 S_Units_per_Word
: constant := System
.Word_Size
/System
.Storage_Unit
;
65 type Nibble
is mod 2**4;
67 type Byte
is mod 2**8;
69 type Word_Stuff
is array(Natural range <>) of Byte
;
70 for Word_Stuff
'Component_Size
71 use System
.Word_Size
; -- ANX-C RQMT.
72 pragma Pack
(Word_Stuff
); -- ANX-C RQMT.
74 type Double_Stuff
is array(Natural range <>) of Byte
;
75 for Double_Stuff
'Component_Size
76 use System
.Word_Size
* 2; -- multiple -- ANX-C RQMT.
78 type Address_Calculator
is record
83 for Address_Calculator
use record
84 Item_1
at 0 range 0..3;
85 Item_2
at 1 range 0..3;
88 -- by definition (13.5.2(2)) abs(Item_2'Address - Item_1'Address) = 1
89 -- it therefore follows that:
90 -- Address_Calculator'Size = 2 * Addressable_Unit'Size
94 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
96 -- there is no package body CD33002_0
98 ------------------------------------------------------------------- CD33002
102 with System
.Storage_Elements
;
106 use type System
.Storage_Elements
.Storage_Offset
;
108 A_Word
: CD33002_0
.Word_Stuff
(0..15);
110 A_Double
: CD33002_0
.Double_Stuff
(0..15);
112 procedure Unexpected
( Message
: String; Wanted
, Got
: Integer ) is
114 Report
.Failed
( Message
& " Wanted:"
115 & Integer'Image(Wanted
) & " Got:" & Integer'Image(Got
) );
118 begin -- Main test procedure.
120 Report
.Test
("CD33002", "Check that Component_Sizes that are multiples "
121 & "of the word size are supported. Check that for "
122 & "such Component_Sizes arrays contain no gaps "
123 & "between components" );
125 if A_Word
'Size /= CD33002_0
.Word_Stuff
'Component_Size * 16 then
126 Unexpected
("Word Size",
127 CD33002_0
.Word_Stuff
'Component_Size * 16,
131 if A_Double
'Size /= CD33002_0
.Double_Stuff
'Component_Size * 16 then
132 Unexpected
("Double word Size",
133 CD33002_0
.Double_Stuff
'Component_Size * 16,