1-- C87B06A.ADA
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 OVERLOADING RESOLUTION USES THE RULE THAT:
27--
28--     FOR EACH INTEGER TYPE, THERE EXISTS AN IMPLICIT CONVERSION THAT
29--     CONVERTS A UNIVERSAL INTEGER VALUE INTO THE CORRESPONDING VALUE
30--     OF THE INTEGER TYPE. THIS TEST USES LITERALS AS UNIVERSAL INTEGER
31--     VALUES.
32
33-- HISTORY:
34--     TRH 08/11/82 CREATED ORIGINAL TEST.
35--     DHH 10/20/87 SHORTENED LINES CONTAINING MORE THAN 72 CHARACTERS.
36
37WITH REPORT; USE REPORT;
38
39PROCEDURE C87B06A IS
40
41     TYPE MINOR IS NEW INTEGER RANGE 0 .. 17;
42     TYPE FIXED IS NEW DURATION;
43     TYPE REAL  IS NEW FLOAT;
44
45     ERR : BOOLEAN := FALSE;
46
47     PROCEDURE P (X : BOOLEAN) IS
48     BEGIN
49          ERR := TRUE;
50     END P;
51     PROCEDURE P (X : FIXED) IS
52     BEGIN
53          ERR := TRUE;
54     END P;
55
56     PROCEDURE P (X : REAL) IS
57     BEGIN
58          ERR := TRUE;
59     END P;
60
61     PROCEDURE P (X : FLOAT) IS
62     BEGIN
63          ERR := TRUE;
64     END P;
65
66     PROCEDURE P (X : STRING) IS
67     BEGIN
68          ERR := TRUE;
69     END P;
70
71     PROCEDURE P (X : MINOR) IS
72     BEGIN
73          NULL;
74     END P;
75
76BEGIN
77     TEST("C87B06A","OVERLOADING RESOLUTION WITH IMPLICIT CONVERSION " &
78          "OF UNIVERSAL INTEGER VALUES TO INTEGER VALUES. " &
79          "CONVERSIONS TO INTEGER VALUES EXISTS FOR ANY INTEGER TYPE");
80
81     P (2);
82     P (2 * 2 + 2);
83
84     IF ERR THEN
85          FAILED("INCORRECT IMPLICIT CONVERSION FROM UNIVERSAL " &
86                 " INTEGER VALUES TO INTEGER TYPE VALUES");
87     END IF;
88
89     RESULT;
90END C87B06A;
91