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/] [c4/] [c45504d.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
-- C45504D.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 CONSTRAINT_ERROR IS RAISED WHEN THE SECOND
26
-- OPERAND OF '/', 'MOD', OR 'REM' EQUALS ZERO, IF THE OPERANDS ARE OF 
27
-- PREDEFINED TYPE INTEGER.
28
 
29
-- *** NOTE: This test has been modified since ACVC version 1.11 to    -- 9X
30
-- ***       remove incompatibilities associated with the transition   -- 9X
31
-- ***       to Ada 9X.                                                -- 9X
32
 
33
-- R.WILLIAMS 9/1/86
34
-- JRL 03/30/93 REMOVED NUMERIC_ERROR FROM TEST.
35
 
36
WITH REPORT; USE REPORT;
37
PROCEDURE C45504D IS
38
 
39
     I0 : INTEGER := IDENT_INT (0);
40
     I5 : INTEGER := IDENT_INT (5);
41
     N5 : INTEGER := IDENT_INT (-5);
42
 
43
BEGIN
44
     TEST ( "C45504D", "CHECK THAT CONSTRAINT_ERROR " &
45
                       "IS RAISED WHEN THE SECOND OPERAND OF '/', " &
46
                       "'MOD', OR 'REM' EQUALS ZERO, IF THE " &
47
                       "OPERANDS ARE OF PREDEFINED TYPE INTEGER" );
48
 
49
     BEGIN
50
          IF I5 / I0 = 0 THEN
51
               FAILED ( "NO EXCEPTION RAISED BY 'I5 / I0' - 1" );
52
          ELSE
53
               FAILED ( "NO EXCEPTION RAISED BY 'I5 / I0' - 2" );
54
          END IF;
55
     EXCEPTION
56
          WHEN CONSTRAINT_ERROR =>
57
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'I5 / I0'" );
58
          WHEN OTHERS =>
59
               FAILED ( "WRONG EXCEPTION RAISED BY 'I5 / I0'" );
60
     END;
61
 
62
     BEGIN
63
          IF N5 / I0 = 0 THEN
64
               FAILED ( "NO EXCEPTION RAISED BY 'N5 / I0' - 1" );
65
          ELSE
66
               FAILED ( "NO EXCEPTION RAISED BY 'N5 / I0' - 2" );
67
          END IF;
68
     EXCEPTION
69
          WHEN CONSTRAINT_ERROR =>
70
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'N5 / I0'" );
71
          WHEN OTHERS =>
72
               FAILED ( "WRONG EXCEPTION RAISED BY 'N5 / I0'" );
73
     END;
74
 
75
     BEGIN
76
          IF I0 / I0  = 0 THEN
77
               FAILED ( "NO EXCEPTION RAISED BY 'I0 / I0' - 1" );
78
          ELSE
79
               FAILED ( "NO EXCEPTION RAISED BY 'I0 / I0' - 2" );
80
          END IF;
81
     EXCEPTION
82
          WHEN CONSTRAINT_ERROR =>
83
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'I0 / I0'" );
84
          WHEN OTHERS =>
85
               FAILED ( "WRONG EXCEPTION RAISED BY 'I0 / I0'" );
86
     END;
87
 
88
     BEGIN
89
          IF I5 / I0 * I0  = 0 THEN
90
               FAILED ( "NO EXCEPTION RAISED BY 'I5 / I0 * I0' - 1" );
91
          ELSE
92
               FAILED ( "NO EXCEPTION RAISED BY 'I5 / I0 * I0' - 2" );
93
          END IF;
94
     EXCEPTION
95
          WHEN CONSTRAINT_ERROR =>
96
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'I5 / I0 * I0'" );
97
          WHEN OTHERS =>
98
               FAILED ( "WRONG EXCEPTION RAISED BY 'I5 / I0 * I0'" );
99
     END;
100
 
101
     BEGIN
102
          IF I5 MOD I0 = 0 THEN
103
               FAILED ( "NO EXCEPTION RAISED BY 'I5 MOD I0' - 1" );
104
          ELSE
105
               FAILED ( "NO EXCEPTION RAISED BY 'I5 MOD I0' - 2" );
106
          END IF;
107
     EXCEPTION
108
          WHEN CONSTRAINT_ERROR =>
109
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'I5 MOD I0'" );
110
          WHEN OTHERS =>
111
               FAILED ( "WRONG EXCEPTION RAISED BY 'I5 MOD I0'" );
112
     END;
113
 
114
     BEGIN
115
          IF N5 MOD I0 = 0 THEN
116
               FAILED ( "NO EXCEPTION RAISED BY 'N5 MOD I0' - 1" );
117
          ELSE
118
               FAILED ( "NO EXCEPTION RAISED BY 'N5 MOD I0' - 2" );
119
          END IF;
120
     EXCEPTION
121
          WHEN CONSTRAINT_ERROR =>
122
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'N5 MOD I0'" );
123
          WHEN OTHERS =>
124
               FAILED ( "WRONG EXCEPTION RAISED BY 'N5 MOD I0'" );
125
     END;
126
 
127
     BEGIN
128
          IF I0 MOD I0  = 0 THEN
129
               FAILED ( "NO EXCEPTION RAISED BY 'I0 MOD I0' - 1" );
130
          ELSE
131
               FAILED ( "NO EXCEPTION RAISED BY 'I0 MOD I0' - 2" );
132
          END IF;
133
     EXCEPTION
134
          WHEN CONSTRAINT_ERROR =>
135
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'I0 MOD I0'" );
136
          WHEN OTHERS =>
137
               FAILED ( "WRONG EXCEPTION RAISED BY 'I0 MOD I0'" );
138
     END;
139
 
140
     BEGIN
141
          IF I5 MOD I0 = (I5 + I0) MOD I0 THEN
142
               FAILED ( "NO EXCEPTION RAISED BY 'I5 MOD I0 = " &
143
                        "(I5 + I0) MOD I0' - 1" );
144
          ELSE
145
               FAILED ( "NO EXCEPTION RAISED BY 'I5 MOD I0 = " &
146
                        "(I5 + I0) MOD I0' - 2" );
147
          END IF;
148
     EXCEPTION
149
          WHEN CONSTRAINT_ERROR =>
150
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'I5 MOD I0 = " &
151
                         "(I5 + I0) MOD I0'" );
152
          WHEN OTHERS =>
153
               FAILED ( "WRONG EXCEPTION RAISED BY 'I5 MOD I0 = " &
154
                         "(I5 + I0) MOD I0'" );
155
     END;
156
 
157
     BEGIN
158
          IF I5 REM I0 = 0 THEN
159
               FAILED ( "NO EXCEPTION RAISED BY 'I5 REM I0' - 1" );
160
          ELSE
161
               FAILED ( "NO EXCEPTION RAISED BY 'I5 REM I0' - 2" );
162
          END IF;
163
     EXCEPTION
164
          WHEN CONSTRAINT_ERROR =>
165
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'I5 REM I0'" );
166
          WHEN OTHERS =>
167
               FAILED ( "WRONG EXCEPTION RAISED BY 'I5 REM I0'" );
168
     END;
169
 
170
     BEGIN
171
          IF N5 REM I0 = 0 THEN
172
               FAILED ( "NO EXCEPTION RAISED BY 'N5 REM I0' - 1" );
173
          ELSE
174
               FAILED ( "NO EXCEPTION RAISED BY 'N5 REM I0' - 2" );
175
          END IF;
176
     EXCEPTION
177
          WHEN CONSTRAINT_ERROR =>
178
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'N5 REM I0'" );
179
          WHEN OTHERS =>
180
               FAILED ( "WRONG EXCEPTION RAISED BY 'N5 REM I0'" );
181
     END;
182
 
183
     BEGIN
184
          IF I0 REM I0  = 0 THEN
185
               FAILED ( "NO EXCEPTION RAISED BY 'I0 REM I0' - 1" );
186
          ELSE
187
               FAILED ( "NO EXCEPTION RAISED BY 'I0 REM I0' - 2" );
188
          END IF;
189
     EXCEPTION
190
          WHEN CONSTRAINT_ERROR =>
191
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'I0 REM I0'" );
192
          WHEN OTHERS =>
193
               FAILED ( "WRONG EXCEPTION RAISED BY 'I0 REM I0'" );
194
     END;
195
 
196
     BEGIN
197
          IF I5 REM (-I0) = I5 REM I0 THEN
198
               FAILED ( "NO EXCEPTION RAISED BY 'I5 REM (-I0) = " &
199
                        "I5 REM I0' - 1" );
200
          ELSE
201
               FAILED ( "NO EXCEPTION RAISED BY 'I5 REM (-I0) = " &
202
                        "I5 REM I0' - 2" );
203
          END IF;
204
     EXCEPTION
205
          WHEN CONSTRAINT_ERROR =>
206
               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'I5 REM (-I0) " &
207
                         "= I5 REM I0'" );
208
          WHEN OTHERS =>
209
               FAILED ( "WRONG EXCEPTION RAISED BY 'I5 REM (-I0) = " &
210
                         "I5 REM I0'" );
211
     END;
212
 
213
     RESULT;
214
END C45504D;

powered by: WebSVN 2.1.0

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