1-- C45613C.DEP
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 CONSTRAINT_ERROR IS RAISED
27--     BY "**" FOR LONG_INTEGER WHEN THE RESULT EXCEEDS THE RANGE
28--     OF THE BASE TYPE.
29
30-- APPLICABILITY CRITERIA:
31--     THIS TEST IS APPLICABLE TO THOSE IMPLEMENTATIONS WHICH SUPPORT
32--     LONG_INTEGER.
33
34--     IF "LONG_INTEGER" IS NOT SUPPORTED, THEN THE DECLARATION OF
35--     "CHECK_LONG" MUST BE REJECTED.
36
37
38-- *** NOTE: This test has been modified since ACVC version 1.11 to    -- 9X
39-- ***       remove incompatibilities associated with the transition   -- 9X
40-- ***       to Ada 9X.                                                -- 9X
41-- ***                                                                 -- 9X
42
43-- HISTORY:
44--     HTG 10/06/86 CREATED ORIGINAL TEST.
45--     DHH 01/13/88 ADDED APPLICABILITY CRITERIA AND STANDARD HEADER.
46--     MRM 03/30/93 REMOVED NUMERIC_ERROR FOR 9X COMPATIBILITY
47
48WITH REPORT; USE REPORT;
49PROCEDURE C45613C IS
50
51     CHECK_LONG : LONG_INTEGER;                      -- N/A => ERROR.
52
53     FUNCTION IDENT (X : LONG_INTEGER) RETURN LONG_INTEGER IS
54     BEGIN
55          RETURN LONG_INTEGER (IDENT_INT (INTEGER (X)));
56     END IDENT;
57
58BEGIN
59     TEST ("C45613C","CHECK THAT CONSTRAINT_ERROR " &
60                     "IS RAISED BY ""**"" FOR LONG_INTEGER WHEN " &
61                     "THE RESULT EXCEEDS THE RANGE OF THE BASE TYPE");
62
63     DECLARE
64          INT : LONG_INTEGER;
65     BEGIN
66          INT := IDENT(LONG_INTEGER'LAST ** IDENT_INT(2));
67          FAILED ("NO EXCEPTION FOR SECOND POWER OF " &
68                  "LONG_INTEGER'LAST");
69
70          EXCEPTION
71               WHEN CONSTRAINT_ERROR =>
72                    NULL;
73               WHEN OTHERS =>
74                    FAILED ("WRONG EXCEPTION RAISED FOR " &
75                            "SECOND POWER OF " &
76                            "LONG_INTEGER'LAST");
77     END;
78
79     DECLARE
80          INT : LONG_INTEGER;
81     BEGIN
82          INT := IDENT(LONG_INTEGER'FIRST ** IDENT_INT(3));
83                 FAILED ("NO EXCEPTION FOR THIRD POWER OF " &
84                         "LONG_INTEGER'FIRST");
85          EXCEPTION
86               WHEN CONSTRAINT_ERROR =>
87                    NULL;
88               WHEN OTHERS =>
89                    FAILED ("WRONG EXCEPTION RAISED FOR " &
90                            "THIRD POWER OF " &
91                            "LONG_INTEGER'FIRST");
92
93     END;
94
95     RESULT;
96
97END C45613C;
98