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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C52104L.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
-- OBJECTIVE:
26
--     CHECK THAT LENGTHS MUST MATCH IN ARRAY AND SLICE ASSIGNMENTS.
27
--     MORE SPECIFICALLY, TEST THAT ATTEMPTED ASSIGNMENTS BETWEEN
28
--     ARRAYS WITH NON-MATCHING LENGTHS LEAVE THE DESTINATION ARRAY
29
--     INTACT AND CAUSE  CONSTRAINT_ERROR  TO BE RAISED.
30
--     (OVERLAPS BETWEEN THE OPERANDS OF THE ASSIGNMENT STATEMENT
31
--     ARE TREATED ELSEWHERE.)
32
 
33
--     THIS IS THE SECOND FILE IN
34
--     DIVISION  C :  NON-NULL LENGTHS NOT DETERMINABLE STATICALLY.
35
 
36
-- HISTORY:
37
--     RM  07/20/81 CREATED ORIGINAL TEST.
38
--     SPS 03/22/83
39
--     DHH 10/20/87 SHORTENED LINES CONTAINING MORE THAN 72 CHARACTERS.
40
 
41
WITH REPORT;
42
PROCEDURE  C52104L  IS
43
 
44
     USE  REPORT ;
45
 
46
BEGIN
47
 
48
     TEST( "C52104L" , "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
     --   (13) UNSLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS
61
     --        WERE DEFINED USING THE "BOX" SYMBOL
62
     --        AND FOR WHICH THE COMPONENT TYPE IS  'CHARACTER' .
63
 
64
     DECLARE
65
 
66
          TYPE  TABOX3  IS  ARRAY( INTEGER RANGE <> )  OF CHARACTER ;
67
 
68
          ARRX31  :  TABOX3( IDENT_INT(2)..IDENT_INT(6) )  := "QUINC" ;
69
 
70
     BEGIN
71
 
72
 
73
          -- ARRAY ASSIGNMENT (WITH STRING AGGREGATE):
74
 
75
          ARRX31 :=  "ABCD" ;
76
          FAILED( "NO EXCEPTION RAISED  (13)" );
77
 
78
     EXCEPTION
79
 
80
          WHEN CONSTRAINT_ERROR =>
81
 
82
               -- CHECKING THE VALUES AFTER THE ASSIGNMENT:
83
 
84
               IF  ARRX31                               /=  "QUINC"  OR
85
                   ARRX31( IDENT_INT(2)..IDENT_INT(6) ) /=  "QUINC"
86
               THEN
87
                    FAILED( "LHS ARRAY ALTERED  (13)" );
88
               END IF;
89
 
90
          WHEN  OTHERS  =>
91
               FAILED( "WRONG EXCEPTION RAISED  -  SUBTEST 13" );
92
 
93
     END ;
94
 
95
 
96
     -------------------------------------------------------------------
97
 
98
     --   (14) SLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS
99
     --        WERE DEFINED USING THE "BOX" SYMBOL
100
     --        AND FOR WHICH THE COMPONENT TYPE IS  'CHARACTER' .
101
 
102
     DECLARE
103
 
104
          TYPE  TABOX4  IS  ARRAY( INTEGER RANGE <> )  OF CHARACTER ;
105
 
106
          SUBTYPE  TABOX42  IS  TABOX4( IDENT_INT(5)..IDENT_INT(9) );
107
 
108
          ARRX42  :  TABOX42 ;
109
 
110
     BEGIN
111
 
112
          -- INITIALIZATION OF LHS ARRAY:
113
 
114
          ARRX42  :=  "QUINC"  ;
115
 
116
 
117
          -- SLICE ASSIGNMENT:
118
 
119
          ARRX42( IDENT_INT(6)..IDENT_INT(9) )  :=  "ABCDEFGH"  ;
120
          FAILED( "NO EXCEPTION RAISED  (14)" );
121
 
122
     EXCEPTION
123
 
124
          WHEN CONSTRAINT_ERROR =>
125
 
126
               -- CHECKING THE VALUES AFTER THE ASSIGNMENT:
127
 
128
               IF  ARRX42                               /=  "QUINC"  OR
129
                   ARRX42( IDENT_INT(5)..IDENT_INT(9) ) /=  "QUINC"
130
               THEN
131
                    FAILED( "LHS ARRAY ALTERED  (14)" );
132
               END IF;
133
 
134
          WHEN  OTHERS  =>
135
               FAILED( "WRONG EXCEPTION RAISED  -  SUBTEST 14" );
136
 
137
     END ;
138
 
139
 
140
     -------------------------------------------------------------------
141
 
142
 
143
     RESULT ;
144
 
145
 
146
END C52104L;

powered by: WebSVN 2.1.0

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