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/] [c4/] [c48009c.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C48009C.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
-- FOR ALLOCATORS OF THE FORM "NEW T'(X)", CHECK THAT CONSTRAINT_ERROR
26
-- IS RAISED IF T IS A CONSTRAINED RECORD OR PRIVATE TYPE, (X) IS AN
27
-- AGGREGATE OR A VALUE OF TYPE T, AND ONE OF THE DISCRIMINANT VALUES IN
28
-- X:
29
--   1) DOES NOT EQUAL THE CORRESPONDING DISCRIMINANT VALUE FOR T.
30
--   2) DOES NOT EQUAL THE CORRESPONDING DISCRIMINANT VALUE SPECIFIED
31
--      IN THE DECLARATION OF THE ALLOCATOR'S BASE TYPE.
32
--   3) DOES NOT EQUAL THE CORRESPONDING DISCRIMINANT VALUE IN THE
33
--      ACCESS TO ACCESS CASE.
34
 
35
-- RM  01/08/80
36
-- NL  10/13/81
37
-- SPS 10/26/82
38
-- EG  07/05/84
39
 
40
WITH REPORT;
41
 
42
PROCEDURE C48009C IS
43
 
44
     USE REPORT;
45
 
46
BEGIN
47
 
48
     TEST("C48009C","FOR ALLOCATORS OF THE FORM 'NEW T'(X)', CHECK " &
49
                    "THAT CONSTRAINT_ERROR IS RAISED WHEN "          &
50
                    "APPROPRIATE - CONSTRAINED RECORD TYPES");
51
 
52
     DECLARE
53
 
54
          TYPE TC0(A, B : INTEGER) IS
55
               RECORD
56
                    C : INTEGER RANGE 1 .. 7;
57
               END RECORD;
58
          SUBTYPE TC IS TC0(2, 3);
59
          TYPE ATC IS ACCESS TC0(2, 3);
60
          SUBTYPE TC4_5 IS TC0(IDENT_INT(4), IDENT_INT(5));
61
          VC : ATC;
62
 
63
     BEGIN
64
 
65
          BEGIN
66
               VC := NEW TC'(102, 3, 4);
67
               FAILED ("NO EXCEPTION RAISED - CASE 1");
68
          EXCEPTION
69
               WHEN CONSTRAINT_ERROR => NULL;
70
               WHEN OTHERS           =>
71
                    FAILED("WRONG EXCEPTION RAISED - CASE 1");
72
          END;
73
 
74
          BEGIN
75
               VC := NEW TC4_5'(IDENT_INT(4), IDENT_INT(5), 1);
76
               FAILED ("NO EXCEPTION RAISED - CASE 2");
77
          EXCEPTION
78
               WHEN CONSTRAINT_ERROR => NULL;
79
               WHEN OTHERS           =>
80
                    FAILED("WRONG EXCEPTION RAISED - CASE 2");
81
          END;
82
 
83
     END;
84
 
85
     DECLARE
86
 
87
          TYPE UR(A : INTEGER) IS
88
               RECORD
89
                    NULL;
90
               END RECORD;
91
          TYPE A_UR IS ACCESS UR;
92
          SUBTYPE CA_UR IS A_UR(2);
93
          TYPE A_CA_UR IS ACCESS CA_UR;
94
 
95
          V : A_CA_UR;
96
 
97
     BEGIN
98
 
99
          V := NEW CA_UR'(NEW UR'(A => IDENT_INT(3)));
100
          FAILED ("NO EXCEPTION RAISED - CASE 3");
101
 
102
     EXCEPTION
103
 
104
          WHEN CONSTRAINT_ERROR =>
105
               NULL;
106
          WHEN OTHERS =>
107
               FAILED ("WRONG EXCEPTION RAISED - CASE 3");
108
 
109
     END;
110
 
111
     RESULT;
112
 
113
END C48009C;

powered by: WebSVN 2.1.0

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