1-- C49025A.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 CERTAIN ATTRIBUTES CAN BE USED IN STATIC EXPRESSIONS
26-- SUCH AS: 'SUCC, 'PRED, 'POS, 'VAL, 'AFT, 'DELTA, 'DIGITS, 'FIRST,
27--'FORE, 'LAST, 'MACHINE_EMAX, 'MACHINE_EMIN, 'MACHINE_MANTISSA,
28--'MACHINE_OVERFLOWS, 'MACHINE_RADIX, 'MACHINE_ROUNDS, 'SIZE, 'SMALL, 'WIDTH.
29
30-- L.BROWN  10/07/86
31-- PWN 01/31/95  REMOVED INCONSISTENCIES WITH ADA 9X.
32
33WITH REPORT; USE REPORT;
34
35PROCEDURE  C49025A  IS
36
37     TYPE ENUM IS (RED,BLUE,GREEN,BLACK);
38     TYPE FIX IS DELTA 0.125 RANGE 0.0 .. 20.0;
39     TYPE FLT IS DIGITS 3 RANGE 0.0 .. 25.0;
40     TYPE INT IS RANGE 1 .. 100;
41     TYPE TINT1 IS RANGE 1 .. ENUM'POS(BLUE);
42     TYPE TFLT IS DIGITS FIX'AFT RANGE 0.0 .. 10.0;
43     TYPE TFIX2 IS DELTA FIX'DELTA RANGE 0.0 .. 5.0;
44     TYPE TFLT1 IS DIGITS FLT'DIGITS;
45     TYPE ITN IS RANGE 0 .. INT'FIRST;
46     TYPE TINT2 IS RANGE 1 .. FIX'FORE;
47     TYPE TFLT3 IS DIGITS 3 RANGE 5.0 .. FLT'LAST;
48     CON3 : CONSTANT := FLT'MACHINE_EMAX;
49     TYPE TINT3 IS RANGE FLT'MACHINE_EMIN .. 1;
50     CON4 : CONSTANT := FLT'MACHINE_MANTISSA;
51     TYPE TINT4 IS RANGE 1 .. FLT'MACHINE_RADIX;
52     CON6 : CONSTANT := INT'SIZE;
53     TYPE TFIX5 IS DELTA 0.125 RANGE 0.0 .. FIX'SMALL;
54     TYPE TINT6 IS RANGE 1 .. ENUM'WIDTH;
55     OBJ1 : INTEGER := 1;
56     CAS_OBJ : BOOLEAN := TRUE;
57
58BEGIN
59
60     TEST("C49025A","CHECK THAT CERTAIN ATTRIBUTES CAN "&
61                    "BE USED IN STATIC EXPRESSIONS.");
62
63     CASE CAS_OBJ IS
64          WHEN (ENUM'PRED(BLUE) = ENUM'(RED)) =>
65               OBJ1 := 2;
66          WHEN OTHERS =>
67               FAILED("INCORRECT VALUE RETURNED FOR ATTRIBUTE 1");
68     END CASE;
69     CAS_OBJ := TRUE;
70
71     CASE CAS_OBJ IS
72          WHEN (ENUM'SUCC(RED) = ENUM'(BLUE)) =>
73               OBJ1 := 3;
74          WHEN OTHERS =>
75               FAILED("INCORRECT VALUE RETURNED FOR ATTRIBUTE 2");
76     END CASE;
77     CAS_OBJ := TRUE;
78
79     CASE CAS_OBJ IS
80          WHEN (ENUM'VAL(3) = ENUM'(BLACK)) =>
81               OBJ1 := 4;
82          WHEN OTHERS =>
83               FAILED("INCORRECT VALUE RETURNED FOR ATTRIBUTE 3");
84     END CASE;
85     CAS_OBJ := TRUE;
86
87     CASE CAS_OBJ IS
88          WHEN (TRUE OR FLT'MACHINE_OVERFLOWS) =>
89               OBJ1 := 5;
90          WHEN OTHERS =>
91               FAILED("INCORRECT VALUE RETURNED FOR ATTRIBUTE 4");
92     END CASE;
93     CAS_OBJ := FALSE;
94
95     CASE CAS_OBJ IS
96          WHEN (FALSE AND FIX'MACHINE_ROUNDS) =>
97               OBJ1 := 6;
98          WHEN OTHERS =>
99               FAILED("INCORRECT VALUE RETURNED FOR ATTRIBUTE 5");
100     END CASE;
101
102     RESULT;
103
104END C49025A;
105