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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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