Reset branch to trunk.
[official-gcc.git] / trunk / gcc / testsuite / ada / acats / tests / cc / cc51008.a
blobb95ae6cf04db866e49c97d26889571c170d27423
1 -- CC51008.A
2 --
3 -- Grant of Unlimited Rights
4 --
5 -- The Ada Conformity Assessment Authority (ACAA) holds unlimited
6 -- rights in the software and documentation contained herein. Unlimited
7 -- rights are the same as those granted by the U.S. Government for older
8 -- parts of the Ada Conformity Assessment Test Suite, and are defined
9 -- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
10 -- intends to confer upon all recipients unlimited rights equal to those
11 -- held by the ACAA. These rights include rights to use, duplicate,
12 -- release or disclose the released technical data and computer software
13 -- in whole or in part, in any manner and for any purpose whatsoever, and
14 -- to have or permit others to do so.
16 -- DISCLAIMER
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19 -- DISCLOSED ARE AS IS. THE ACAA 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 --*
26 -- OBJECTIVE:
27 -- Check that operations are inherited for a formal derived type whose
28 -- ancestor is also a formal type as described in the corrigendum.
29 -- (Defect Report 8652/0038, as reflected in Technical Corrigendum 1,
30 -- RM95 12.5.1(21/1)).
32 -- CHANGE HISTORY:
33 -- 29 Jan 2001 PHL Initial version.
34 -- 30 Apr 2002 RLB Readied for release.
36 --!
37 package CC51008_0 is
39 type R0 is
40 record
41 C : Float;
42 end record;
44 procedure S (X : R0);
46 end CC51008_0;
48 with Report;
49 use Report;
50 package body CC51008_0 is
51 procedure S (X : R0) is
52 begin
53 Comment ("CC51008_0.S called");
54 end S;
55 end CC51008_0;
57 with CC51008_0;
58 generic
59 type F1 is new CC51008_0.R0;
60 type F2 is new F1;
61 package CC51008_1 is
62 procedure G (O1 : F1; O2 : F2);
63 end CC51008_1;
65 package body CC51008_1 is
66 procedure G (O1 : F1; O2 : F2) is
67 begin
68 S (O1);
69 S (O2);
70 end G;
71 end CC51008_1;
73 with CC51008_0;
74 package CC51008_2 is
75 type R2 is new CC51008_0.R0;
76 procedure S (X : out R2);
77 end CC51008_2;
79 with Report;
80 use Report;
81 package body CC51008_2 is
82 procedure S (X : out R2) is
83 begin
84 Failed ("CC51008_2.S called");
85 end S;
86 end CC51008_2;
88 with CC51008_2;
89 package CC51008_3 is
90 type R3 is new CC51008_2.R2;
91 procedure S (X : R3);
92 end CC51008_3;
94 with Report;
95 use Report;
96 package body CC51008_3 is
97 procedure S (X : R3) is
98 begin
99 Failed ("CC51008_3.S called");
100 end S;
101 end CC51008_3;
103 with CC51008_1;
104 with CC51008_2;
105 with CC51008_3;
106 with Report;
107 use Report;
108 procedure CC51008 is
110 package Inst is new CC51008_1 (CC51008_2.R2,
111 CC51008_3.R3);
113 X2 : constant CC51008_2.R2 := (C => 2.0);
114 X3 : constant CC51008_3.R3 := (C => 3.0);
116 begin
117 Test ("CC51008",
118 "Check that operations are inherited for a formal derived " &
119 "type whose ancestor is also a formal type as described in " &
120 "RM95 12.5.1(21/1)");
121 Inst.G (X2, X3);
122 Result;
123 end CC51008;