1-- C87B04A.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-- CHECK THAT OVERLOADING RESOLUTION USES THE RULE THAT:
26--
27-- IN A RANGE CONSTRAINT OF A SUBTYPE INDICATION, THE EXPRESSIONS
28-- FOR THE LOWER AND UPPER BOUNDS MUST BE COMPATIBLE WITH THE SUBTYPE'S
29-- EXPLICIT TYPEMARK.
30
31-- TRH  28 JUNE 82
32-- JBG 3/8/84
33
34WITH REPORT; USE REPORT;
35PROCEDURE C87B04A IS
36
37     TYPE AGE    IS NEW INTEGER RANGE 1 .. 120;
38     TYPE BASE10 IS NEW INTEGER RANGE 0 .. 9;
39
40     FUNCTION F1 RETURN AGE IS
41     BEGIN
42          RETURN 18;
43     END F1;
44
45     FUNCTION F1 RETURN INTEGER IS
46     BEGIN
47          FAILED ("RESOLUTION INCORRECT - RANGE CONSTRAINT OF " &
48                  "SUBTYPE INDICATION");
49          RETURN 0;
50     END F1;
51
52     FUNCTION "+" (X : INTEGER) RETURN BASE10 IS
53     BEGIN
54          RETURN 1;
55     END "+";
56
57     FUNCTION "+" (X : INTEGER) RETURN INTEGER IS
58     BEGIN
59          FAILED ("RESOLUTION INCORRECT - RANGE CONSTRAINT OF " &
60                  "SUBTYPE INDICATION");
61          RETURN -X;
62     END "+";
63
64BEGIN
65     TEST ("C87B04A","OVERLOADED EXPRESSIONS IN RANGE CONTRAINTS" &
66           " OF SUBTYPE INDICATIONS");
67
68     DECLARE
69          SUBTYPE MINOR IS AGE RANGE 1 .. F1;
70
71     BEGIN
72          FOR I IN BASE10 RANGE +(INTEGER'(0)) .. 0 LOOP
73               FAILED ("RESOLUTION INCORRECT - SUBTYPE INDICATION " &
74                       " IN LOOP CONSTRUCT");
75          END LOOP;
76     END;
77
78     RESULT;
79END C87B04A;
80