OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c5/] [c52103h.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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