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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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