Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c7 / c74305b.ada
blobfa9ae1ea4b24771dcf6867623a6c5a45b23f1823
1 -- C74305B.ADA
3 -- Grant of Unlimited Rights
4 --
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
14 -- to do so.
16 -- DISCLAIMER
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.
24 --*
25 -- CHECK THAT A DEFERRED CONSTANT CAN BE USED AS A DEFAULT
26 -- INITIALIZATION FOR A PARAMETER OR AS A DEFAULT INITIA-
27 -- LIZATION FOR A COMPONENT (GENERIC CASE).
29 -- EG 12/20/83
31 WITH REPORT;
33 PROCEDURE C74305B IS
35 USE REPORT;
37 PACKAGE PK IS
38 TYPE TD IS PRIVATE;
39 CD : CONSTANT TD;
40 DD : CONSTANT TD;
42 GENERIC
43 TYPE T1 IS PRIVATE;
44 C1 : T1;
45 WITH PROCEDURE P2 (A1 : T1 := C1; A2 : TD := CD);
46 PROCEDURE P1 (A1 : TD := CD);
48 PRIVATE
49 TYPE TD IS NEW INTEGER;
50 CD : CONSTANT TD := 2;
51 DD : CONSTANT TD := 3;
52 END PK;
54 USE PK;
56 PACKAGE BODY PK IS
58 PROCEDURE P1 (A1 : TD := CD) IS
59 BEGIN
60 IF ( A1 /= 2 ) THEN
61 FAILED ("WRONG ACTUAL PARAMETER RECEIVED (1)");
62 END IF;
63 P2;
64 END P1;
66 PROCEDURE P3 (X : TD := DD; Y : TD := DD) IS
67 BEGIN
68 IF ( X /= 2 ) THEN
69 FAILED ("WRONG ACTUAL PARAMETER RECEIVED (2)");
70 END IF;
71 IF ( Y /= 2 ) THEN
72 FAILED ("WRONG ACTUAL PARAMETER RECEIVED (3)");
73 END IF;
74 END P3;
76 PROCEDURE P4 IS NEW P1 (TD,CD,P3);
78 BEGIN
79 TEST ("C74305B","CHECK THAT A DEFERRED CONSTANT CAN BE " &
80 "USED AS A DEFAULT INITIALIZATION FOR A " &
81 "PARAMETER OR AS A DEFAULT INITIALIZATION " &
82 "FOR A COMPONENT (GENERIC CASE)");
83 P4;
84 END PK;
86 PROCEDURE P5 (X : TD := DD; Y : TD := DD) IS
87 BEGIN
88 IF ( X /= CD ) THEN
89 FAILED ("WRONG ACTUAL PARAMETER RECEIVED (4)");
90 END IF;
91 IF ( Y /= CD ) THEN
92 FAILED ("WRONG ACTUAL PARAMETER RECEIVED (5)");
93 END IF;
94 END P5;
96 PROCEDURE P6 IS NEW P1 (TD,CD,P5);
98 BEGIN
99 P6;
100 RESULT;
101 END C74305B;