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/] [c5/] [c52104r.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C52104R.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 LENGTHS MUST MATCH IN ARRAY AND SLICE ASSIGNMENTS.
26
--    MORE SPECIFICALLY, TEST THAT ATTEMPTED ASSIGNMENTS BETWEEN
27
--    ARRAYS WITH NON-MATCHING LENGTHS LEAVE THE DESTINATION ARRAY
28
--    INTACT AND CAUSE  CONSTRAINT_ERROR  TO BE RAISED.
29
--    (OVERLAPS BETWEEN THE OPERANDS OF THE ASSIGNMENT STATEMENT
30
--    ARE TREATED ELSEWHERE.)
31
 
32
-- THIS IS THE THIRD FILE IN
33
--    DIVISION  D : NULL LENGTHS NOT DETERMINABLE STATICALLY.
34
 
35
 
36
-- RM 07/20/81
37
-- SPS 3/22/83
38
 
39
WITH REPORT;
40
PROCEDURE  C52104R  IS
41
 
42
     USE  REPORT ;
43
 
44
BEGIN
45
 
46
     TEST( "C52104R" , "CHECK THAT IN ARRAY ASSIGNMENTS AND IN SLICE" &
47
                       " ASSIGNMENTS  THE LENGTHS MUST MATCH" );
48
 
49
 
50
     --                              ( EACH DIVISION COMPRISES 3 FILES,
51
     --                                COVERING RESPECTIVELY THE FIRST
52
     --                                3 , NEXT 2 , AND LAST 3 OF THE 8
53
     --                                SELECTIONS FOR THE DIVISION.)
54
 
55
 
56
     -------------------------------------------------------------------
57
 
58
     --    (7) UNSLICED OBJECTS OF THE PREDEFINED TYPE  'STRING'  (BY
59
     --        THEMSELVES).
60
 
61
     DECLARE
62
 
63
          ARR71  :  STRING( IDENT_INT(1)..IDENT_INT(1) )  := "A" ;
64
          ARR72  :  STRING( IDENT_INT(5)..IDENT_INT(4) )  := ""  ;
65
 
66
     BEGIN
67
 
68
          -- STRING ASSIGNMENT:
69
 
70
          ARR72 := ARR71 ;
71
          FAILED( "EXCEPTION NOT RAISED  -  SUBTEST 7" );
72
 
73
     EXCEPTION
74
 
75
          WHEN  CONSTRAINT_ERROR =>
76
 
77
               -- CHECKING THE VALUES AFTER THE STRING ASSIGNMENT:
78
 
79
               IF  ARR72 /= ""
80
               THEN
81
                    FAILED( "ORIGINAL VALUE ALTERED (7)" );
82
               END IF;
83
 
84
          WHEN  OTHERS  =>
85
               FAILED( "WRONG EXCEPTION RAISED  -  SUBTEST 7" );
86
 
87
     END ;
88
 
89
 
90
     -------------------------------------------------------------------
91
 
92
     --    (8) SLICED OBJECTS OF THE PREDEFINED TYPE  'STRING' , WITH
93
     --        STRING LITERALS.
94
     --
95
 
96
     DECLARE
97
 
98
          ARR82 : STRING( IDENT_INT(5)..IDENT_INT(9) ) ;
99
 
100
     BEGIN
101
 
102
 
103
          -- INITIALIZATION OF LHS ARRAY:
104
 
105
          ARR82( IDENT_INT(5)..IDENT_INT(9) )  :=  "QUINC"  ;
106
 
107
 
108
          -- STRING LITERAL ASSIGNMENT:
109
 
110
          ARR82( IDENT_INT(5)..IDENT_INT(9) )
111
               ( IDENT_INT(6)..IDENT_INT(9) )
112
               ( IDENT_INT(6)..IDENT_INT(5) ) := "ABC" ;
113
          FAILED( "EXCEPTION NOT RAISED  -  SUBTEST 8" );
114
 
115
     EXCEPTION
116
 
117
          WHEN  CONSTRAINT_ERROR =>
118
 
119
               -- CHECKING THE VALUES AFTER THE STRING ASSIGNMENT:
120
 
121
               IF  ARR82                                 /=  "QUINC"  OR
122
                   ARR82(  IDENT_INT(5)..IDENT_INT(9)  ) /=  "QUINC"
123
               THEN
124
                    FAILED( "ORIGINAL VALUE ALTERED (8)" );
125
               END IF;
126
 
127
          WHEN  OTHERS  =>
128
 
129
               FAILED( "WRONG EXCEPTION RAISED  -  SUBTEST 8" );
130
 
131
     END ;
132
 
133
 
134
     -------------------------------------------------------------------
135
 
136
     --    (9) SLICED OBJECTS OF THE PREDEFINED TYPE  'STRING'  (BY
137
     --        THEMSELVES).
138
     --
139
 
140
     DECLARE
141
 
142
          SUBTYPE  TA92  IS  STRING( IDENT_INT(5)..IDENT_INT(9) ) ;
143
 
144
          ARR91  :  STRING( IDENT_INT(1)..IDENT_INT(5) )  := "ABCDE" ;
145
          ARR92  :  TA92 ;
146
 
147
     BEGIN
148
 
149
 
150
          -- INITIALIZATION OF LHS ARRAY:
151
 
152
          ARR92( IDENT_INT(5)..IDENT_INT(9) )  :=  "QUINC"  ;
153
 
154
 
155
          -- STRING SLICE ASSIGNMENT:
156
 
157
          ARR92( IDENT_INT(5)..IDENT_INT(9) )
158
               ( IDENT_INT(6)..IDENT_INT(9) )
159
               ( IDENT_INT(8)..IDENT_INT(7) ) :=
160
               ARR91
161
               ( IDENT_INT(1)..IDENT_INT(5) )
162
               ( IDENT_INT(5)..IDENT_INT(7) ) ;
163
          FAILED( "EXCEPTION NOT RAISED  -  SUBTEST 9" );
164
 
165
     EXCEPTION
166
 
167
          WHEN  CONSTRAINT_ERROR =>
168
 
169
               -- CHECKING THE VALUES AFTER THE STRING ASSIGNMENT:
170
 
171
               IF ARR92                                 /=  "QUINC"  OR
172
                  ARR92(  IDENT_INT(5)..IDENT_INT(9)  ) /=  "QUINC"
173
               THEN
174
                    FAILED( "ORIGINAL VALUE ALTERED (9)" );
175
               END IF;
176
 
177
          WHEN  OTHERS  =>
178
 
179
               FAILED( "WRONG EXCEPTION RAISED  -  SUBTEST 9" );
180
 
181
     END ;
182
 
183
 
184
     -------------------------------------------------------------------
185
 
186
 
187
     RESULT ;
188
 
189
 
190
END C52104R;

powered by: WebSVN 2.1.0

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