1-- C95085I.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 RAISED UNDER THE APPROPRIATE
26-- CIRCUMSTANCES FOR ACCESS PARAMETERS IN ENTRY CALLS, NAMELY WHEN
27-- THE ACTUAL INDEX BOUNDS OR DISCRIMINANTS ARE NOT EQUAL
28-- TO THE FORMAL CONSTRAINTS BEFORE THE CALL (FOR IN AND IN OUT
29-- MODES), AND WHEN THE FORMAL CONSTRAINTS ARE NOT EQUAL TO THE
30-- ACTUAL CONSTRAINTS UPON RETURN (FOR IN OUT AND OUT MODES).
31
32--       (F) AFTER RETURN, IN OUT MODE, DYNAMIC THREE DIMENSIONAL
33--           BOUNDS.
34
35-- JWC 10/23/85
36
37WITH REPORT; USE REPORT;
38PROCEDURE C95085I IS
39
40BEGIN
41     TEST ("C95085I", "CHECK THAT CONSTRAINT_ERROR IS RAISED " &
42                      "APPROPRIATELY FOR ACCESS PARAMETERS");
43
44     --------------------------------------------------
45
46     DECLARE
47
48          CALLED : BOOLEAN := FALSE;
49
50          TYPE E IS (E1, E2, E3);
51
52          TYPE T IS ARRAY (CHARACTER RANGE <>,
53                           E RANGE <>,
54                           BOOLEAN RANGE <>
55                          ) OF INTEGER;
56
57          TYPE A IS ACCESS T;
58
59          V : A ('A'..'Z', E1..E2, BOOLEAN) :=
60                    NEW T ('A'..'Z', E1..E2, BOOLEAN);
61
62          TASK TSK IS
63               ENTRY E (X : IN OUT A);
64          END TSK;
65
66          TASK BODY TSK IS
67          BEGIN
68               SELECT
69                    ACCEPT E (X : IN OUT A) DO
70                         CALLED := TRUE;
71                         IF EQUAL (3,3) THEN
72                              X := NEW T ('A'..'Z', E2..E3, BOOLEAN);
73                         END IF;
74                    END E;
75               OR
76                    TERMINATE;
77               END SELECT;
78          EXCEPTION
79               WHEN OTHERS =>
80                    FAILED ("EXCEPTION RAISED IN TASK BODY");
81          END TSK;
82
83     BEGIN
84
85          TSK.E (V);
86          FAILED ("EXCEPTION NOT RAISED AFTER RETURN");
87
88     EXCEPTION
89          WHEN CONSTRAINT_ERROR =>
90               IF NOT CALLED THEN
91                    FAILED ("EXCEPTION RAISED BEFORE CALL");
92               END IF;
93          WHEN OTHERS =>
94               FAILED ("WRONG EXCEPTION RAISED");
95     END;
96
97     --------------------------------------------------
98
99     RESULT;
100END C95085I;
101