OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c6/] [c64105d.ada] - Blame information for rev 309

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C64105D.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 FOR ACCESS PARAMETERS
26
--   IN THE FOLLOWING CIRCUMSTANCES:
27
--       (1)
28
--       (2)
29
--       (3) BEFORE OR AFTER THE CALL, WHEN AN UNCONSTRAINED ACTUAL 
30
--           OUT ACCESS PARAMETER DESIGNATES AN OBJECT (PRIOR TO THE
31
--           CALL) WITH CONSTRAINTS DIFFERENT FROM THE FORMAL
32
--           PARAMETER.
33
--   SUBTESTS ARE:
34
--       (G) CASE 3, STATIC LIMITED PRIVATE DISCRIMINANT.
35
--       (H) CASE 3, DYNAMIC ONE DIMENSIONAL BOUNDS.
36
 
37
-- JRK 3/20/81
38
-- SPS 10/26/82
39
 
40
WITH REPORT;
41
PROCEDURE C64105D IS
42
 
43
     USE REPORT;
44
 
45
BEGIN
46
     TEST ("C64105D", "CHECK THAT CONSTRAINT_ERROR IS NOT RAISED " &
47
           "BEFORE AND AFTER THE CALL, WHEN AN UNCONSTRAINED ACTUAL " &
48
           "OUT ACCESS PARAMETER DESIGNATES AN OBJECT (PRIOR TO THE " &
49
           "CALL) WITH CONSTRAINTS DIFFERENT FROM THE FORMAL " &
50
           "PARAMETER" );
51
 
52
     --------------------------------------------------
53
 
54
     DECLARE -- (G)
55
 
56
          PACKAGE PKG IS
57
               SUBTYPE INT IS INTEGER RANGE 0..5;
58
               TYPE T (I : INT := 0) IS LIMITED PRIVATE;
59
          PRIVATE
60
               TYPE ARR IS ARRAY (INTEGER RANGE <>) OF INTEGER;
61
               TYPE T (I : INT := 0) IS
62
                    RECORD
63
                         J : INTEGER;
64
                         A : ARR (1..I);
65
                    END RECORD;
66
          END PKG;
67
          USE PKG;
68
 
69
          TYPE A IS ACCESS T;
70
          SUBTYPE SA IS A(3);
71
          V : A := NEW T (2);
72
          CALLED : BOOLEAN := FALSE;
73
 
74
          PROCEDURE P (X : OUT SA) IS
75
          BEGIN
76
               CALLED := TRUE;
77
               X := NEW T (3);
78
          EXCEPTION
79
               WHEN OTHERS =>
80
                    FAILED ("EXCEPTION RAISED IN PROCEDURE - (G)");
81
          END P;
82
 
83
     BEGIN -- (G)
84
 
85
          P (V);
86
 
87
     EXCEPTION
88
          WHEN CONSTRAINT_ERROR =>
89
               IF NOT CALLED THEN
90
                    FAILED ("EXCEPTION RAISED BEFORE CALL - (G)");
91
               ELSE
92
                    FAILED ("EXCEPTION RAISED ON RETURN - (G)");
93
               END IF;
94
          WHEN OTHERS =>
95
               FAILED ("EXCEPTION RAISED - (G)");
96
     END; -- (G)
97
 
98
     --------------------------------------------------
99
 
100
     DECLARE -- (H)
101
 
102
          TYPE A IS ACCESS STRING;
103
          SUBTYPE SA IS A (1..2);
104
          V : A := NEW STRING (IDENT_INT(5) .. IDENT_INT(7));
105
          CALLED : BOOLEAN := FALSE;
106
 
107
          PROCEDURE P (X : OUT SA) IS
108
          BEGIN
109
               CALLED := TRUE;
110
               X := NEW STRING (IDENT_INT(1) .. IDENT_INT(2));
111
          EXCEPTION
112
               WHEN OTHERS =>
113
                    FAILED ("EXCEPTION RAISED IN PROCEDURE - (H)");
114
          END P;
115
 
116
     BEGIN -- (H)
117
 
118
          P (V);
119
 
120
     EXCEPTION
121
          WHEN CONSTRAINT_ERROR =>
122
               IF NOT CALLED THEN
123
                    FAILED ("EXCEPTION RAISED BEFORE CALL - (H)");
124
               ELSE
125
                    FAILED ("EXCEPTION RAISED ON RETURN - (H)");
126
               END IF;
127
          WHEN OTHERS =>
128
               FAILED ("EXCEPTION RAISED - (H)");
129
     END; -- (H)
130
 
131
     --------------------------------------------------
132
 
133
     RESULT;
134
END C64105D;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.