-- C631001.A
|
-- C631001.A
|
--
|
--
|
-- Grant of Unlimited Rights
|
-- Grant of Unlimited Rights
|
--
|
--
|
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
|
-- 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
|
-- 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 in the software and documentation contained herein.
|
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
|
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
|
-- this public release, the Government intends to confer upon all
|
-- this public release, the Government intends to confer upon all
|
-- recipients unlimited rights equal to those held by the Government.
|
-- recipients unlimited rights equal to those held by the Government.
|
-- These rights include rights to use, duplicate, release or disclose the
|
-- These rights include rights to use, duplicate, release or disclose the
|
-- released technical data and computer software in whole or in part, in
|
-- 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
|
-- any manner and for any purpose whatsoever, and to have or permit others
|
-- to do so.
|
-- to do so.
|
--
|
--
|
-- DISCLAIMER
|
-- DISCLAIMER
|
--
|
--
|
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
|
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
|
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
|
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
|
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
|
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
|
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
|
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
|
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
|
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
|
-- PARTICULAR PURPOSE OF SAID MATERIAL.
|
-- PARTICULAR PURPOSE OF SAID MATERIAL.
|
--*
|
--*
|
--
|
--
|
-- OBJECTIVE:
|
-- OBJECTIVE:
|
-- Check that if different forms of a name are used in the default
|
-- Check that if different forms of a name are used in the default
|
-- expression of a discriminant part, the selector may be an operator
|
-- expression of a discriminant part, the selector may be an operator
|
-- symbol or a character literal.
|
-- symbol or a character literal.
|
--
|
--
|
-- TEST DESCRIPTION:
|
-- TEST DESCRIPTION:
|
-- This transition test defines private types where their selectors in
|
-- This transition test defines private types where their selectors in
|
-- the default expression of the discriminant parts at the full type
|
-- the default expression of the discriminant parts at the full type
|
-- declarations are an operator and a literal, respectively.
|
-- declarations are an operator and a literal, respectively.
|
-- The test also declares procedures that use an operator and a literal
|
-- The test also declares procedures that use an operator and a literal
|
-- as selectors in the formal parts.
|
-- as selectors in the formal parts.
|
--
|
--
|
-- Inspired by B63102A.ADA.
|
-- Inspired by B63102A.ADA.
|
--
|
--
|
--
|
--
|
-- CHANGE HISTORY:
|
-- CHANGE HISTORY:
|
-- 25 Mar 96 SAIC Initial version for ACVC 2.1.
|
-- 25 Mar 96 SAIC Initial version for ACVC 2.1.
|
-- 26 Feb 97 PWB.CTA Removed use of function called before elaboration
|
-- 26 Feb 97 PWB.CTA Removed use of function called before elaboration
|
--!
|
--!
|
|
|
with Report;
|
with Report;
|
|
|
procedure C631001 is
|
procedure C631001 is
|
|
|
package C631001_0 is
|
package C631001_0 is
|
|
|
type Int_Type is range 1 .. 100;
|
type Int_Type is range 1 .. 100;
|
type Enu_Type is ('A', 'B', 'C', 'D');
|
type Enu_Type is ('A', 'B', 'C', 'D');
|
|
|
type Private_Enu (D : Enu_Type := 'B') is private;
|
type Private_Enu (D : Enu_Type := 'B') is private;
|
|
|
function "+" (X, Y : Int_Type) return Int_Type;
|
function "+" (X, Y : Int_Type) return Int_Type;
|
|
|
procedure Int_Proc (P1 : in Int_Type := "+" (10, 15);
|
procedure Int_Proc (P1 : in Int_Type := "+" (10, 15);
|
P2 : out Int_Type);
|
P2 : out Int_Type);
|
|
|
procedure Enu_Proc (P1 : in Enu_Type := 'C';
|
procedure Enu_Proc (P1 : in Enu_Type := 'C';
|
P2 : out Enu_Type);
|
P2 : out Enu_Type);
|
|
|
private
|
private
|
|
|
type Private_Enu (D : Enu_Type := C631001_0.'B') is -- OK.
|
type Private_Enu (D : Enu_Type := C631001_0.'B') is -- OK.
|
record
|
record
|
C2 : Enu_Type := D;
|
C2 : Enu_Type := D;
|
end record;
|
end record;
|
|
|
-----------------------------------------------------------------
|
-----------------------------------------------------------------
|
PE_Obj : C631001_0.Private_Enu;
|
PE_Obj : C631001_0.Private_Enu;
|
|
|
end C631001_0;
|
end C631001_0;
|
|
|
--==================================================================--
|
--==================================================================--
|
|
|
package body C631001_0 is
|
package body C631001_0 is
|
|
|
function "+" (X, Y : Int_Type) return Int_Type is
|
function "+" (X, Y : Int_Type) return Int_Type is
|
begin
|
begin
|
return 10;
|
return 10;
|
end "+";
|
end "+";
|
|
|
-----------------------------------------------------------------
|
-----------------------------------------------------------------
|
procedure Int_Proc (P1 : in Int_Type := C631001_0."+" (10, 15); -- OK.
|
procedure Int_Proc (P1 : in Int_Type := C631001_0."+" (10, 15); -- OK.
|
P2 : out Int_Type) is
|
P2 : out Int_Type) is
|
|
|
begin
|
begin
|
P2 := P1;
|
P2 := P1;
|
end Int_Proc;
|
end Int_Proc;
|
|
|
-----------------------------------------------------------------
|
-----------------------------------------------------------------
|
procedure Enu_Proc (P1 : in Enu_Type := C631001_0.'C'; -- OK.
|
procedure Enu_Proc (P1 : in Enu_Type := C631001_0.'C'; -- OK.
|
P2 : out Enu_Type) is
|
P2 : out Enu_Type) is
|
begin
|
begin
|
P2 := P1;
|
P2 := P1;
|
end Enu_Proc;
|
end Enu_Proc;
|
|
|
-----------------------------------------------------------------
|
-----------------------------------------------------------------
|
|
|
end C631001_0;
|
end C631001_0;
|
|
|
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
Int_Obj : C631001_0.Int_Type := 50;
|
Int_Obj : C631001_0.Int_Type := 50;
|
Enu_Obj : C631001_0.Enu_Type := C631001_0.'D';
|
Enu_Obj : C631001_0.Enu_Type := C631001_0.'D';
|
|
|
-- Direct visibility to operator symbols
|
-- Direct visibility to operator symbols
|
use type C631001_0.Int_Type;
|
use type C631001_0.Int_Type;
|
use type C631001_0.Enu_Type;
|
use type C631001_0.Enu_Type;
|
|
|
begin -- main
|
begin -- main
|
|
|
Report.Test ("C631001", "Check that if different forms of a name are " &
|
Report.Test ("C631001", "Check that if different forms of a name are " &
|
"used in the default expression of a discriminant part, " &
|
"used in the default expression of a discriminant part, " &
|
"the selector may be an operator symbol or a character " &
|
"the selector may be an operator symbol or a character " &
|
"literal");
|
"literal");
|
|
|
C631001_0.Int_Proc (P2 => Int_Obj);
|
C631001_0.Int_Proc (P2 => Int_Obj);
|
|
|
if Int_Obj /= 10 then
|
if Int_Obj /= 10 then
|
Report.Failed ("Wrong result for Int_Obj");
|
Report.Failed ("Wrong result for Int_Obj");
|
end if;
|
end if;
|
|
|
C631001_0.Enu_Proc (P2 => Enu_Obj);
|
C631001_0.Enu_Proc (P2 => Enu_Obj);
|
|
|
if Enu_Obj /= 'C' then
|
if Enu_Obj /= 'C' then
|
Report.Failed ("Wrong result for Enu_Obj");
|
Report.Failed ("Wrong result for Enu_Obj");
|
end if;
|
end if;
|
|
|
Report.Result;
|
Report.Result;
|
|
|
end C631001;
|
end C631001;
|
|
|