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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c4/] [c46053a.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C46053A.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 FOR CONVERSION TO A 
26
-- CONSTRAINED RECORD, PRIVATE, OR LIMITED PRIVATE SUBTYPE IF THE 
27
-- DISCRIMINANTS OF THE TARGET SUBTYPE DO NOT EQUAL THOSE OF THE 
28
-- OPERAND.
29
 
30
-- R.WILLIAMS 9/9/86
31
 
32
WITH REPORT; USE REPORT;
33
PROCEDURE C46053A IS
34
 
35
BEGIN
36
     TEST ( "C46053A", "CHECK THAT CONSTRAINT_ERROR IS RAISED FOR " &
37
                       "CONVERSION TO A CONSTRAINED RECORD, " &
38
                       "PRIVATE, OR LIMITED PRIVATE SUBTYPE IF " &
39
                       "THE DISCRIMINANTS OF THE TARGET SUBTYPE DO " &
40
                       "NOT EQUAL THOSE OF THE OPERAND" );
41
 
42
     DECLARE
43
          TYPE REC (D : INTEGER) IS
44
               RECORD
45
                    NULL;
46
               END RECORD;
47
 
48
          SUBTYPE REC3 IS REC (IDENT_INT (3));
49
          R : REC (IDENT_INT (1));
50
 
51
          PROCEDURE PROC (R : REC) IS
52
               I : INTEGER;
53
          BEGIN
54
               I := IDENT_INT (R.D);
55
          END PROC;
56
 
57
     BEGIN
58
          PROC (REC3 (R));
59
          FAILED ( "NO EXCEPTION RAISED FOR 'REC3 (R)'" );
60
     EXCEPTION
61
          WHEN CONSTRAINT_ERROR =>
62
               NULL;
63
          WHEN OTHERS =>
64
               FAILED ( "WRONG EXCEPTION RAISED FOR 'REC3 (R)'" );
65
     END;
66
 
67
     DECLARE
68
          PACKAGE PKG1 IS
69
               TYPE PRIV (D : INTEGER) IS PRIVATE;
70
               SUBTYPE PRIV3 IS PRIV (IDENT_INT (3));
71
          PRIVATE
72
               TYPE PRIV  (D : INTEGER) IS
73
                    RECORD
74
                         NULL;
75
                    END RECORD;
76
          END PKG1;
77
 
78
          USE PKG1;
79
 
80
          PACKAGE PKG2 IS
81
               P : PRIV (IDENT_INT (0));
82
          END PKG2;
83
 
84
          USE PKG2;
85
 
86
          PROCEDURE PROC (P : PRIV) IS
87
               I : INTEGER;
88
          BEGIN
89
               I := IDENT_INT (P.D);
90
          END PROC;
91
 
92
     BEGIN
93
          PROC (PRIV3 (P));
94
          FAILED ( "NO EXCEPTION RAISED FOR 'PRIV3 (P)'" );
95
     EXCEPTION
96
          WHEN CONSTRAINT_ERROR =>
97
               NULL;
98
          WHEN OTHERS =>
99
               FAILED ( "WRONG EXCEPTION RAISED FOR 'PRIV3 (P)'" );
100
     END;
101
 
102
     DECLARE
103
          PACKAGE PKG1 IS
104
               TYPE LIM (D : INTEGER) IS LIMITED PRIVATE;
105
               SUBTYPE LIM3 IS LIM (IDENT_INT (3));
106
          PRIVATE
107
               TYPE LIM  (D : INTEGER) IS
108
                    RECORD
109
                         NULL;
110
                    END RECORD;
111
          END PKG1;
112
 
113
          USE PKG1;
114
 
115
          PACKAGE PKG2 IS
116
               L : LIM (IDENT_INT (0));
117
               I : INTEGER;
118
          END PKG2;
119
 
120
          USE PKG2;
121
 
122
          PROCEDURE PROC (L : LIM) IS
123
               I : INTEGER;
124
          BEGIN
125
               I := IDENT_INT (L.D);
126
          END PROC;
127
 
128
     BEGIN
129
          PROC (LIM3 (L));
130
          FAILED ( "NO EXCEPTION RAISED FOR 'LIM3 (L)'" );
131
     EXCEPTION
132
          WHEN CONSTRAINT_ERROR =>
133
               NULL;
134
          WHEN OTHERS =>
135
               FAILED ( "WRONG EXCEPTION RAISED FOR 'LIM3 (L)'" );
136
     END;
137
 
138
     RESULT;
139
END C46053A;

powered by: WebSVN 2.1.0

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