-- LXH40022.AM -- -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- -- OBJECTIVE: -- Check that pragma Restrictions (using the restrictions defined -- in Annex H) applies to all units in a partition. -- Check that the application of the configuration pragma Restrictions -- with the specific restriction: -- No_Allocators -- disallows allocators in the units previously compiled into -- the program library. -- -- TEST DESCRIPTION: -- See LXH4012.AM for comparisons to related tests. -- -- ----------------------------- This fails at link time. (L test) -- | Unit that violates pragma | -- - - - - - - - - - - - - - - - -- | Config pragma | -- - - - - - - - - - - - - - - - -- | OK unit. | -- - - - - - - - - - - - - - - - -- | Main withs both units | -- ----------------------------- -- -- SPECIAL REQUIREMENTS: -- This test must be built in a single partition. -- The implementation must process a configuration pragma which is not -- part of any Compilation Unit; the method employed is implementation -- defined. -- The configuration pragma must be processed after LXH40020.A has -- been processed. -- To build this test: -- 1) Compile LXH40020.A -- 2) Compile LXH40021.A -- 3) Compile LXH40022.AM -- 4) Attempt to build an executable image: LXH4002 -- 5) If an executable image results, run it. -- -- TEST FILES: -- This test consists of the following files: -- -- LXH40020.A -- LXH40021.A -- => LXH40022.AM -- -- APPLICABILITY CRITERIA: -- This test is only applicable for a compiler attempting validation -- for the Safety and Security Annex. -- -- PASS/FAIL CRITERIA: -- The test passes if: -- A compile time error is generated indicating that the restiction -- has been violated. -- A linker error is generated because the restriction has been -- violated. -- The test fails if: -- An executable image is linked. -- -- -- CHANGE HISTORY: -- 20 MAR 96 SAIC Initial version -- 05 NOV 96 SAIC Restructured for release 2.1 -- 29 JUN 98 EDS Changed main procedure name. --! ----------------------------------------------------------------- LXH4002_1 package LXH4002_1 is type Item; type List_P is access all Item; type Item is record Data : Natural; Next : List_P; end record; procedure Build_OK_List; end LXH4002_1; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- package body LXH4002_1 is Item_A, Item_B : aliased Item; List_C, List_D : List_P; procedure Build_OK_List is begin List_C := Item_A'Access; -- OK List_C.Next := Item_B'Access; -- OK List_D := Item_A'Unchecked_Access; -- OK List_D.Next := Item_B'Unchecked_Access; -- OK end Build_OK_List; begin List_D := Item_A'Unchecked_Access; end LXH4002_1; ------------------------------------------------------------------- LXH40022 with LXH4002_0; with LXH4002_1; procedure LXH40022 is begin LXH4002_1.Build_OK_List; LXH4002_0.Build_OK_List; end LXH40022;