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 that if different forms of a name are used in the default
28 -- expression of a discriminant part, the selector may be an operator
29 -- symbol or a character literal.
32 -- This transition test defines private types where their selectors in
33 -- the default expression of the discriminant parts at the full type
34 -- declarations are an operator and a literal, respectively.
35 -- The test also declares procedures that use an operator and a literal
36 -- as selectors in the formal parts.
38 -- Inspired by B63102A.ADA.
42 -- 25 Mar 96 SAIC Initial version for ACVC 2.1.
43 -- 26 Feb 97 PWB.CTA Removed use of function called before elaboration
52 type Int_Type
is range 1 .. 100;
53 type Enu_Type
is ('A', 'B', 'C', 'D');
55 type Private_Enu
(D
: Enu_Type
:= 'B') is private;
57 function "+" (X
, Y
: Int_Type
) return Int_Type
;
59 procedure Int_Proc
(P1
: in Int_Type
:= "+" (10, 15);
62 procedure Enu_Proc
(P1
: in Enu_Type
:= 'C';
67 type Private_Enu
(D
: Enu_Type
:= C631001_0
.'B') is -- OK.
72 -----------------------------------------------------------------
73 PE_Obj
: C631001_0
.Private_Enu
;
77 --==================================================================--
79 package body C631001_0
is
81 function "+" (X
, Y
: Int_Type
) return Int_Type
is
86 -----------------------------------------------------------------
87 procedure Int_Proc
(P1
: in Int_Type
:= C631001_0
."+" (10, 15); -- OK.
94 -----------------------------------------------------------------
95 procedure Enu_Proc
(P1
: in Enu_Type
:= C631001_0
.'C'; -- OK.
101 -----------------------------------------------------------------
105 ---------------------------------------------------------------------------
106 Int_Obj
: C631001_0
.Int_Type
:= 50;
107 Enu_Obj
: C631001_0
.Enu_Type
:= C631001_0
.'D';
109 -- Direct visibility to operator symbols
110 use type C631001_0
.Int_Type
;
111 use type C631001_0
.Enu_Type
;
115 Report
.Test
("C631001", "Check that if different forms of a name are " &
116 "used in the default expression of a discriminant part, " &
117 "the selector may be an operator symbol or a character " &
120 C631001_0
.Int_Proc
(P2
=> Int_Obj
);
122 if Int_Obj
/= 10 then
123 Report
.Failed
("Wrong result for Int_Obj");
126 C631001_0
.Enu_Proc
(P2
=> Enu_Obj
);
128 if Enu_Obj
/= 'C' then
129 Report
.Failed
("Wrong result for Enu_Obj");