Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c3 / c35502h.ada
blob640e2e9de054eac859402e95c13a64b9a58426c9
1 -- C35502H.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 -- CHECK THAT 'PRED' AND 'SUCC' YIELD THE CORRECT RESULTS WHEN
26 -- THE PREFIX IS A FORMAL DISCRETE TYPE WHOSE ACTUAL ARGUMENT IS
27 -- AN ENUMERATION TYPE OTHER THAN A BOOLEAN OR A CHARACTER TYPE.
29 -- RJW 5/27/86
31 WITH REPORT; USE REPORT;
33 PROCEDURE C35502H IS
35 TYPE ENUM IS (A, BC, ABC, A_B_C, ABCD);
37 TYPE NEWENUM IS NEW ENUM;
39 BEGIN
40 TEST ("C35502H", "CHECK THAT 'PRED' AND 'SUCC' YIELD THE " &
41 "CORRECT RESULTS WHEN THE PREFIX IS A " &
42 "FORMAL DISCRETE TYPE WHOSE ACTUAL " &
43 "ARGUMENT IS AN ENUMERATION TYPE OTHER THAN " &
44 "A CHARACTER OR A BOOLEAN TYPE" );
46 DECLARE
47 GENERIC
48 TYPE E IS (<>);
49 STR : STRING;
50 PROCEDURE P;
52 PROCEDURE P IS
53 SUBTYPE SE IS E RANGE E'VAL(0) .. E'VAL(1);
54 BEGIN
55 FOR I IN E'VAL (1) .. E'VAL (4) LOOP
56 IF SE'PRED (I) /=
57 E'VAL (E'POS (I) - 1) THEN
58 FAILED ("INCORRECT " & STR & "'PRED(" &
59 E'IMAGE (I) & ")" );
60 END IF;
61 END LOOP;
63 FOR I IN E'VAL (0) .. E'VAL (3) LOOP
64 IF SE'SUCC (I) /=
65 E'VAL (E'POS (I) + 1) THEN
66 FAILED ("INCORRECT " & STR & "'SUCC(" &
67 E'IMAGE (I) & ")" );
68 END IF;
69 END LOOP;
71 END P;
73 PROCEDURE PE IS NEW P ( ENUM, "ENUM" );
74 PROCEDURE PN IS NEW P ( NEWENUM, "NEWENUM" );
76 BEGIN
77 PE;
78 PN;
79 END;
81 RESULT;
82 END C35502H;