1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
|
-- IMPDEF.A
--
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
--
-- DESCRIPTION:
-- This package provides tailorable entities for a particular
-- implementation. Each entity may be modified to suit the needs
-- of the implementation. Default values are provided to act as
-- a guide.
--
-- The entities in this package are those which are used in at least
-- one core test. Entities which are used exclusively in tests for
-- annexes C-H are located in annex-specific child units of this package.
--
-- CHANGE HISTORY:
-- 12 DEC 93 SAIC Initial PreRelease version
-- 02 DEC 94 SAIC Second PreRelease version
-- 16 May 95 SAIC Added constants specific to tests of the random
-- number generator.
-- 16 May 95 SAIC Added Max_RPC_Call_Time constant.
-- 17 Jul 95 SAIC Added Non_State_String constant.
-- 21 Aug 95 SAIC Created from existing IMPSPEC.ADA and IMPBODY.ADA
-- files.
-- 30 Oct 95 SAIC Added external name string constants.
-- 24 Jan 96 SAIC Added alignment constants.
-- 29 Jan 96 SAIC Moved entities not used in core tests into annex-
-- specific child packages. Adjusted commentary.
-- Renamed Validating_System_Programming_Annex to
-- Validating_Annex_C. Added similar Validating_Annex_?
-- constants for the other non-core annexes (D-H).
-- 01 Mar 96 SAIC Added external name string constants.
-- 21 Mar 96 SAIC Added external name string constants.
-- 02 May 96 SAIC Removed constants for draft test CXA5014, which was
-- removed from the tentative ACVC 2.1 suite.
-- Added constants for use with FXACA00.
-- 06 Jun 96 SAIC Added constants for wide character test files.
-- 11 Dec 96 SAIC Updated constants for wide character test files.
-- 13 Dec 96 SAIC Added Address_Value_IO
-- 13 Sep 99 RLB Added more external name string constants.
-- 16 Sep 99 RLB Corrected definition of Non_State_String constant.
-- 5 Jul 12 RLB Removed misleading comment.
-- 20 Jul 12 RLB Added Maximum_Adjustment_To_Specified_Storage_Size.
-- 24 Mar 14 RLB Added external name string constants for new tests.
-- 14 Jan 15 RLB Added environment variable names for new tests.
-- Removed obsolete .AW processor constants.
-- 9 Feb 15 RLB Added directory name for new test.
-- 19 Feb 15 RLB Added file name comparison function for new tests.
-- Added current and parent directory names.
-- 25 Nov 15 RLB Added external name string constants for new tests.
--
--!
with Report;
with Ada.Text_IO;
with System.Storage_Elements;
package ImpDef is
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following boolean constants indicate whether this validation will
-- include any of annexes C-H. The values of these booleans affect the
-- behavior of the test result reporting software.
--
-- True means the associated annex IS included in the validation.
-- False means the associated annex is NOT included.
Validating_Annex_C : constant Boolean := True;
-- ^^^^^ --- MODIFY HERE AS NEEDED
Validating_Annex_D : constant Boolean := True;
-- ^^^^^ --- MODIFY HERE AS NEEDED
Validating_Annex_E : constant Boolean := True;
-- ^^^^^ --- MODIFY HERE AS NEEDED
Validating_Annex_F : constant Boolean := True;
-- ^^^^^ --- MODIFY HERE AS NEEDED
Validating_Annex_G : constant Boolean := True;
-- ^^^^^ --- MODIFY HERE AS NEEDED
Validating_Annex_H : constant Boolean := True;
-- ^^^^^ --- MODIFY HERE AS NEEDED
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- This is the minimum time required to allow another task to get
-- control. It is expected that the task is on the Ready queue.
-- A duration of 0.0 would normally be sufficient but some number
-- greater than that is expected.
Minimum_Task_Switch : constant Duration := 0.001;
-- ^^^ --- MODIFY HERE AS NEEDED
-- The above constant has been chosen for use with delay statements in the
-- GCC testsuite so that they do not take too long, but may be too small.
Long_Minimum_Task_Switch : constant Duration := 0.1;
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- This is the time required to activate another task and allow it
-- to run to its first accept statement. We are considering a simple task
-- with very few Ada statements before the accept. An implementation is
-- free to specify a delay of several seconds, or even minutes if need be.
-- The main effect of specifying a longer delay than necessary will be an
-- extension of the time needed to run the associated tests.
Switch_To_New_Task : constant Duration := 0.001;
-- ^^^ -- MODIFY HERE AS NEEDED
-- The above constant has been chosen for use with delay statements in the
-- GCC testsuite so that they do not take too long, but may be too small.
Long_Switch_To_New_Task : constant Duration := 0.1;
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- This is the time which will clear the queues of other tasks
-- waiting to run. It is expected that this will be about five
-- times greater than Switch_To_New_Task.
Clear_Ready_Queue : constant Duration := 0.1;
-- ^^^ --- MODIFY HERE AS NEEDED
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- Some implementations will boot with the time set to 1901/1/1/0.0
-- When a delay of Delay_For_Time_Past is given, the implementation
-- guarantees that a subsequent call to Ada.Calendar.Time_Of(1901,1,1)
-- will yield a time that has already passed (for example, when used in
-- a delay_until statement).
Delay_For_Time_Past : constant Duration := 0.001;
-- ^^^ --- MODIFY HERE AS NEEDED
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- Minimum time interval between calls to the time dependent Reset
-- procedures in Float_Random and Discrete_Random packages that is
-- guaranteed to initiate different sequences. See RM A.5.2(45).
Time_Dependent_Reset : constant Duration := 0.001;
-- ^^^ --- MODIFY HERE AS NEEDED
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- Test CXA5013 will loop, trying to generate the required sequence
-- of random numbers. If the RNG is faulty, the required sequence
-- will never be generated. Delay_Per_Random_Test is a time-out value
-- which allows the test to run for a period of time after which the
-- test is failed if the required sequence has not been produced.
-- This value should be the time allowed for the test to run before it
-- times out. It should be long enough to allow multiple (independent)
-- runs of the testing code, each generating up to 1000 random
-- numbers.
Delay_Per_Random_Test : constant Duration := 0.001;
-- ^^^ --- MODIFY HERE AS NEEDED
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The time required to execute this procedure must be greater than the
-- time slice unit on implementations which use time slicing. For
-- implementations which do not use time slicing the body can be null.
procedure Exceed_Time_Slice;
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- This constant must not depict a random number generator state value.
-- Using this string in a call to function Value from either the
-- Discrete_Random or Float_Random packages will result in
-- Constraint_Error or Program_Error (expected result in test CXA5012).
-- If there is no such string, set it to "**NONE**".
Non_State_String : constant String := "By No Means A State";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^^^^^^^^^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- This string constant must be a legal external tag value as used by
-- CD10001 for the type Some_Tagged_Type in the representation
-- specification for the value of 'External_Tag.
External_Tag_Value : constant String := "implementation_defined";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^^^^^^^^^^^^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following address constant must be a valid address to locate
-- the C program CD30005_1.
function Cd30005_Proc (X : Integer) return Integer;
pragma Import (C, Cd30005_Proc, "_cd30005_1");
pragma Linker_Options ("ACATS4GNATDIR/support/cd300051.o");
CD30005_1_Foreign_Address : constant System.Address:= Cd30005_Proc'Address;
-- CD30005_1_Foreign_Address : constant System.Address:=
-- System.Storage_Elements.To_Address ( 16#0000_0000# )
-- MODIFY HERE AS REQUIRED --- ^^^^^^^^^^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following string constant must be the external name resulting
-- from the C compilation of CD30005_1. The string will be used as an
-- argument to pragma Import.
CD30005_1_External_Name : constant String := "_cd30005_1";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following constants should represent the largest default alignment
-- value and the largest alignment value supported by the linker.
-- See RM 13.3(35).
Max_Default_Alignment : constant := Standard'Maximum_Alignment;
-- ^ --- MODIFY HERE AS NEEDED
Max_Linker_Alignment : constant := Standard'Maximum_Alignment;
-- ^ --- MODIFY HERE AS NEEDED
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following constant represents the largest amount that a
-- reported Storage_Size will exceed that specified for an access type.
-- This should reflect any rounding up that the implementation may do
-- to a specified Storage_Size. Used in tests CDB0001 and CDB0002.
Maximum_Adjustment_To_Specified_Storage_Size : constant := 1024;
-- MODIFY HERE AS NEEDED ---------^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following string constant should be set to the simple name of a
-- directory that can be created, used, and deleted in the test default
-- directory during the execution of test CXAG001. If execution environment
-- does not support directories, this string should be set to the null
-- string ("").
Directory_To_Create : constant String := "TESTDIR";
-- MODIFY HERE AS NEEDED ----------^^^^^^^
-- The following function returns true if Left and Right file names
-- represent the same file or directory on the target system. It is used
-- by tests CXAG001 and CXAG002.
function Equivalent_File_Names (Left, Right : String) return Boolean;
-- The following string constant should be set to the simple name that is
-- the symbolic representation of the parent directory. For this name,
-- Is_Parent_Directory_Name returns True. If package
-- Ada.Directories.Hierarchical_File_Names is not provided by the
-- implementation, the value of this constant will not be used and thus
-- can be anything.
--
-- The default value is appropriate for most systems including Windows,
-- Unix, Linux, and OSX; it should be rarely necessary to change this value.
Parent_Directory_Name : constant String := "..";
-- MODIFY HERE AS NEEDED ------------^^
-- The following string constant should be set to the simple name that is
-- the symbolic representation of the current directory. For this name,
-- Is_Current_Directory_Name returns True. If package
-- Ada.Directories.Hierarchical_File_Names is not provided by the
-- implementation, the value of this constant will not be used and thus
-- can be anything.
--
-- The default value is appropriate for most systems including Windows,
-- Unix, Linux, and OSX; it should be rarely necessary to change this value.
Current_Directory_Name : constant String := ".";
-- MODIFY HERE AS NEEDED -------------^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following string constant should be set to an environment variable
-- that will exist with a non-empty value during the execution of test
-- CXAH001. This variable will only be read (it will not be modified by
-- the test). If no such variable is available (including if the execution
-- environment does not support environment variables), this string should
-- be set to the null string (""). (The default value should be sufficient
-- for Windows and Linux targets.)
Existing_Environment_Variable_To_Read : constant String := "PATH";
-- MODIFY HERE AS NEEDED ----------^^^^
-- The following string constant should be set to an environment variable
-- that will not exist at the start of the execution of tests CXAH002
-- and CXAH003. (If it does exist, the tests will fail.) This variable will
-- be created, modified, and deleted during the execution of the tests. If
-- no such variable is available (including if the execution environment
-- does not support environment variables), this string should be set to
-- the null string ("").
Unused_Environment_Variable_To_Modify : constant String := "ACATSVAR";
-- MODIFY HERE AS NEEDED ----------^^^^^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following string constants must be the external names resulting
-- from the C compilation of CXB30040.C, CXB30060.C, CXB30130.C,
-- CXB30131.C, CXB30170.C, and CXB30230.C. The strings will be used as
-- arguments to pragma Import.
CXB30040_External_Name : constant String := "CXB30040";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
CXB30060_External_Name : constant String := "CXB30060";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
CXB30130_External_Name : constant String := "CXB30130";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
CXB30131_External_Name : constant String := "CXB30131";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
CXB30170_External_Name : constant String := "CXB30170";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
CXB30230_External_Name : constant String := "CXB30230";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following string constants must be the external names that the
-- C compilation of CXB30170.C will use for the items exported from
-- CXB30171.A. The strings will be used as arguments
-- to pragma Export.
CXB30171_Global_External_Name : constant String := "CXB30171_Global";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^^^^^^^^
CXB30171_Proc_External_Name : constant String := "CXB30171_Ada_Doubler";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^^^^^^^^^^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following string constants must be the external names that result
-- from the C compilation of CXB30180 and CXB30240. The strings will be
-- used as the argument to aspect External_Name.
CXB30180_External_Name : constant String := "CXB30180";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
CXB30240_External_Name : constant String := "CXB30240";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following string constants must be the external names that the
-- C compilation of CXB30180.C will use for the items exported from
-- CXB30181.A. The strings will be used as arguments to aspect
-- External_Name.
CXB30181_Global_External_Name : constant String := "CXB30181_Global";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^^^^^^^^
CXB30181_Proc_External_Name : constant String := "CXB30181_Ada_Doubler";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^^^^^^^^^^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following string constants must be the external names resulting
-- from the COBOL compilation of CXB40090.CBL, CXB40091.CBL, and
-- CXB40092.CBL. The strings will be used as arguments to pragma Import.
CXB40090_External_Name : constant String := "CXB40090";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
CXB40091_External_Name : constant String := "CXB40091";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
CXB40092_External_Name : constant String := "CXB40092";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following string constants must be the external names resulting
-- from the Fortran compilation of CXB50040.FTN, CXB50041.FTN,
-- CXB50050.FTN, and CXB50051.FTN.
--
-- The strings will be used as arguments to pragma Import.
--
-- Note that the use of these four string constants will be split between
-- two tests, CXB5004 and CXB5005.
CXB50040_External_Name : constant String := "CXB50040";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
CXB50041_External_Name : constant String := "CXB50041";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
CXB50050_External_Name : constant String := "CXB50050";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
CXB50051_External_Name : constant String := "CXB50051";
-- MODIFY HERE AS NEEDED --- ^^^^^^^^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following constants have been defined for use with the
-- representation clause in FXACA00 of type Sales_Record_Type.
--
-- Char_Bits should be an integer at least as large as the number
-- of bits needed to hold a character in an array.
-- A value of 6 * Char_Bits will be used in a representation clause
-- to reserve space for a six character string.
--
-- Next_Storage_Slot should indicate the next storage unit in the record
-- representation clause that does not overlap the storage designated for
-- the six character string.
Char_Bits : constant := 8;
-- MODIFY HERE AS NEEDED ---^
Next_Storage_Slot : constant := 6;
-- MODIFY HERE AS NEEDED ---^
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following instance of Integer_IO or Modular_IO must be supplied
-- in order for test CD72A02 to compile correctly.
-- Depending on the choice of base type used for the type
-- System.Storage_Elements.Integer_Address; one of the two instances will
-- be correct. Comment out the incorrect instance.
-- package Address_Value_IO is
-- new Ada.Text_IO.Integer_IO(System.Storage_Elements.Integer_Address);
package Address_Value_IO is
new Ada.Text_IO.Modular_IO(System.Storage_Elements.Integer_Address);
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following constants have been defined for use with various delay
-- statements in the GCC testsuite so that they do not take too long.
One_Second : constant Duration := 0.001;
One_Long_Second : constant Duration := 0.1;
end ImpDef;
--==================================================================--
package body ImpDef is
-- NOTE: These are example bodies. It is expected that implementors
-- will write their own versions of these routines.
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The time required to execute this procedure must be greater than the
-- time slice unit on implementations which use time slicing. For
-- implementations which do not use time slicing the body can be null.
procedure Exceed_Time_Slice is
T : Integer := 0;
Loop_Max : constant Integer := 4_000;
begin
for I in 1..Loop_Max loop
T := Report.Ident_Int (1) * Report.Ident_Int (2);
end loop;
end Exceed_Time_Slice;
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
-- The following function returns true if Left and Right file names
-- represent the same file or directory on the target system.
--
-- For many systems, directly comparing the file names will be sufficient.
-- However, if the target supports alternative forms of file names, a
-- more complex function may be required. For instance, on a case
-- insensitive or case preserving target, the case of the file names
-- may vary without changing the meaning of the file name. In that case,
-- this function should take that into account.
--
-- This does not need to be a perfect file name comparison for the
-- target system; the file names to be compared will come from
-- Ada language-defined packages like Ada.Text_IO (from the Name
-- function) and Ada.Directories, as well as from Report.Legal_File_Name.
-- For instance, on Windows, the Ada runtime will probably use either
-- '/' or '\', but probably not both, so it isn't necessary to implement
-- that equivalence in this function.
function Equivalent_File_Names (Left, Right : String) return Boolean is
begin
return Left = Right;
end Equivalent_File_Names;
--=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====-=====--
end ImpDef;
|