1-- CA140283.AM
2--
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.
15--
16--                                    DISCLAIMER
17--
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-- OBJECTIVE:
26--     Check that when a subprogram body is compiled as a library unit
27--     it is not interpreted as a completion for any previous library
28--     subprogram created by generic instantiation, and it therefore
29--     declares a new library subprogram.
30--
31-- TEST DESCRIPTION
32--     A generic function and procedure plus their instantiations are
33--     created. Then, subprogram bodies which ought to replace the
34--     instantiations are compiled. Following that, additional instantiations
35--     are compiled. Finally the main subprogram is compiled.
36--
37-- TEST FILES:
38--      This test consists of the following files:
39--         CA140280.A
40--         CA140281.A
41--         CA140282.A
42--      -> CA140283.AM
43--
44-- CHANGE HISTORY:
45--     JBG 05/28/85  CREATED ORIGINAL TEST.
46--     RDH 04/18/90  ADDED CASES WHERE SUBPROGRAM PARAMETER TYPES ARE
47--                   NOT THE SAME.
48--     THS 09/24/90  REWORDED HEADER COMMENTS, ERROR MESSAGES, AND
49--                   CALL TO TEST. CALLED IDENT_INT CONSISTENTLY.
50--     RLB 07/08/99  Reinstated withdrawn test; revised to Ada 95 format.
51
52WITH REPORT; USE REPORT;
53WITH CA14028_PROC1, CA14028_FUNC2, CA14028_PROC5, CA14028_FUNC22,
54     CA14028_PROC3, CA14028_FUNC3;
55PROCEDURE CA140283 IS
56     TEMP : INTEGER := 0;
57BEGIN
58     TEST ("CA14028", "Check that library subprograms created by " &
59                      "generic instantiation are replaced " &
60                      "when new non-generic subprogram bodies are " &
61                      "compiled");
62
63     CA14028_PROC1(TEMP);
64     IF TEMP /= IDENT_INT(3) THEN
65          FAILED ("CA14028_Proc1 instantiation not replaced");
66     END IF;
67
68     IF CA14028_FUNC2 /= IDENT_INT(4) THEN
69          FAILED ("CA14028_Func2 instantiation not replaced");
70     END IF;
71
72     CA14028_PROC5(TEMP);
73     IF TEMP /= IDENT_INT(5) THEN
74          FAILED ("New CA14028_Proc5 instantiation not correct");
75     END IF;
76
77     IF CA14028_FUNC22 /= IDENT_INT(2) THEN
78          FAILED ("New CA14028_Func22 instantiation not correct");
79     END IF;
80
81     CA14028_PROC3(TEMP);
82     IF TEMP /= IDENT_INT(4) THEN
83          FAILED ("CA14028_Proc3 not replaced by correct version");
84     END IF;
85
86     IF CA14028_FUNC3 /= IDENT_INT(7) THEN
87          FAILED ("CA14028_Func3 not replaced by correct version");
88     END IF;
89
90     RESULT;
91END CA140283;
92