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/] [c48009d.ada] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
-- C48009D.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 AN UNCONSTRAINED ARRAY TYPE WITH INDEX SUBTYPE(S)
27
-- S,
28
--   1) X HAS TOO MANY VALUES FOR S;
29
--   2) A NAMED NON-NULL BOUND OF X LIES OUTSIDE S'S RANGE;
30
--   3) THE BOUND'S OF X ARE NOT EQUAL TO BOUNDS SPECIFIED FOR THE
31
--      ALLOCATOR'S DESIGNATED BASE TYPE. (THEY ARE EQUAL TO THE BOUNDS
32
--      SPECIFIED FOR T).
33
 
34
-- RM  01/08/80
35
-- NL  10/13/81
36
-- SPS 10/26/82
37
-- JBG 03/03/83
38
-- EG  07/05/84
39
-- PWN 11/30/94 REMOVED TEST ILLEGAL IN ADA 9X.
40
-- KAS 11/14/95 FOR SLIDING ASSIGNMENT, CHANGED FAIL TO COMMENT ON LANGUAGE
41
-- KAS 12/02/95 INCLUDED SECOND CASE
42
-- PWN 05/03/96 Enforced Ada 95 sliding rules
43
 
44
WITH REPORT;
45
 
46
PROCEDURE  C48009D  IS
47
 
48
     USE REPORT ;
49
 
50
BEGIN
51
 
52
     TEST("C48009D","FOR ALLOCATORS OF THE FORM 'NEW T'(X)', CHECK " &
53
                    "THAT CONSTRAINT_ERROR IS RAISED WHEN "          &
54
                    "APPROPRIATE - UNCONSTRAINED ARRAY TYPES");
55
     DECLARE
56
 
57
          SUBTYPE TWO  IS INTEGER RANGE 1 .. 2;
58
          SUBTYPE TWON IS INTEGER RANGE IDENT_INT(1) .. IDENT_INT(2);
59
          TYPE UA  IS ARRAY(INTEGER RANGE <>) OF INTEGER;
60
          TYPE TD  IS ARRAY(TWO  RANGE <>) OF INTEGER RANGE 1 .. 7;
61
          TYPE TDN IS ARRAY(TWON RANGE <>) OF INTEGER RANGE 1 .. 7;
62
          TYPE ATD  IS ACCESS TD;
63
          TYPE ATDN IS ACCESS TDN;
64
          TYPE A_UA IS ACCESS UA;
65
          TYPE A_CA IS ACCESS UA(3 .. 4);
66
          TYPE A_CAN IS ACCESS UA(4 .. 3);
67
          VD  : ATD;
68
          VDN : ATDN;
69
          V_A_CA : A_CA;
70
          V_A_CAN : A_CAN;
71
 
72
     BEGIN
73
 
74
          BEGIN
75
               VD := NEW TD'(3, 4, 5);
76
               FAILED ("NO EXCEPTION RAISED - CASE 1A");
77
          EXCEPTION
78
               WHEN CONSTRAINT_ERROR =>
79
                    NULL;
80
               WHEN OTHERS =>
81
                    FAILED ("WRONG EXCEPTION RAISED - CASE 1A");
82
          END;
83
 
84
          BEGIN
85
               VDN := NEW TDN'(3, 4, 5);
86
               FAILED ("NO EXCEPTION RAISED - CASE 1B");
87
          EXCEPTION
88
               WHEN CONSTRAINT_ERROR =>
89
                    NULL;
90
               WHEN OTHERS =>
91
                    FAILED ("WRONG EXCEPTION RAISED - CASE 1B");
92
          END;
93
 
94
          BEGIN
95
               VD := NEW TD'(IDENT_INT(0) .. 2 => 6);
96
               FAILED ("NO EXCEPTION RAISED - CASE 2");
97
          EXCEPTION
98
               WHEN CONSTRAINT_ERROR =>
99
                    NULL;
100
               WHEN OTHERS =>
101
                    FAILED ("WRONG EXCEPTION RAISED - CASE 2");
102
          END;
103
 
104
          BEGIN
105
               V_A_CA := NEW UA'(2 .. 3 => 3);
106
               COMMENT ("ADA 95 SLIDING ASSIGNMENT - CASE 3A");
107
          EXCEPTION
108
               WHEN CONSTRAINT_ERROR =>
109
                    FAILED ("ADA 83 NON SLIDING ASSIGNMENT - CASE 3A");
110
               WHEN OTHERS =>
111
                    FAILED ("WRONG EXCEPTION RAISED - CASE 3A");
112
          END;
113
 
114
          BEGIN
115
               V_A_CAN := NEW UA'(IDENT_INT(3) .. IDENT_INT(2) => 3);
116
               COMMENT ("ADA 95 SLIDING ASSIGNMENT - CASE 3B");
117
          EXCEPTION
118
               WHEN CONSTRAINT_ERROR =>
119
                    FAILED ("ADA 83 NON SLIDING ASSIGNMENT - CASE 3B");
120
               WHEN OTHERS =>
121
                    FAILED ("WRONG EXCEPTION RAISED - CASE 3B");
122
          END;
123
 
124
     END;
125
 
126
     RESULT;
127
 
128
END C48009D;

powered by: WebSVN 2.1.0

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