1-- C64105A.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 CONSTRAINT_ERROR IS NOT RAISED AT THE TIME OF CALL WHEN
26--   THE VALUE OF AN ACTUAL OUT SCALAR PARAMETER DOES NOT SATISFY THE
27--   RANGE CONSTRAINTS OF THE FORMAL PARAMETER.
28
29-- DAS  1/29/81
30-- CPP  8/6/84
31
32WITH REPORT;
33PROCEDURE C64105A IS
34
35     USE REPORT;
36
37     SUBTYPE SUBINT1 IS INTEGER RANGE -10..10;
38     SUBTYPE SUBINT2 IS INTEGER RANGE -20..20;
39
40     I10  : SUBINT1 := 10;
41     I20  : SUBINT2 := 20;
42
43     PROCEDURE P1 (I : OUT SUBINT1) IS
44     BEGIN
45          I := SUBINT1'FIRST;
46     EXCEPTION
47          WHEN OTHERS =>
48               FAILED ("EXCEPTION RAISED IN PROCEDURE P1");
49     END P1;
50
51BEGIN
52
53     TEST ("C64105A", "CHECK THAT CONSTRAINT_ERROR IS NOT RAISED" &
54                      " AT THE TIME OF CALL WHEN THE VALUE OF AN" &
55                      " ACTUAL OUT SCALAR PARAMETER DOES NOT" &
56                      " SATISFY THE RANGE CONSTRAINTS OF THE FORMAL" &
57                      " PARAMETER");
58
59     DECLARE
60     BEGIN
61          P1 (SUBINT1(I20));
62          IF I20 /= IDENT_INT(-10) THEN
63               FAILED ("OUT PARAM DID NOT GET CORRECT VALUE - 1");
64          END IF;
65     EXCEPTION
66          WHEN OTHERS =>
67               FAILED ("EXCEPTION RAISED ON CALL TO P1 - 1");
68     END;
69
70     DECLARE
71     BEGIN
72          I20 := IDENT_INT(20);
73          P1 (I20);
74          IF I20 /= IDENT_INT(-10) THEN
75               FAILED ("OUT PARAM DID NOT GET CORRECT VALUE - 2");
76          END IF;
77     EXCEPTION
78          WHEN OTHERS =>
79               FAILED ("EXCEPTION RAISED ON CALL TO P1 - 2");
80     END;
81
82     RESULT;
83
84END C64105A;
85