3 -- Grant of Unlimited Rights
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
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.
27 -- Check pragma Reviewable.
28 -- Check that pragma Reviewable is accepted as a configuration pragma.
31 -- This test checks that pragma Reviewable is processed as a
32 -- configuration pragma. See CXH3001 for testing pragma Reviewable as
33 -- other than a configuration pragma.
36 -- The following files comprise this test:
41 -- APPLICABILITY CRITERIA:
42 -- This test is only applicable for a compiler attempting validation
43 -- for the Safety and Security Annex.
45 -- SPECIAL REQUIREMENTS
46 -- The implementation must process a configuration pragma which is not
47 -- part of any Compilation Unit; the method employed is implementation
52 -- 26 OCT 95 SAIC Initial version for 2.1
53 -- 07 JUN 96 SAIC Revised by reviewer request
54 -- 03 NOV 96 SAIC Documentation revision
56 -- 03 NOV 96 Keith Documentation revision
57 -- 27 AUG 99 RLB Removed result dependence on uninitialized object.
58 -- 30 AUG 99 RLB Repaired the above.
64 ----------------------------------------------------------------- CXH3003_0
68 type Enum is (Item,Stuff,Things);
70 type Int is range 0..256;
76 type Fix is delta 0.5 range -1.0..1.0;
78 type Root(Disc: Enum) is tagged record
82 type List is array(Unt) of Root(Stuff);
84 type A_List is access List;
85 type A_Proc is access procedure(R:Root);
89 function F return A_Proc;
91 Global_Variable : Boolean := False;
95 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
97 package body CXH3003_0 is
99 procedure P(R:Root) is
100 Warnable : Positive := 0; -- OPTIONAL WARNING
103 when Item => Report.Comment("Got Item");
104 when Stuff => Report.Comment("Got Stuff");
105 when Things => Report.Comment("Got Things");
107 if Report.Ident_Int( Warnable ) = 0 then
108 Global_Variable := not Global_Variable; -- known to be initialized
112 function F return A_Proc is
119 ----------------------------------------------------------------- CXH3003_1
121 package CXH3003_0.CXH3003_1 is
124 entry Set(Switch: Boolean);
125 function Enquire return Boolean;
134 end CXH3003_0.CXH3003_1;
136 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
138 package body CXH3003_0.CXH3003_1 is
142 entry Set(Switch: Boolean) when True is
147 function Enquire return Boolean is
158 exit when Global_Variable;
164 end CXH3003_0.CXH3003_1;
166 ------------------------------------------------------------------- CXH3003
169 with CXH3003_0.CXH3003_1;
170 procedure CXH30031 is
173 Report.Test("CXH3003", "Check pragma Reviewable as a configuration pragma");
177 Message : String := Report.Ident_Str( "Bad value encountered" );
180 A_Truth := Report.Ident_Bool( True ) or A_Truth; -- not initialized
182 Report.Comment ("True or Uninit = False");
183 A_Truth := Report.Ident_Bool (True);
185 A_Truth := Report.Ident_Bool (True);
186 -- We do this separately on each branch in order to insure that a
187 -- clever optimizer can find out little about this value. Ident_Bool
188 -- is supposed to be opaque to any optimizer.
191 when Constraint_Error | Program_Error =>
192 -- Possible results of accessing an uninitialized object.
193 A_Truth := Report.Ident_Bool (True);
196 CXH3003_0.CXH3003_1.PT.Set( A_Truth );
198 CXH3003_0.Global_Variable := A_Truth;
200 CXH3003_0.CXH3003_1.TT.Release; -- rendezvous with TT
202 while CXH3003_0.CXH3003_1.TT'Callable loop -- wait for TT to complete
206 if not CXH3003_0.CXH3003_1.PT.Enquire
207 or not CXH3003_0.Global_Variable then
208 Report.Failed(Message);