Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c4 / c45411a.ada
blob0ac3b10a84854a906aa386225bbb75b2476d9e63
1 -- C45411A.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 UNARY "+" AND "-" YIELD CORRECT RESULTS FOR
27 -- PREDEFINED INTEGER OPERANDS.
29 -- HISTORY:
30 -- JET 01/25/88 CREATED ORIGINAL TEST.
31 -- PWN 10/27/95 REMOVED OUT OF RANGE STATIC VALUE CHECKS.
33 WITH REPORT; USE REPORT;
35 PROCEDURE C45411A IS
37 TYPE DT IS NEW INTEGER RANGE -3..3;
38 I1 : INTEGER := 1;
39 D1 : DT := 1;
41 BEGIN
42 TEST ("C45411A", "CHECK THAT UNARY ""+"" AND ""-"" YIELD " &
43 "CORRECT RESULTS FOR PREDEFINED INTEGER " &
44 "OPERANDS");
46 FOR I IN (1-2)..INTEGER(1) LOOP
47 IF "-"(RIGHT => I1) /= IDENT_INT(I) THEN
48 FAILED ("INCORRECT RESULT FOR ""-"" -" &
49 INTEGER'IMAGE(I+2));
50 END IF;
52 IF +I1 /= IDENT_INT(I1) THEN
53 FAILED ("INCORRECT RESULT FOR ""+"" -" &
54 INTEGER'IMAGE(I+2));
55 END IF;
56 I1 := I1 - 1;
57 END LOOP;
59 FOR I IN (1-2)..INTEGER(1) LOOP
60 IF -I /= IDENT_INT(0)-I THEN
61 FAILED ("INCORRECT RESULT FOR ""-"" -" &
62 INTEGER'IMAGE(I+5));
63 END IF;
65 IF "+"(RIGHT => IDENT_INT(I)) /= I THEN
66 FAILED ("INCORRECT RESULT FOR ""+"" -" &
67 INTEGER'IMAGE(I+5));
68 END IF;
69 END LOOP;
71 IF -1 /= IDENT_INT(1)-2 THEN
72 FAILED ("INCORRECT RESULT FOR ""-"" - 7");
73 END IF;
75 IF "-"(RIGHT => 0) /= IDENT_INT(0) THEN
76 FAILED ("INCORRECT RESULT FOR ""-"" - 8");
77 END IF;
79 IF "-"(RIGHT => "-"(RIGHT => 1)) /= IDENT_INT(1) THEN
80 FAILED ("INCORRECT RESULT FOR ""-"" - 9");
81 END IF;
83 IF "+"(RIGHT => 1) /= IDENT_INT(2)-1 THEN
84 FAILED ("INCORRECT RESULT FOR ""+"" - 7");
85 END IF;
87 IF +0 /= IDENT_INT(0) THEN
88 FAILED ("INCORRECT RESULT FOR ""+"" - 8");
89 END IF;
91 IF +(-1) /= IDENT_INT(1)-2 THEN
92 FAILED ("INCORRECT RESULT FOR ""+"" - 9");
93 END IF;
95 FOR I IN (1-2)..INTEGER(1) LOOP
96 IF "-"(RIGHT => D1) /= DT(IDENT_INT(I)) THEN
97 FAILED ("INCORRECT RESULT FOR ""-"" -" &
98 INTEGER'IMAGE(I+11));
99 END IF;
101 IF +D1 /= DT(IDENT_INT(INTEGER(D1))) THEN
102 FAILED ("INCORRECT RESULT FOR ""+"" -" &
103 INTEGER'IMAGE(I+11));
104 END IF;
105 D1 := D1 - 1;
106 END LOOP;
108 IF INTEGER'LAST + INTEGER'FIRST = 0 THEN
109 IF IDENT_INT(-INTEGER'LAST) /= INTEGER'FIRST THEN
110 FAILED ("-INTEGER'LAST IS NOT EQUAL TO INTEGER'FIRST");
111 END IF;
112 ELSE
113 IF IDENT_INT(-INTEGER'LAST) /= INTEGER'FIRST+1 THEN
114 FAILED ("-INTEGER'LAST IS NOT EQUAL TO INTEGER'FIRST+1");
115 END IF;
116 END IF;
118 RESULT;
120 END C45411A;