1-- C64104L.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, NAMELY WHEN THE 27-- 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-- (I) AFTER RETURN, OUT MODE, CONSTRAINED FORMAL, STATIC 33-- PRIVATE DISCRIMINANTS. 34 35-- JRK 3/18/81 36-- NL 10/13/81 37-- SPS 10/26/82 38 39WITH REPORT; 40PROCEDURE C64104L IS 41 42 USE REPORT; 43 44BEGIN 45 TEST ("C64104L", "CHECK THAT CONSTRAINT_ERROR IS RAISED " & 46 "APPROPRIATELY FOR ACCESS PARAMETERS"); 47 48 -------------------------------------------------- 49 50 DECLARE 51 52 PACKAGE PKG IS 53 TYPE E IS (E1, E2, E3); 54 TYPE T (D : E := E1; B : BOOLEAN := FALSE) IS 55 PRIVATE; 56 PRIVATE 57 TYPE ARR IS ARRAY (E RANGE <>) OF INTEGER; 58 TYPE T (D : E := E1; B : BOOLEAN := FALSE) IS 59 RECORD 60 I : INTEGER; 61 CASE B IS 62 WHEN FALSE => 63 J : INTEGER; 64 WHEN TRUE => 65 A : ARR (E1 .. D); 66 END CASE; 67 END RECORD; 68 END PKG; 69 USE PKG; 70 71 TYPE A IS ACCESS T; 72 SUBTYPE SA IS A(E2, TRUE); 73 V : A (E2, FALSE) := NEW T (E2, FALSE); 74 75 ENTERED : BOOLEAN := FALSE; 76 77 PROCEDURE P (X : OUT SA ) IS 78 BEGIN 79 ENTERED := TRUE; 80 X := NEW T (E2, TRUE); 81 EXCEPTION 82 WHEN OTHERS => 83 FAILED ("EXCEPTION RAISED IN PROCEDURE"); 84 END P; 85 86 BEGIN 87 88 P (V); 89 FAILED ("EXCEPTION NOT RAISED AFTER RETURN"); 90 91 EXCEPTION 92 WHEN CONSTRAINT_ERROR => 93 IF NOT ENTERED THEN 94 FAILED ("CONSTRAINT_ERROR RAISED BEFORE " & 95 "CALL"); 96 END IF; 97 WHEN OTHERS => 98 IF NOT ENTERED THEN 99 FAILED ("OTHER EXCEPTION RAISED BEFORE CALL"); 100 ELSE FAILED ("WRONG EXCEPTION RAISED AFTER " & 101 "RETURN"); 102 END IF; 103 END; 104 105 ------------------------------------------------ 106 107 RESULT; 108 109END C64104L; 110