1-- C45504A.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 CONSTRAINT_ERROR IS RAISED WHEN A
27--      PRODUCT LIES OUTSIDE THE RANGE OF THE BASE TYPE, IF THE
28--      OPERANDS ARE OF PREDEFINED TYPE INTEGER.
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
34-- HISTORY:
35--      RJW 09/01/86  CREATED ORIGINAL TEST.
36--      JET 12/30/87  UPDATED HEADER FORMAT AND ADDED CODE TO
37--                    PREVENT OPTIMIZATION.
38--      JRL 03/30/93  REMOVED NUMERIC_ERROR FROM TEST.
39
40WITH REPORT; USE REPORT;
41PROCEDURE C45504A IS
42
43     F : INTEGER := IDENT_INT (INTEGER'FIRST);
44     L : INTEGER := IDENT_INT (INTEGER'LAST);
45
46BEGIN
47     TEST ( "C45504A", "CHECK THAT CONSTRAINT_ERROR " &
48                       "IS RAISED WHEN A PRODUCT LIES OUTSIDE THE " &
49                       "RANGE OF THE BASE TYPE, IF THE OPERANDS ARE " &
50                       "OF PREDEFINED TYPE INTEGER" );
51
52     BEGIN
53          IF EQUAL (F*L,-100) THEN
54               FAILED ( "NO EXCEPTION RAISED BY 'F * L' - 1" );
55          ELSE
56               FAILED ( "NO EXCEPTION RAISED BY 'F * L' - 2" );
57          END IF;
58     EXCEPTION
59          WHEN CONSTRAINT_ERROR =>
60               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'F * L'" );
61          WHEN OTHERS =>
62               FAILED ( "WRONG EXCEPTION RAISED BY 'F * L'" );
63     END;
64
65     BEGIN
66          IF EQUAL (F*F,100) THEN
67               FAILED ( "NO EXCEPTION RAISED BY 'F * F' - 1" );
68          ELSE
69               FAILED ( "NO EXCEPTION RAISED BY 'F * F' - 2" );
70          END IF;
71     EXCEPTION
72          WHEN CONSTRAINT_ERROR =>
73               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'F * F'" );
74          WHEN OTHERS =>
75               FAILED ( "WRONG EXCEPTION RAISED BY 'F * F'" );
76     END;
77
78     BEGIN
79          IF EQUAL (L*L,100) THEN
80               FAILED ( "NO EXCEPTION RAISED BY 'L * L' - 1" );
81          ELSE
82               FAILED ( "NO EXCEPTION RAISED BY 'L * L' - 2" );
83          END IF;
84     EXCEPTION
85          WHEN CONSTRAINT_ERROR =>
86               COMMENT ( "CONSTRAINT_ERROR RAISED BY 'L * L'" );
87          WHEN OTHERS =>
88               FAILED ( "WRONG EXCEPTION RAISED BY 'L * L'" );
89     END;
90
91     RESULT;
92END C45504A;
93