1 |
149 |
jeremybenn |
-- C4A013A.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 FOR A NONSTATIC
|
26 |
|
|
-- UNIVERSAL_REAL EXPRESSION IF THE VALUE WOULD LIE OUTSIDE THE RANGE OF
|
27 |
|
|
-- THE BASE TYPE OF THE MOST ACCURATE PREDEFINED FLOATING POINT TYPE AND
|
28 |
|
|
-- MACHINE_OVERFLOWS IS TRUE FOR THAT TYPE.
|
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 |
|
|
-- BAW 29 SEPT 80
|
36 |
|
|
-- TBN 10/30/85 RENAMED FROM C4A013A.ADA.
|
37 |
|
|
-- JRK 1/13/86 COMPLETELY REVISED TO CHECK NONSTATIC UNIVERSAL_REAL
|
38 |
|
|
-- EXPRESSIONS WHOSE RESULTS OVERFLOW. REVISED
|
39 |
|
|
-- NUMERIC_ERROR/CONSTRAINT_ERROR ACCORDING TO
|
40 |
|
|
-- AI-00387.
|
41 |
|
|
-- MRM 03/30/93 REMOVED NUMERIC_ERROR FOR 9X COMPATIBILITY
|
42 |
|
|
|
43 |
|
|
WITH SYSTEM, REPORT;
|
44 |
|
|
USE SYSTEM, REPORT;
|
45 |
|
|
|
46 |
|
|
PROCEDURE C4A013A IS
|
47 |
|
|
|
48 |
|
|
TYPE F IS DIGITS MAX_DIGITS;
|
49 |
|
|
|
50 |
|
|
B : BOOLEAN;
|
51 |
|
|
|
52 |
|
|
BEGIN
|
53 |
|
|
TEST ("C4A013A", "CHECK NONSTATIC UNIVERSAL_REAL EXPRESSIONS " &
|
54 |
|
|
"WHOSE RESULTS OVERFLOW");
|
55 |
|
|
|
56 |
|
|
BEGIN
|
57 |
|
|
B := 1.0 < 1.0 / (1.0 * INTEGER'POS (IDENT_INT (0)));
|
58 |
|
|
|
59 |
|
|
IF F'MACHINE_OVERFLOWS THEN
|
60 |
|
|
FAILED ("MACHINE_OVERFLOWS IS TRUE, BUT NO EXCEPTION " &
|
61 |
|
|
"WAS RAISED");
|
62 |
|
|
ELSE COMMENT ("MACHINE_OVERFLOWS IS FALSE AND NO EXCEPTION " &
|
63 |
|
|
"WAS RAISED");
|
64 |
|
|
END IF;
|
65 |
|
|
|
66 |
|
|
IF NOT B THEN -- USE B TO PREVENT DEAD VARIABLE OPTIMIZATION.
|
67 |
|
|
COMMENT ("1.0 < 1.0 / 0.0 YIELDS FALSE");
|
68 |
|
|
END IF;
|
69 |
|
|
EXCEPTION
|
70 |
|
|
WHEN CONSTRAINT_ERROR =>
|
71 |
|
|
COMMENT ("CONSTRAINT_ERROR RAISED");
|
72 |
|
|
WHEN OTHERS =>
|
73 |
|
|
FAILED ("WRONG EXCEPTION RAISED");
|
74 |
|
|
END;
|
75 |
|
|
|
76 |
|
|
RESULT;
|
77 |
|
|
END C4A013A;
|