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

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

Line No. Rev Author Line
1 149 jeremybenn
-- C43214F.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 LOWER BOUND FOR THE STRING LITERAL IS DETERMINED BY
26
-- THE APPLICABLE INDEX CONSTRAINT, WHEN ONE EXISTS.
27
 
28
-- EG  02/10/84
29
-- JBG 3/30/84
30
 
31
WITH REPORT;
32
 
33
PROCEDURE C43214F IS
34
 
35
     USE REPORT;
36
 
37
BEGIN
38
 
39
     TEST("C43214F", "ARRAY COMPONENT EXPRESSION OF AN ENCLOSING " &
40
                     "AGGREGATE");
41
 
42
     BEGIN
43
 
44
CASE_E :  BEGIN
45
 
46
--             COMMENT ("CASE E1 : ARRAY COMPONENT EXPRESSION OF " &
47
--                      "AN ENCLOSING ARRAY AGGREGATE");
48
 
49
     CASE_E1 : DECLARE
50
 
51
                    TYPE TE2 IS ARRAY(1 .. 2) OF
52
                                STRING(IDENT_INT(3) .. 5);
53
 
54
                    E1 : TE2;
55
 
56
               BEGIN
57
 
58
                    E1 := (1 .. 2 => "ABC");
59
                    IF (E1'FIRST /= 1 OR E1'LAST /= 2) OR ELSE
60
                       (E1(1)'FIRST /= 3 OR E1(1)'LAST /= 5 OR
61
                        E1(2)'FIRST /= 3 OR E1(2)'LAST /= 5) THEN
62
                         FAILED ("CASE 1 : INCORRECT BOUNDS");
63
                    ELSIF E1 /= (1 .. 2 => "ABC") THEN
64
                         FAILED ("CASE 1 : ARRAY DOES NOT " &
65
                                 "CONTAIN THE CORRECT VALUES");
66
                    END IF;
67
 
68
               END CASE_E1;
69
 
70
--             COMMENT ("CASE E2 : ARRAY COMPONENT EXPRESSION OF " &
71
--                      "AN ENCLOSING RECORD AGGREGATE");
72
 
73
     CASE_E2 : DECLARE
74
 
75
                    TYPE TER IS
76
                         RECORD
77
                              REC : STRING(3 .. 5);
78
                         END RECORD;
79
 
80
                    E2 : TER;
81
 
82
               BEGIN
83
 
84
                    E2 := (REC => "ABC");
85
                    IF E2.REC'FIRST /= 3 OR E2.REC'LAST /= 5 THEN
86
                         FAILED ("CASE 2 : INCORRECT BOUNDS");
87
                    ELSIF E2.REC /= "ABC" THEN
88
                         FAILED ("CASE 2 : ARRAY DOES NOT " &
89
                                 "CONTAIN CORRECT VALUES");
90
                    END IF;
91
 
92
               END CASE_E2;
93
 
94
--             COMMENT ("CASE E3 : NULL LITERAL OF AN ENCLOSING " &
95
--                      "ARRAY AGGREGATE");
96
 
97
     CASE_E3 : DECLARE
98
 
99
                    TYPE TE2 IS ARRAY(1 .. 2) OF
100
                                STRING(3 .. IDENT_INT(2));
101
 
102
                    E3 : TE2;
103
 
104
               BEGIN
105
 
106
                    E3 := (1 .. 2 => "");
107
                    IF (E3'FIRST /= 1 OR E3'LAST /= 2) OR ELSE
108
                       (E3(1)'FIRST /= 3 OR E3(1)'LAST /= 2 OR
109
                        E3(2)'FIRST /= 3 OR E3(2)'LAST /= 2) THEN
110
                         FAILED ("CASE 3 : INCORRECT BOUND");
111
                    ELSIF E3 /= (1 .. 2 => "") THEN
112
                         FAILED ("CASE 3 : ARRAY DOES NOT CONTAIN " &
113
                                 "THE CORRECT VALUES");
114
                    END IF;
115
 
116
               END CASE_E3;
117
 
118
--             COMMENT ("CASE E4 : ARRAY COMPONENT EXPRESSION OF "  &
119
--                      "AN ENCLOSING RECORD AGGREGATE THAT HAS A " &
120
--                      "DISCRIMINANT AND THE DISCRIMINANT DETER"   &
121
--                      "MINES THE BOUNDS OF THE COMPONENT");
122
 
123
     CASE_E4 : DECLARE
124
 
125
                    SUBTYPE TEN IS INTEGER RANGE 1 .. 10;
126
                    TYPE TER (A : TEN) IS
127
                         RECORD
128
                              REC : STRING(3 .. A);
129
                         END RECORD;
130
 
131
                    E4 : TER(5);
132
 
133
               BEGIN
134
 
135
                    E4 := (REC => "ABC", A => 5);
136
                    IF E4.REC'FIRST /= 3 OR E4.REC'LAST /= 5 THEN
137
                         FAILED ("CASE 4 : INCORRECT BOUNDS");
138
                    ELSIF E4.REC /= "ABC" THEN
139
                         FAILED ("CASE 4 : ARRAY DOES NOT CONTAIN " &
140
                                 "CORRECT VALUES");
141
                    END IF;
142
 
143
               END CASE_E4;
144
 
145
          END CASE_E;
146
 
147
     END;
148
 
149
     RESULT;
150
 
151
END C43214F;

powered by: WebSVN 2.1.0

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