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

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

Line No. Rev Author Line
1 149 jeremybenn
-- C55B05A.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 LOOPS WITH BOUNDS INTEGER'LAST OR
26
-- INTEGER'FIRST DO NOT RAISE INVALID EXCEPTIONS.
27
 
28
-- *** NOTE: This test has been modified since ACVC version 1.11 to    -- 9X
29
-- ***       remove incompatibilities associated with the transition   -- 9X
30
-- ***       to Ada 9X.                                                -- 9X
31
-- ***                                                                 -- 9X
32
 
33
-- DAT 3/26/81
34
-- SPS 3/2/83
35
-- MRM 03/30/93   REMOVED NUMERIC_ERROR FOR 9X COMPATIBILITY
36
 
37
WITH REPORT; USE REPORT;
38
 
39
PROCEDURE C55B05A IS
40
BEGIN
41
     TEST ("C55B05A", "LOOPS WITH INTEGER'FIRST AND 'LAST AS BOUNDS");
42
 
43
     DECLARE
44
 
45
          COUNT : INTEGER := 0;
46
 
47
          PROCEDURE C IS
48
          BEGIN
49
               COUNT := COUNT + 1;
50
          END C;
51
 
52
     BEGIN
53
          FOR I IN INTEGER'LAST .. INTEGER'FIRST LOOP
54
               FAILED ("WRONG NULL RANGE LOOP EXECUTION");
55
               EXIT;
56
          END LOOP;
57
          FOR I IN INTEGER'FIRST .. INTEGER'FIRST LOOP
58
               C;
59
          END LOOP;
60
          FOR I IN INTEGER'FIRST .. INTEGER'FIRST + 2 LOOP
61
               C; C;
62
          END LOOP;
63
          FOR I IN INTEGER'FIRST + 1 .. INTEGER'FIRST LOOP
64
               FAILED ("NULL RANGE ERROR 2");
65
               EXIT;
66
          END LOOP;
67
          FOR I IN INTEGER'FIRST .. INTEGER'LAST LOOP
68
               C;
69
               EXIT;
70
          END LOOP;
71
          FOR I IN INTEGER LOOP
72
               C;
73
               EXIT;
74
          END LOOP;
75
          FOR I IN INTEGER'LAST - 2 .. INTEGER'LAST LOOP
76
               C; C; C;
77
          END LOOP;
78
          FOR I IN INTEGER'LAST - 2 .. INTEGER'LAST - 1 LOOP
79
               C;
80
          END LOOP;
81
          FOR I IN 0 .. INTEGER'FIRST LOOP
82
               FAILED ("NULL LOOP ERROR 3");
83
               EXIT;
84
          END LOOP;
85
          FOR I IN -1 .. INTEGER'FIRST LOOP
86
               FAILED ("NULL LOOP ERROR 4");
87
               EXIT;
88
          END LOOP;
89
          FOR I IN -3 .. IDENT_INT(0) LOOP
90
               FOR J IN INTEGER'FIRST .. INTEGER'FIRST - I LOOP
91
                    C; C; C; C;
92
               END LOOP;
93
               FOR J IN INTEGER'FIRST - I .. INTEGER'FIRST + 3 - I LOOP
94
                    C; C; C; C;
95
               END LOOP;
96
               FOR J IN INTEGER'LAST - 3 .. INTEGER'LAST + I LOOP
97
                    C; C; C; C;
98
               END LOOP;
99
               FOR J IN INTEGER'LAST + I .. INTEGER'LAST LOOP
100
                    C; C; C; C;
101
               END LOOP;
102
          END LOOP;
103
 
104
          FOR I IN REVERSE INTEGER'LAST .. INTEGER'FIRST LOOP
105
               FAILED ("REVERSE WRONG NULL RANGE LOOP EXECUTION");
106
               EXIT;
107
          END LOOP;
108
          FOR I IN REVERSE INTEGER'FIRST .. INTEGER'FIRST LOOP
109
               C;
110
          END LOOP;
111
          FOR I IN REVERSE INTEGER'FIRST .. INTEGER'FIRST + 2 LOOP
112
               C; C;
113
          END LOOP;
114
          FOR I IN REVERSE INTEGER'FIRST + 1 .. INTEGER'FIRST LOOP
115
               FAILED ("NULL RANGE ERROR 8");
116
               EXIT;
117
          END LOOP;
118
          FOR I IN REVERSE INTEGER'FIRST .. INTEGER'LAST LOOP
119
               C;
120
               EXIT;
121
          END LOOP;
122
          FOR I IN REVERSE INTEGER LOOP
123
               C;
124
               EXIT;
125
          END LOOP;
126
          FOR I IN REVERSE INTEGER'LAST - 2 .. INTEGER'LAST LOOP
127
               C; C; C;
128
          END LOOP;
129
          FOR I IN REVERSE INTEGER'LAST - 2 .. INTEGER'LAST - 1 LOOP
130
               C;
131
          END LOOP;
132
          FOR I IN REVERSE 0 .. INTEGER'FIRST LOOP
133
               FAILED ("NULL LOOP ERROR 9");
134
               EXIT;
135
          END LOOP;
136
          FOR I IN REVERSE -1 .. INTEGER'FIRST LOOP
137
               FAILED ("NULL LOOP ERROR 7");
138
               EXIT;
139
          END LOOP;
140
          FOR I IN REVERSE -3 .. IDENT_INT(0) LOOP
141
               FOR J IN REVERSE INTEGER'FIRST .. INTEGER'FIRST - I LOOP
142
                    C; C; C; C;
143
               END LOOP;
144
               FOR J IN REVERSE INTEGER'FIRST - I
145
                    .. INTEGER'FIRST + 3 - I
146
               LOOP
147
                    C; C; C; C;
148
               END LOOP;
149
               FOR J IN REVERSE INTEGER'LAST - 3 .. INTEGER'LAST + I
150
               LOOP
151
                    C; C; C; C;
152
               END LOOP;
153
               FOR J IN REVERSE INTEGER'LAST + I .. INTEGER'LAST LOOP
154
                    C; C; C; C;
155
               END LOOP;
156
          END LOOP;
157
 
158
          IF COUNT /= 408 THEN
159
               FAILED ("WRONG LOOP EXECUTION COUNT");
160
          END IF;
161
 
162
     EXCEPTION
163
          WHEN CONSTRAINT_ERROR =>
164
               FAILED ("CONSTRAINT_ERROR RAISED INCORRECTLY");
165
          WHEN OTHERS =>
166
               FAILED ("UNKNOWN EXCEPTION RAISED INCORRECTLY");
167
     END;
168
 
169
     RESULT;
170
END C55B05A;

powered by: WebSVN 2.1.0

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