1-- C45632A.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 FOR PREDEFINED TYPE INTEGER, CONSTRAINT_ERROR
27--     IS RAISED FOR ABS (INTEGER'FIRST) IF
28--     -INTEGER'LAST > INTEGER'FIRST.
29
30-- *** NOTE: This test has been modified since ACVC version 1.11 to    -- 9X
31-- ***       remove incompatibilities associated with the transition   -- 9X
32-- ***       to Ada 9X.                                                -- 9X
33-- ***                                                                 -- 9X
34
35-- HISTORY:
36--     RJW 02/10/86  CREATED ORIGINAL TEST.
37--     JET 12/30/87  UPDATED HEADER FORMAT AND ADDED CODE TO
38--                   PREVENT OPTIMIZATION.
39--     MRM 03/30/93  REMOVED NUMERIC ERROR FOR 9X COMPATIBILITY
40
41WITH REPORT; USE REPORT;
42
43PROCEDURE C45632A IS
44
45     I : INTEGER := IDENT_INT (INTEGER'FIRST);
46
47BEGIN
48
49     TEST ( "C45632A", "CHECK THAT FOR PREDEFINED TYPE INTEGER " &
50                       "CONSTRAINT_ERROR IS RAISED " &
51                       "FOR ABS (INTEGER'FIRST) IF -INTEGER'LAST > " &
52                       "INTEGER'FIRST" );
53
54     BEGIN
55          IF - INTEGER'LAST > INTEGER'FIRST THEN
56               BEGIN
57                    IF EQUAL (ABS I, I) THEN
58                         NULL;
59                    ELSE
60                         FAILED ( "WRONG RESULT FOR ABS" );
61                    END IF;
62                    FAILED ( "EXCEPTION NOT RAISED" );
63               EXCEPTION
64                    WHEN CONSTRAINT_ERROR =>
65                         COMMENT ( "CONSTRAINT_ERROR RAISED" );
66                    WHEN OTHERS =>
67                         FAILED ( "WRONG EXCEPTION RAISED" );
68               END;
69          ELSE
70               COMMENT ( "-INTEGER'LAST <= INTEGER'FIRST" );
71          END IF;
72     END;
73
74     RESULT;
75
76END C45632A;
77