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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C52104G.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 SECOND FILE IN
33
--    DIVISION  B : STATICALLY-DETERMINABLE NULL LENGTHS.
34
 
35
 
36
-- RM 07/20/81
37
-- SPS 3/22/83
38
-- JBG 4/24/84
39
 
40
WITH REPORT;
41
PROCEDURE  C52104G  IS
42
 
43
     USE  REPORT ;
44
 
45
BEGIN
46
 
47
     TEST( "C52104G" , "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
     --   (13) UNSLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS
60
     --        WERE DEFINED USING THE "BOX" SYMBOL
61
     --        AND FOR WHICH THE COMPONENT TYPE IS  'CHARACTER' .
62
 
63
     DECLARE
64
 
65
          TYPE  TABOX3  IS  ARRAY( NATURAL RANGE <> )  OF CHARACTER ;
66
 
67
          ARRX31  :  TABOX3( 11..10 )  :=  ""  ;
68
 
69
     BEGIN
70
 
71
 
72
          -- ARRAY ASSIGNMENT (WITH STRING AGGREGATE):
73
 
74
          ARRX31 :=  "AZ" ;
75
          FAILED( "EXCEPTION NOT RAISED  -  SUBTEST 13" );
76
 
77
     EXCEPTION
78
 
79
          WHEN  CONSTRAINT_ERROR =>
80
 
81
               -- CHECKING THE VALUES AFTER THE SLICE ASSIGNMENT:
82
 
83
               IF  ARRX31  /=  ""
84
               THEN
85
                    FAILED( "ARRAY ASSIGNMENT NOT CORRECT (13)" );
86
               END IF;
87
 
88
          WHEN  OTHERS =>
89
 
90
               FAILED( "WRONG EXCEPTION RAISED  -  SUBTEST 13" );
91
 
92
     END ;
93
 
94
 
95
     -------------------------------------------------------------------
96
 
97
     --   (14) SLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS
98
     --        WERE DEFINED USING THE "BOX" SYMBOL
99
     --        AND FOR WHICH THE COMPONENT TYPE IS  'CHARACTER' .
100
 
101
     DECLARE
102
 
103
          TYPE  TABOX4  IS  ARRAY( INTEGER RANGE <> )  OF CHARACTER ;
104
 
105
          SUBTYPE  TABOX42  IS  TABOX4( 11..15 );
106
 
107
          ARRX42  :  TABOX42 ;
108
 
109
     BEGIN
110
 
111
          -- INITIALIZATION OF LHS ARRAY:
112
 
113
          ARRX42  :=  "QUINC"  ;
114
 
115
 
116
          -- NULL SLICE ASSIGNMENT:
117
 
118
          ARRX42( 13..12 ) :=  "ABCD" ;
119
          FAILED( "EXCEPTION NOT RAISED  -  SUBTEST 14" );
120
 
121
     EXCEPTION
122
 
123
          WHEN  CONSTRAINT_ERROR =>
124
 
125
               -- CHECKING THE VALUES AFTER THE SLICE ASSIGNMENT:
126
 
127
               IF  ARRX42           /=  "QUINC"  OR
128
                   ARRX42( 11..15 ) /=  "QUINC"
129
               THEN
130
                    FAILED( "LHS ARRAY ALTERED  (14)" );
131
               END IF;
132
 
133
          WHEN  OTHERS =>
134
 
135
               FAILED( "WRONG EXCEPTION RAISED  -  SUBTEST 14" );
136
 
137
     END ;
138
 
139
 
140
     -------------------------------------------------------------------
141
 
142
 
143
     RESULT ;
144
 
145
 
146
END C52104G;

powered by: WebSVN 2.1.0

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