Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c4 / c46031a.ada
blob589833c19a66ff69aa5dc3eca0284a95735663c2
1 -- C46031A.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 CONVERSIONS TO FIXED POINT TYPES WHEN THE OPERAND TYPE
27 -- IS AN INTEGER TYPE.
29 -- HISTORY:
30 -- JET 07/11/88 CREATED ORIGINAL TEST.
32 WITH REPORT; USE REPORT;
33 PROCEDURE C46031A IS
35 TYPE FIX1 IS DELTA 2#0.01# RANGE -16#20.0# .. 16#20.0#;
36 TYPE FIX2 IS DELTA 2#0.0001# RANGE -16#80.0# .. 16#80.0#;
37 TYPE FIX3 IS DELTA 2#0.000001# RANGE -16#200.0# .. 16#200.0#;
39 TYPE NEW_INT IS NEW INTEGER RANGE -16#200# .. 16#200#;
41 I : INTEGER;
42 J : NEW_INT;
44 FUNCTION IDENT_NEW (X : NEW_INT) RETURN NEW_INT IS
45 BEGIN
46 RETURN X * NEW_INT(IDENT_INT(1));
47 END IDENT_NEW;
49 BEGIN
50 TEST ("C46031A", "CHECK CONVERSIONS TO FIXED POINT TYPES WHEN " &
51 "THE OPERAND TYPE IS AN INTEGER TYPE");
53 I := IDENT_INT(-16#1F#);
54 IF FIX1(I) /= -16#1F.0# THEN
55 FAILED ("INCORRECT RESULT FROM CONVERSION (1)");
56 END IF;
58 J := IDENT_NEW(0);
59 IF FIX1(J) /= 0.0 THEN
60 FAILED ("INCORRECT RESULT FROM CONVERSION (2)");
61 END IF;
63 I := IDENT_INT(16#7F#);
64 IF FIX2(I) /= 16#7F.0# THEN
65 FAILED ("INCORRECT RESULT FROM CONVERSION (3)");
66 END IF;
68 J := IDENT_NEW(16#1#);
69 IF FIX2(J) /= 16#1.0# THEN
70 FAILED ("INCORRECT RESULT FROM CONVERSION (4)");
71 END IF;
73 I := IDENT_INT(-16#55#);
74 IF FIX3(I) /= -16#55.0# THEN
75 FAILED ("INCORRECT RESULT FROM CONVERSION (5)");
76 END IF;
78 J := IDENT_NEW(-16#1#);
79 IF FIX3(J) /= -16#1.0# THEN
80 FAILED ("INCORRECT RESULT FROM CONVERSION (6)");
81 END IF;
83 RESULT;
85 END C46031A;