annotate gcc/testsuite/ada/acats/tests/cd/cd30004.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 -- CD30004.A
kono
parents:
diff changeset
2 --
kono
parents:
diff changeset
3 -- Grant of Unlimited Rights
kono
parents:
diff changeset
4 --
kono
parents:
diff changeset
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
kono
parents:
diff changeset
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
kono
parents:
diff changeset
7 -- unlimited rights in the software and documentation contained herein.
kono
parents:
diff changeset
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
kono
parents:
diff changeset
9 -- this public release, the Government intends to confer upon all
kono
parents:
diff changeset
10 -- recipients unlimited rights equal to those held by the Government.
kono
parents:
diff changeset
11 -- These rights include rights to use, duplicate, release or disclose the
kono
parents:
diff changeset
12 -- released technical data and computer software in whole or in part, in
kono
parents:
diff changeset
13 -- any manner and for any purpose whatsoever, and to have or permit others
kono
parents:
diff changeset
14 -- to do so.
kono
parents:
diff changeset
15 --
kono
parents:
diff changeset
16 -- DISCLAIMER
kono
parents:
diff changeset
17 --
kono
parents:
diff changeset
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
kono
parents:
diff changeset
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
kono
parents:
diff changeset
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
kono
parents:
diff changeset
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
kono
parents:
diff changeset
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
kono
parents:
diff changeset
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
kono
parents:
diff changeset
24 --*
kono
parents:
diff changeset
25 --
kono
parents:
diff changeset
26 -- OBJECTIVE:
kono
parents:
diff changeset
27 --
kono
parents:
diff changeset
28 --
kono
parents:
diff changeset
29 -- Check that the unspecified Size of static discrete
kono
parents:
diff changeset
30 -- subtypes is the number of bits needed to represent each value
kono
parents:
diff changeset
31 -- belonging to the subtype using an unbiased representation, where
kono
parents:
diff changeset
32 -- space for a sign bit is provided only in the event the subtype
kono
parents:
diff changeset
33 -- contains negative values. Check that for first subtypes specified
kono
parents:
diff changeset
34 -- Sizes are supported reflecting this representation. [ARM 95 13.3(55)].
kono
parents:
diff changeset
35 --
kono
parents:
diff changeset
36 -- TEST DESCRIPTION:
kono
parents:
diff changeset
37 -- This test defines a few types that should have distinctly recognizable
kono
parents:
diff changeset
38 -- sizes. A packed record which should result in very specific bits
kono
parents:
diff changeset
39 -- sizes for it's components is used to check the first part of the
kono
parents:
diff changeset
40 -- objective. The second part of the objective is checked by giving
kono
parents:
diff changeset
41 -- sizes for a similar set of types.
kono
parents:
diff changeset
42 --
kono
parents:
diff changeset
43 -- APPLICABILITY CRITERIA:
kono
parents:
diff changeset
44 -- All implementations must attempt to compile this test.
kono
parents:
diff changeset
45 --
kono
parents:
diff changeset
46 -- For implementations validating against Systems Programming Annex (C):
kono
parents:
diff changeset
47 -- this test must execute and report PASSED.
kono
parents:
diff changeset
48 --
kono
parents:
diff changeset
49 -- For implementations not validating against Annex C:
kono
parents:
diff changeset
50 -- this test may report compile time errors at one or more points
kono
parents:
diff changeset
51 -- indicated by "-- ANX-C RQMT", in which case it may be graded as inapplicable.
kono
parents:
diff changeset
52 -- Otherwise, the test must execute and report PASSED.
kono
parents:
diff changeset
53 --
kono
parents:
diff changeset
54 -- CHANGE HISTORY:
kono
parents:
diff changeset
55 -- 22 JUL 95 SAIC Initial version
kono
parents:
diff changeset
56 -- 06 MAY 96 SAIC Revised for 2.1
kono
parents:
diff changeset
57 -- 26 FEB 97 PWB.CTA Added pragma Pack for type Check_Record
kono
parents:
diff changeset
58 -- 16 FEB 98 EDS Modified Documentation.
kono
parents:
diff changeset
59 -- 06 JUL 99 RLB Repaired comments, removed junk test cases.
kono
parents:
diff changeset
60 -- Added test cases to test that appropriate Size
kono
parents:
diff changeset
61 -- clauses are allowed.
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 --!
kono
parents:
diff changeset
64 ----------------------------------------------------------------- CD30004_0
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 package CD30004_0 is
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 -- Check that the unspecified Size of static discrete and fixed point
kono
parents:
diff changeset
69 -- subtypes are the number of bits needed to represent each value
kono
parents:
diff changeset
70 -- belonging to the subtype using an unbiased representation, where
kono
parents:
diff changeset
71 -- space for a sign bit is provided only in the event the subtype
kono
parents:
diff changeset
72 -- contains negative values. Check that for first subtypes specified
kono
parents:
diff changeset
73 -- Sizes are supported reflecting this representation.
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 type Bits_2 is ( Zeroth_Bit, Fiercest_Bit, Secants_Bit, Threadless_Bit );
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 type Bits_3 is range 0..2**3-1;
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 type Bits_5 is range -2**4+1..2**4-1; -- allow for 1's comp
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 type Bits_14 is mod 2**14;
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 type Check_Record is
kono
parents:
diff changeset
84 record
kono
parents:
diff changeset
85 B14 : Bits_14;
kono
parents:
diff changeset
86 B2 : Bits_2;
kono
parents:
diff changeset
87 B3 : Bits_3;
kono
parents:
diff changeset
88 B5 : Bits_5;
kono
parents:
diff changeset
89 C : Character;
kono
parents:
diff changeset
90 end record;
kono
parents:
diff changeset
91 pragma Pack ( Check_Record );
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 procedure TC_Check_Values;
kono
parents:
diff changeset
94 procedure TC_Check_Specified_Sizes;
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 end CD30004_0;
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
kono
parents:
diff changeset
99 with Report;
kono
parents:
diff changeset
100 with Impdef;
kono
parents:
diff changeset
101 package body CD30004_0 is
kono
parents:
diff changeset
102
kono
parents:
diff changeset
103 procedure TC_Check_Values is
kono
parents:
diff changeset
104 begin
kono
parents:
diff changeset
105
kono
parents:
diff changeset
106 if Bits_2'Size /= 2 then
kono
parents:
diff changeset
107 if Impdef.Validating_Annex_C then
kono
parents:
diff changeset
108 Report.Failed("Bits_2'Size not 2 bits");
kono
parents:
diff changeset
109 else -- Recommended levels of support are not binding.
kono
parents:
diff changeset
110 Report.Comment("Bits_2'Size not 2 bits");
kono
parents:
diff changeset
111 end if;
kono
parents:
diff changeset
112 end if;
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114 if Bits_14'Size /= 14 then
kono
parents:
diff changeset
115 if Impdef.Validating_Annex_C then
kono
parents:
diff changeset
116 Report.Failed("Bits_14'Size not 14 bits");
kono
parents:
diff changeset
117 else
kono
parents:
diff changeset
118 Report.Comment("Bits_14'Size not 14 bits");
kono
parents:
diff changeset
119 end if;
kono
parents:
diff changeset
120 end if;
kono
parents:
diff changeset
121
kono
parents:
diff changeset
122 if Bits_3'Size /= 3 then
kono
parents:
diff changeset
123 if Impdef.Validating_Annex_C then
kono
parents:
diff changeset
124 Report.Failed("Bits_3'Size not 3 bits");
kono
parents:
diff changeset
125 else
kono
parents:
diff changeset
126 Report.Comment("Bits_3'Size not 3 bits");
kono
parents:
diff changeset
127 end if;
kono
parents:
diff changeset
128 end if;
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 if Bits_5'Size /= 5 then
kono
parents:
diff changeset
131 if Impdef.Validating_Annex_C then
kono
parents:
diff changeset
132 Report.Failed("Bits_5'Size not 5 bits");
kono
parents:
diff changeset
133 else
kono
parents:
diff changeset
134 Report.Comment("Bits_5'Size not 5 bits");
kono
parents:
diff changeset
135 end if;
kono
parents:
diff changeset
136 end if;
kono
parents:
diff changeset
137
kono
parents:
diff changeset
138 if Character'Size /= 8 then
kono
parents:
diff changeset
139 Report.Failed("Character'Size not 8 bits");
kono
parents:
diff changeset
140 end if;
kono
parents:
diff changeset
141
kono
parents:
diff changeset
142 if Wide_Character'Size /= 16 then
kono
parents:
diff changeset
143 Report.Failed("Wide_Character'Size not 16 bits");
kono
parents:
diff changeset
144 end if;
kono
parents:
diff changeset
145
kono
parents:
diff changeset
146 end TC_Check_Values;
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 type Spec_Bits_2 is ( Zeroth_Bit, Fiercest_Bit, Secants_Bit, Threadless_Bit );
kono
parents:
diff changeset
149 for Spec_Bits_2'Size use 2; -- ANX-C RQMT.
kono
parents:
diff changeset
150
kono
parents:
diff changeset
151 type Spec_Bits_3 is range 0..2**3-1;
kono
parents:
diff changeset
152 for Spec_Bits_3'Size use 3; -- ANX-C RQMT.
kono
parents:
diff changeset
153
kono
parents:
diff changeset
154 type Spec_Bits_5 is range -2**4+1..2**4-1; -- allow for 1's comp
kono
parents:
diff changeset
155 for Spec_Bits_5'Size use 5; -- ANX-C RQMT.
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157 type Spec_Bits_14 is mod 2**14;
kono
parents:
diff changeset
158 for Spec_Bits_14'Size use 14; -- ANX-C RQMT.
kono
parents:
diff changeset
159
kono
parents:
diff changeset
160 type Spec_Record is new Check_Record;
kono
parents:
diff changeset
161 for Spec_Record'Size use 64; -- ANX-C RQMT.
kono
parents:
diff changeset
162
kono
parents:
diff changeset
163 procedure TC_Check_Specified_Sizes is
kono
parents:
diff changeset
164
kono
parents:
diff changeset
165 begin
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 if Spec_Record'Size /= 64 then
kono
parents:
diff changeset
168 Report.Failed("Spec_Record'Size not 64 bits");
kono
parents:
diff changeset
169 end if;
kono
parents:
diff changeset
170
kono
parents:
diff changeset
171 if Spec_Bits_2'Size /= 2 then
kono
parents:
diff changeset
172 Report.Failed("Spec_Bits_2'Size not 2 bits");
kono
parents:
diff changeset
173 end if;
kono
parents:
diff changeset
174
kono
parents:
diff changeset
175 if Spec_Bits_14'Size /= 14 then
kono
parents:
diff changeset
176 Report.Failed("Spec_Bits_14'Size not 14 bits");
kono
parents:
diff changeset
177 end if;
kono
parents:
diff changeset
178
kono
parents:
diff changeset
179 if Spec_Bits_3'Size /= 3 then
kono
parents:
diff changeset
180 Report.Failed("Spec_Bits_3'Size not 3 bits");
kono
parents:
diff changeset
181 end if;
kono
parents:
diff changeset
182
kono
parents:
diff changeset
183 if Spec_Bits_5'Size /= 5 then
kono
parents:
diff changeset
184 Report.Failed("Spec_Bits_5'Size not 5 bits");
kono
parents:
diff changeset
185 end if;
kono
parents:
diff changeset
186
kono
parents:
diff changeset
187 end TC_Check_Specified_Sizes;
kono
parents:
diff changeset
188
kono
parents:
diff changeset
189 end CD30004_0;
kono
parents:
diff changeset
190
kono
parents:
diff changeset
191 ------------------------------------------------------------------- CD30004
kono
parents:
diff changeset
192
kono
parents:
diff changeset
193 with Report;
kono
parents:
diff changeset
194 with CD30004_0;
kono
parents:
diff changeset
195
kono
parents:
diff changeset
196 procedure CD30004 is
kono
parents:
diff changeset
197
kono
parents:
diff changeset
198 begin -- Main test procedure.
kono
parents:
diff changeset
199
kono
parents:
diff changeset
200 Report.Test ("CD30004", "Check that the unspecified Size of static " &
kono
parents:
diff changeset
201 "discrete and fixed point subtypes is the number of bits " &
kono
parents:
diff changeset
202 "needed to represent each value belonging to the subtype " &
kono
parents:
diff changeset
203 "using an unbiased representation, where space for a sign " &
kono
parents:
diff changeset
204 "bit is provided only in the event the subtype contains " &
kono
parents:
diff changeset
205 "negative values. Check that for first subtypes " &
kono
parents:
diff changeset
206 "specified Sizes are supported reflecting this " &
kono
parents:
diff changeset
207 "representation.");
kono
parents:
diff changeset
208
kono
parents:
diff changeset
209 CD30004_0.TC_Check_Values;
kono
parents:
diff changeset
210
kono
parents:
diff changeset
211 CD30004_0.TC_Check_Specified_Sizes;
kono
parents:
diff changeset
212
kono
parents:
diff changeset
213 Report.Result;
kono
parents:
diff changeset
214
kono
parents:
diff changeset
215 end CD30004;