1-- C45220A.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  '='  AND  '/='  PRODUCE CORRECT RESULTS ON
26--    BOOLEAN-TYPE OPERANDS (IN PARTICULAR, FOR OPERANDS HAVING
27--    DIFFERENT SUBTYPES).
28
29-- THIS TEST IS DERIVED FROM  C45201A.ADA .
30
31
32-- RM    27 OCTOBER 1980
33-- JWC 7/8/85   RENAMED TO -AB
34
35
36WITH  REPORT ;
37PROCEDURE  C45220A  IS
38
39
40     USE REPORT;
41
42     SUBTYPE  T1  IS  BOOLEAN RANGE FALSE..FALSE ;
43     SUBTYPE  T2  IS  BOOLEAN RANGE TRUE..TRUE ;
44     SUBTYPE  T3  IS  BOOLEAN RANGE FALSE..TRUE ;
45     SUBTYPE  T4  IS  T3 RANGE TRUE..TRUE ;
46
47     FVAR1  : T1 := FALSE ;
48     TVAR1  : T2 := TRUE ;
49     FVAR2  : T3 := FALSE ;
50     TVAR2  : T4 := TRUE ;
51
52     ERROR_COUNT : INTEGER := 0 ;   -- INITIAL VALUE ESSENTIAL
53
54     PROCEDURE  BUMP  IS
55     BEGIN
56          ERROR_COUNT := ERROR_COUNT + 1 ;
57     END BUMP ;
58
59
60BEGIN
61
62
63     TEST( "C45220A" , "CHECK THAT  '='  AND  '/='  PRODUCE CORRECT" &
64                       " RESULTS ON BOOLEAN-TYPE OPERANDS" ) ;
65
66     -- 32  CASES ( 2 * 2  ORDERED PAIRS OF OPERAND VALUES,
67     --               2    OPERATORS : '=' , '/=' ,
68     --               4    VARIABLE/LITERAL FOR LEFT OPERAND,
69     --                    VARIABLE/LITERAL FOR RIGHT OPERAND.
70
71
72     --  'BUMP'  MEANS  'BUMP THE ERROR COUNT'
73
74     FVAR1  := IDENT_BOOL( FALSE ) ;
75     TVAR1  := IDENT_BOOL( TRUE ) ;
76     FVAR2  := IDENT_BOOL( FALSE ) ;
77     TVAR2  := IDENT_BOOL( TRUE ) ;
78
79     IF  FALSE =  FALSE  THEN  NULL ;  ELSE  BUMP ;  END IF;
80     IF  FVAR1 =  FALSE  THEN  NULL ;  ELSE  BUMP ;  END IF;
81     IF  FALSE =  FVAR2  THEN  NULL ;  ELSE  BUMP ;  END IF;
82     IF  FVAR2 =  FVAR1  THEN  NULL ;  ELSE  BUMP ;  END IF;
83
84     IF  FALSE =  TRUE   THEN  BUMP ;                END IF;
85     IF  FVAR1 =  TRUE   THEN  BUMP ;                END IF;
86     IF  FALSE =  TVAR2  THEN  BUMP ;                END IF;
87     IF  FVAR2 =  TVAR1  THEN  BUMP ;                END IF;
88
89     IF  TRUE  =  FALSE  THEN  BUMP ;                END IF;
90     IF  TRUE  =  FVAR1  THEN  BUMP ;                END IF;
91     IF  TVAR2 =  FALSE  THEN  BUMP ;                END IF;
92     IF  TVAR1 =  FVAR2  THEN  BUMP ;                END IF;
93
94     IF  TRUE  =  TRUE   THEN  NULL ;  ELSE  BUMP ;  END IF;
95     IF  TVAR1 =  TRUE   THEN  NULL ;  ELSE  BUMP ;  END IF;
96     IF  TRUE  =  TVAR2  THEN  NULL ;  ELSE  BUMP ;  END IF;
97     IF  TVAR2 =  TVAR1  THEN  NULL ;  ELSE  BUMP ;  END IF;
98
99
100     IF  FALSE /= FALSE  THEN  BUMP ;                END IF;
101     IF  FVAR1 /= FALSE  THEN  BUMP ;                END IF;
102     IF  FALSE /= FVAR2  THEN  BUMP ;                END IF;
103     IF  FVAR2 /= FVAR1  THEN  BUMP ;                END IF;
104
105     IF  FALSE /= TRUE   THEN  NULL ;  ELSE  BUMP ;  END IF;
106     IF  FVAR1 /= TRUE   THEN  NULL ;  ELSE  BUMP ;  END IF;
107     IF  FALSE /= TVAR2  THEN  NULL ;  ELSE  BUMP ;  END IF;
108     IF  FVAR2 /= TVAR1  THEN  NULL ;  ELSE  BUMP ;  END IF;
109
110     IF  TRUE  /= FALSE  THEN  NULL ;  ELSE  BUMP ;  END IF;
111     IF  TRUE  /= FVAR1  THEN  NULL ;  ELSE  BUMP ;  END IF;
112     IF  TVAR2 /= FALSE  THEN  NULL ;  ELSE  BUMP ;  END IF;
113     IF  TVAR1 /= FVAR2  THEN  NULL ;  ELSE  BUMP ;  END IF;
114
115     IF  TRUE  /= TRUE   THEN  BUMP ;                END IF;
116     IF  TVAR1 /= TRUE   THEN  BUMP ;                END IF;
117     IF  TRUE  /= TVAR2  THEN  BUMP ;                END IF;
118     IF  TVAR2 /= TVAR1  THEN  BUMP ;                END IF;
119
120
121     IF  ERROR_COUNT /=0  THEN
122          FAILED( "(IN)EQUALITY OF BOOLEAN VALUES - FAILURE1" );
123     END IF;
124
125
126     RESULT ;
127
128
129END C45220A;
130