1 |
149 |
jeremybenn |
-- C41323A.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 IMPLICITLY DECLARED RELATIONAL OPERATORS AND ARITHMETIC
|
26 |
|
|
-- OPERATORS (+, -, *, /, **, ABS) MAY BE SELECTED FROM OUTSIDE THE
|
27 |
|
|
-- PACKAGE USING AN EXPANDED NAME, FOR A FLOATING POINT TYPE.
|
28 |
|
|
|
29 |
|
|
-- TBN 7/16/86
|
30 |
|
|
|
31 |
|
|
WITH REPORT; USE REPORT;
|
32 |
|
|
PROCEDURE C41323A IS
|
33 |
|
|
|
34 |
|
|
PACKAGE P IS
|
35 |
|
|
TYPE FLOAT IS DIGITS 5 RANGE -1.0E1 .. 1.0E1;
|
36 |
|
|
OBJ_FLO_1 : FLOAT := -5.5;
|
37 |
|
|
OBJ_FLO_2 : FLOAT := 1.5;
|
38 |
|
|
OBJ_FLO_3 : FLOAT := 10.0;
|
39 |
|
|
END P;
|
40 |
|
|
|
41 |
|
|
FLO_VAR : P.FLOAT;
|
42 |
|
|
FLO_VAR_1 : P.FLOAT := P."-"(P.FLOAT'(5.5));
|
43 |
|
|
FLO_VAR_2 : P.FLOAT := P.FLOAT'(1.5);
|
44 |
|
|
FLO_VAR_3 : P.FLOAT := P.FLOAT'(1.0E1);
|
45 |
|
|
|
46 |
|
|
BEGIN
|
47 |
|
|
TEST ("C41323A", "CHECK THAT IMPLICITLY DECLARED RELATIONAL " &
|
48 |
|
|
"OPERATORS AND ARITHMETIC OPERATORS (+, -, *, " &
|
49 |
|
|
"/, **, ABS) MAY BE SELECTED FROM OUTSIDE THE " &
|
50 |
|
|
"PACKAGE USING AN EXPANDED NAME, FOR A " &
|
51 |
|
|
"FLOATING POINT TYPE");
|
52 |
|
|
|
53 |
|
|
IF P."=" (FLO_VAR_1, P."-"(P.FLOAT'(5.55))) THEN
|
54 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 1");
|
55 |
|
|
END IF;
|
56 |
|
|
|
57 |
|
|
IF P."/=" (FLO_VAR_1, P.OBJ_FLO_1) THEN
|
58 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 2");
|
59 |
|
|
END IF;
|
60 |
|
|
|
61 |
|
|
IF P."<" (FLO_VAR_2, P.OBJ_FLO_1) THEN
|
62 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 3");
|
63 |
|
|
END IF;
|
64 |
|
|
|
65 |
|
|
IF P.">" (FLO_VAR_2, P.OBJ_FLO_3) THEN
|
66 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 4");
|
67 |
|
|
END IF;
|
68 |
|
|
|
69 |
|
|
IF P."<=" (FLO_VAR_3, P.FLOAT'(9.9)) THEN
|
70 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 5");
|
71 |
|
|
END IF;
|
72 |
|
|
|
73 |
|
|
IF P."<=" (FLO_VAR_3, P.FLOAT'(10.0)) THEN
|
74 |
|
|
NULL;
|
75 |
|
|
ELSE
|
76 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 6");
|
77 |
|
|
END IF;
|
78 |
|
|
|
79 |
|
|
IF P.">=" (P.OBJ_FLO_2, FLO_VAR_3) THEN
|
80 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 7");
|
81 |
|
|
END IF;
|
82 |
|
|
|
83 |
|
|
IF P.">=" (P.OBJ_FLO_3, FLO_VAR_3) THEN
|
84 |
|
|
NULL;
|
85 |
|
|
ELSE
|
86 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 8");
|
87 |
|
|
END IF;
|
88 |
|
|
|
89 |
|
|
FLO_VAR := P."+" (FLO_VAR_1, P.OBJ_FLO_2);
|
90 |
|
|
IF P."/=" (FLO_VAR, P."-"(P.FLOAT'(4.0))) THEN
|
91 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 9");
|
92 |
|
|
END IF;
|
93 |
|
|
|
94 |
|
|
FLO_VAR := P."+" (FLO_VAR_1);
|
95 |
|
|
IF P."/=" (FLO_VAR, P.OBJ_FLO_1) THEN
|
96 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 10");
|
97 |
|
|
END IF;
|
98 |
|
|
|
99 |
|
|
FLO_VAR := P."-" (FLO_VAR_2, P.OBJ_FLO_1);
|
100 |
|
|
IF P."/=" (FLO_VAR, P.FLOAT'(7.0)) THEN
|
101 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 11");
|
102 |
|
|
END IF;
|
103 |
|
|
|
104 |
|
|
FLO_VAR := P."*" (FLO_VAR_2, P.FLOAT'(2.0));
|
105 |
|
|
IF P."/=" (FLO_VAR, P.FLOAT'(3.0)) THEN
|
106 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 12");
|
107 |
|
|
END IF;
|
108 |
|
|
|
109 |
|
|
FLO_VAR := P."/" (FLO_VAR_3, P.FLOAT'(2.0));
|
110 |
|
|
IF P."/=" (FLO_VAR, P.FLOAT'(5.0)) THEN
|
111 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 13");
|
112 |
|
|
END IF;
|
113 |
|
|
|
114 |
|
|
FLO_VAR := P."**" (P.FLOAT'(2.0), 3);
|
115 |
|
|
IF P."/=" (FLO_VAR, P.FLOAT'(8.0)) THEN
|
116 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 14");
|
117 |
|
|
END IF;
|
118 |
|
|
|
119 |
|
|
FLO_VAR := P."ABS" (FLO_VAR_1);
|
120 |
|
|
IF P."/=" (FLO_VAR, P.FLOAT'(5.5)) THEN
|
121 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 15");
|
122 |
|
|
END IF;
|
123 |
|
|
|
124 |
|
|
RESULT;
|
125 |
|
|
END C41323A;
|