Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / cc / cc3222a.ada
blob57cb198812ae01c8211e2dc78490719cd97a5733
1 -- CC3222A.ADA
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.
16 -- DISCLAIMER
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 A FLOATING POINT FORMAL TYPE DENOTES ITS ACTUAL
27 -- PARAMETER, AND OPERATIONS OF THE FORMAL TYPE ARE IDENTIFIED WITH
28 -- CORRESPONDING OPERATIONS OF THE ACTUAL TYPE.
30 -- HISTORY:
31 -- TBN 10/09/86 CREATED ORIGINAL TEST.
32 -- PWN 01/31/95 REMOVED INCONSISTENCIES WITH ADA 9X.
34 WITH REPORT; USE REPORT;
35 PROCEDURE CC3222A IS
37 TYPE FLOAT IS DIGITS 5 RANGE 0.0 .. 10.0;
39 GENERIC
40 TYPE T IS DIGITS <>;
41 PACKAGE P IS
42 SUBTYPE SUB_T IS T;
43 PAC_VAR : T;
44 END P;
46 FUNCTION IDENT_FLO (X : FLOAT) RETURN FLOAT IS
47 BEGIN
48 IF EQUAL (3, 3) THEN
49 RETURN X;
50 ELSE
51 RETURN (0.0);
52 END IF;
53 END IDENT_FLO;
55 BEGIN
56 TEST ("CC3222A", "CHECK THAT A FLOATING POINT FORMAL TYPE " &
57 "DENOTES ITS ACTUAL PARAMETER, AND OPERATIONS " &
58 "OF THE FORMAL TYPE ARE IDENTIFIED WITH " &
59 "CORRESPONDING OPERATIONS OF THE ACTUAL TYPE");
61 DECLARE
62 OBJ_INT : INTEGER := 1;
63 OBJ_FLO : FLOAT := 1.0;
65 PACKAGE P1 IS NEW P (FLOAT);
66 USE P1;
68 TYPE NEW_T IS NEW SUB_T;
69 OBJ_NEWT : NEW_T;
70 BEGIN
71 PAC_VAR := SUB_T'(1.0);
72 IF PAC_VAR /= OBJ_FLO THEN
73 FAILED ("INCORRECT RESULTS - 1");
74 END IF;
75 OBJ_FLO := IDENT_FLO (PAC_VAR) + IDENT_FLO (OBJ_FLO);
76 IF OBJ_FLO <= PAC_VAR THEN
77 FAILED ("INCORRECT RESULTS - 2");
78 END IF;
79 PAC_VAR := PAC_VAR * OBJ_FLO;
80 IF PAC_VAR NOT IN FLOAT THEN
81 FAILED ("INCORRECT RESULTS - 3");
82 END IF;
83 IF OBJ_FLO NOT IN SUB_T THEN
84 FAILED ("INCORRECT RESULTS - 4");
85 END IF;
86 PAC_VAR := 1.0;
87 OBJ_FLO := 1.0;
88 OBJ_FLO := PAC_VAR * OBJ_FLO;
89 IF OBJ_FLO /= 1.0 THEN
90 FAILED ("INCORRECT RESULTS - 5");
91 END IF;
92 OBJ_FLO := 1.0;
93 OBJ_FLO := OBJ_FLO / OBJ_FLO;
94 IF OBJ_FLO /= 1.0 THEN
95 FAILED ("INCORRECT RESULTS - 6");
96 END IF;
97 PAC_VAR := 1.0;
98 OBJ_FLO := PAC_VAR ** OBJ_INT;
99 IF OBJ_FLO /= 1.0 THEN
100 FAILED ("INCORRECT RESULTS - 7");
101 END IF;
102 IF SUB_T'DIGITS /= 5 THEN
103 FAILED ("INCORRECT RESULTS - 8");
104 END IF;
105 OBJ_NEWT := 1.0;
106 OBJ_NEWT := OBJ_NEWT - 1.0;
107 IF OBJ_NEWT NOT IN NEW_T THEN
108 FAILED ("INCORRECT RESULTS - 9");
109 END IF;
110 IF NEW_T'DIGITS /= 5 THEN
111 FAILED ("INCORRECT RESULTS - 10");
112 END IF;
113 END;
115 RESULT;
116 END CC3222A;