Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / c6 / c631001.a
blobf8b0c775b1538414502519efd5e9282f95b93471
1 -- C631001.A
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.
16 -- DISCLAIMER
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 --*
26 -- OBJECTIVE:
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.
31 -- TEST DESCRIPTION:
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.
41 -- CHANGE HISTORY:
42 -- 25 Mar 96 SAIC Initial version for ACVC 2.1.
43 -- 26 Feb 97 PWB.CTA Removed use of function called before elaboration
44 --!
46 with Report;
48 procedure C631001 is
50 package C631001_0 is
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);
60 P2 : out Int_Type);
62 procedure Enu_Proc (P1 : in Enu_Type := 'C';
63 P2 : out Enu_Type);
65 private
67 type Private_Enu (D : Enu_Type := C631001_0.'B') is -- OK.
68 record
69 C2 : Enu_Type := D;
70 end record;
72 -----------------------------------------------------------------
73 PE_Obj : C631001_0.Private_Enu;
75 end C631001_0;
77 --==================================================================--
79 package body C631001_0 is
81 function "+" (X, Y : Int_Type) return Int_Type is
82 begin
83 return 10;
84 end "+";
86 -----------------------------------------------------------------
87 procedure Int_Proc (P1 : in Int_Type := C631001_0."+" (10, 15); -- OK.
88 P2 : out Int_Type) is
90 begin
91 P2 := P1;
92 end Int_Proc;
94 -----------------------------------------------------------------
95 procedure Enu_Proc (P1 : in Enu_Type := C631001_0.'C'; -- OK.
96 P2 : out Enu_Type) is
97 begin
98 P2 := P1;
99 end Enu_Proc;
101 -----------------------------------------------------------------
103 end C631001_0;
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;
113 begin -- main
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 " &
118 "literal");
120 C631001_0.Int_Proc (P2 => Int_Obj);
122 if Int_Obj /= 10 then
123 Report.Failed ("Wrong result for Int_Obj");
124 end if;
126 C631001_0.Enu_Proc (P2 => Enu_Obj);
128 if Enu_Obj /= 'C' then
129 Report.Failed ("Wrong result for Enu_Obj");
130 end if;
132 Report.Result;
134 end C631001;