Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/ada/acats/tests/l/la140102.am @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 -- LA140102.AM | |
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 -- | |
26 -- OBJECTIVE: | |
27 -- Check that a compilation unit may not depend semantically | |
28 -- on two different versions of the same compilation unit. | |
29 -- Check the case where a task body depends on a package | |
30 -- specification. | |
31 -- | |
32 -- TEST DESCRIPTION: | |
33 -- This test compiles a package spec, a generic package | |
34 -- with a body containing a task with a body that withs the | |
35 -- first package spec, and a main procedure that withs the | |
36 -- generic package and calls the task. Then, a new version | |
37 -- of the package spec is compiled (in a separate file, simulating | |
38 -- editing and modification of the unit). Unless automatic | |
39 -- recompilation is supported, this test should fail to link. | |
40 -- Otherwise, the test should recompile and link the correct | |
41 -- version of the package spec and report "PASSED" at | |
42 -- execution time. | |
43 -- | |
44 -- SPECIAL REQUIREMENTS: | |
45 -- To build this test: | |
46 -- 1) Compile the file LA140100 (and include the results in the | |
47 -- program library). | |
48 -- 2) Compile the file LA140101 (and include the results in the | |
49 -- program library). | |
50 -- 3) Compile the file LA140102 (and include the results in the | |
51 -- program library). | |
52 -- 4) Compile the file LA140103 (and include the results in the | |
53 -- program library). | |
54 -- 5) Attempt to build an executable image. | |
55 -- 6) If an executable image results, run it. | |
56 -- | |
57 -- TEST FILES: | |
58 -- This test consists of the following files: | |
59 -- LA140100.A | |
60 -- LA140101.A | |
61 -- -> LA140102.AM | |
62 -- LA140103.A | |
63 -- | |
64 -- PASS/FAIL CRITERIA: | |
65 -- The test passes if a link time error message reports that | |
66 -- LA14010_1.INC_TASK is missing or obsolete and no executable image | |
67 -- results. The test also passes if an executable image is produced | |
68 -- and reports "PASSED" (in the case where the implementation supports | |
69 -- automatic recompilation). | |
70 -- | |
71 -- | |
72 -- CHANGE HISTORY: | |
73 -- 01 MAY 95 ACVC 1.12 LA5008O baseline version | |
74 -- 29 JUN 95 SAIC Initial version | |
75 -- 29 FEB 96 SAIC First revision after review | |
76 -- 17 NOV 96 SAIC Modified unit names and prologue to conform | |
77 -- to coding conventions. | |
78 -- | |
79 --! | |
80 | |
81 with Report; use Report; | |
82 with LA14010_1; | |
83 | |
84 procedure LA140102 is | |
85 subtype scalar_type is integer range 0..100; | |
86 TC_val : scalar_type := 0; | |
87 package Gen_pack is new LA14010_1(scalar_type); | |
88 begin | |
89 Test ("LA14010", "Check that a compilation unit may not " & | |
90 "depend semantically on two different " & | |
91 "versions of the same compilation unit. " & | |
92 "Check the case where a task body depends " & | |
93 "on a package specification"); | |
94 | |
95 Gen_pack.inc(TC_val); | |
96 | |
97 if TC_val = 1 then | |
98 Failed ("Old package specification used"); | |
99 elsif TC_val /= 10 then | |
100 Failed ("Incorrect value returned"); | |
101 end if; | |
102 | |
103 Result; | |
104 end LA140102; |