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

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

Line No. Rev Author Line
1 294 jeremybenn
-- C43205J.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 THE BOUNDS OF A POSITIONAL AGGREGATE ARE DETERMINED
26
-- CORRECTLY. IN PARTICULAR, CHECK THAT THE LOWER BOUND IS GIVEN BY
27
-- THE LOWER BOUND OF THE APPLICABLE INDEX CONSTRAINT WHEN THE
28
-- POSITIONAL AGGREGATE IS USED AS:
29
 
30
--   J) THE INITIALIZATION EXPRESSION OF A CONSTANT, VARIABLE, OR FORMAL
31
--      PARAMETER (OF A SUBPROGRAM, ENTRY, OR GENERIC UNIT) WHEN THE
32
--      TYPE OF THE CONSTANT, VARIABLE, OR PARAMETER IS CONSTRAINED.
33
 
34
-- EG  01/27/84
35
 
36
WITH REPORT;
37
 
38
PROCEDURE C43205J IS
39
 
40
     USE REPORT;
41
 
42
BEGIN
43
 
44
     TEST("C43205J", "CASE J : INITIALIZATION OF CONSTRAINED " &
45
                     "ARRAY");
46
 
47
     BEGIN
48
 
49
CASE_J :  BEGIN
50
 
51
     CASE_J1 : DECLARE
52
 
53
                    TYPE TD1 IS ARRAY (IDENT_INT(11) .. 13) OF INTEGER;
54
 
55
                    D1 : CONSTANT TD1 := (-1, -2, -3);
56
 
57
               BEGIN
58
 
59
                    IF D1'FIRST /= 11 THEN
60
                         FAILED ("CASE J1 : LOWER BOUND INCORRECT");
61
                    ELSIF D1'LAST /= 13 THEN
62
                         FAILED ("CASE J1 : UPPER BOUND INCORRECT");
63
                    ELSIF D1 /= (-1, -2, -3) THEN
64
                              FAILED ("CASE J1 : ARRAY DOES NOT " &
65
                                      "CONTAINING THE CORRECT VALUES");
66
                    END IF;
67
 
68
               END CASE_J1;
69
 
70
     CASE_J2 : DECLARE
71
 
72
                    TYPE TD2 IS ARRAY(INTEGER RANGE -13 .. -11)
73
                                                            OF INTEGER;
74
                    D2 : TD2 := (3, 2, 1);
75
 
76
               BEGIN
77
 
78
                    IF D2'FIRST /= -13 THEN
79
                         FAILED ("CASE J2 : LOWER BOUND INCORRECT");
80
                    ELSIF D2'LAST /= -11 THEN
81
                         FAILED ("CASE J2 : UPPER BOUND INCORRECT");
82
                    ELSIF D2 /= (3, 2, 1) THEN
83
                         FAILED ("CASE J2 : INCORRECT VALUES");
84
                    END IF;
85
 
86
               END CASE_J2;
87
 
88
     CASE_J3 : DECLARE
89
 
90
                    TYPE TD3 IS ARRAY(IDENT_INT(5) .. 7) OF INTEGER;
91
 
92
                    PROCEDURE PROC1 (A : TD3 := (2, 3, 4)) IS
93
                    BEGIN
94
                         IF A'FIRST /= 5 THEN
95
                              FAILED ("CASE J3 : LOWER BOUND " &
96
                                      "INCORRECT");
97
                         ELSIF A'LAST /= 7 THEN
98
                              FAILED ("CASE J3 : UPPER BOUND " &
99
                                      "INCORRECT");
100
                         ELSIF A /= (2, 3, 4) THEN
101
                              FAILED ("CASE J3 : INCORRECT VALUES");
102
                         END IF;
103
                    END PROC1;
104
 
105
               BEGIN
106
 
107
               PROC1;
108
 
109
               END CASE_J3;
110
 
111
     CASE_J4 : DECLARE
112
 
113
                    TYPE TD4 IS ARRAY(5 .. 8) OF INTEGER;
114
 
115
                    GENERIC
116
                         D4 : TD4 := (1, -2, 3, -4);
117
                    PROCEDURE PROC1;
118
 
119
                    PROCEDURE PROC1 IS
120
                    BEGIN
121
                         IF D4'FIRST /= 5 THEN
122
                              FAILED ("CASE J4 : LOWER BOUND " &
123
                                      "INCORRECT");
124
                         ELSIF D4'LAST /= 8 THEN
125
                              FAILED ("CASE J4 : UPPER BOUND " &
126
                                      "INCORRECT");
127
                         ELSIF D4 /= (1, -2, 3, -4) THEN
128
                              FAILED ("CASE J4 : INCORRECT VALUES");
129
                         END IF;
130
                    END PROC1;
131
 
132
                    PROCEDURE PROC2 IS NEW PROC1;
133
 
134
               BEGIN
135
 
136
                    PROC2;
137
 
138
               END CASE_J4;
139
 
140
          END CASE_J;
141
 
142
     END;
143
 
144
     RESULT;
145
 
146
END C43205J;

powered by: WebSVN 2.1.0

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