-- C380001.A
|
-- C380001.A
|
--
|
--
|
-- Grant of Unlimited Rights
|
-- Grant of Unlimited Rights
|
--
|
--
|
-- The Ada Conformity Assessment Authority (ACAA) holds unlimited
|
-- The Ada Conformity Assessment Authority (ACAA) holds unlimited
|
-- rights in the software and documentation contained herein. Unlimited
|
-- rights in the software and documentation contained herein. Unlimited
|
-- rights are the same as those granted by the U.S. Government for older
|
-- rights are the same as those granted by the U.S. Government for older
|
-- parts of the Ada Conformity Assessment Test Suite, and are defined
|
-- parts of the Ada Conformity Assessment Test Suite, and are defined
|
-- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
|
-- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
|
-- intends to confer upon all recipients unlimited rights equal to those
|
-- intends to confer upon all recipients unlimited rights equal to those
|
-- held by the ACAA. These rights include rights to use, duplicate,
|
-- held by the ACAA. These rights include rights to use, duplicate,
|
-- release or disclose the released technical data and computer software
|
-- release or disclose the released technical data and computer software
|
-- in whole or in part, in any manner and for any purpose whatsoever, and
|
-- in whole or in part, in any manner and for any purpose whatsoever, and
|
-- to have or permit others to do so.
|
-- to have or permit others 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 ACAA MAKES NO EXPRESS OR IMPLIED
|
-- DISCLOSED ARE AS IS. THE ACAA 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 checks are made properly when a per-object expression contains
|
-- Check that checks are made properly when a per-object expression contains
|
-- an attribute whose prefix denotes the current instance of the type.
|
-- an attribute whose prefix denotes the current instance of the type.
|
-- (Defect Report 8652/0002, as reflected in Technical Corrigendum 1,
|
-- (Defect Report 8652/0002, as reflected in Technical Corrigendum 1,
|
-- RM95 3.8(18/1)).
|
-- RM95 3.8(18/1)).
|
--
|
--
|
-- CHANGE HISTORY:
|
-- CHANGE HISTORY:
|
-- 9 FEB 2001 PHL Initial version.
|
-- 9 FEB 2001 PHL Initial version.
|
-- 29 JUN 2002 RLB Readied for release.
|
-- 29 JUN 2002 RLB Readied for release.
|
--
|
--
|
--!
|
--!
|
with Ada.Exceptions;
|
with Ada.Exceptions;
|
use Ada.Exceptions;
|
use Ada.Exceptions;
|
with Report;
|
with Report;
|
use Report;
|
use Report;
|
procedure C380001 is
|
procedure C380001 is
|
|
|
type Negative is range Integer'First .. -1;
|
type Negative is range Integer'First .. -1;
|
|
|
type R1 is
|
type R1 is
|
record
|
record
|
C : Negative := Negative (Ident_Int (R1'Size));
|
C : Negative := Negative (Ident_Int (R1'Size));
|
end record;
|
end record;
|
|
|
|
|
type R2;
|
type R2;
|
|
|
type R3 (D1 : access R2; D2 : Natural) is limited null record;
|
type R3 (D1 : access R2; D2 : Natural) is limited null record;
|
|
|
type R2 is limited
|
type R2 is limited
|
record
|
record
|
C : R3 (R2'Access, Ident_Int (-1));
|
C : R3 (R2'Access, Ident_Int (-1));
|
end record;
|
end record;
|
|
|
begin
|
begin
|
Test ("C380001", "Check that checks are made properly when a " &
|
Test ("C380001", "Check that checks are made properly when a " &
|
"per-object expression contains an attribute whose " &
|
"per-object expression contains an attribute whose " &
|
"prefix denotes the current instance of the type");
|
"prefix denotes the current instance of the type");
|
begin
|
begin
|
declare
|
declare
|
X : R1;
|
X : R1;
|
begin
|
begin
|
Failed
|
Failed
|
("No exception raised when evaluating a per-object expression " &
|
("No exception raised when evaluating a per-object expression " &
|
"containing an attribute - 1");
|
"containing an attribute - 1");
|
end;
|
end;
|
exception
|
exception
|
when Constraint_Error =>
|
when Constraint_Error =>
|
null;
|
null;
|
when E: others =>
|
when E: others =>
|
Failed ("Exception " & Exception_Name (E) &
|
Failed ("Exception " & Exception_Name (E) &
|
" raised - " & Exception_Information (E) & " - 1");
|
" raised - " & Exception_Information (E) & " - 1");
|
end;
|
end;
|
|
|
declare
|
declare
|
type A is access R1;
|
type A is access R1;
|
X : A;
|
X : A;
|
begin
|
begin
|
X := new R1;
|
X := new R1;
|
Failed ("No exception raised when evaluating a per-object expression " &
|
Failed ("No exception raised when evaluating a per-object expression " &
|
"containing an attribute - 2");
|
"containing an attribute - 2");
|
exception
|
exception
|
when Constraint_Error =>
|
when Constraint_Error =>
|
null;
|
null;
|
when E: others =>
|
when E: others =>
|
Failed ("Exception " & Exception_Name (E) &
|
Failed ("Exception " & Exception_Name (E) &
|
" raised - " & Exception_Information (E) & " - 2");
|
" raised - " & Exception_Information (E) & " - 2");
|
end;
|
end;
|
|
|
begin
|
begin
|
declare
|
declare
|
X : R2;
|
X : R2;
|
begin
|
begin
|
Failed
|
Failed
|
("No exception raised when elaborating a per-object constraint " &
|
("No exception raised when elaborating a per-object constraint " &
|
"containing an attribute - 3");
|
"containing an attribute - 3");
|
end;
|
end;
|
exception
|
exception
|
when Constraint_Error =>
|
when Constraint_Error =>
|
null;
|
null;
|
when E: others =>
|
when E: others =>
|
Failed ("Exception " & Exception_Name (E) &
|
Failed ("Exception " & Exception_Name (E) &
|
" raised - " & Exception_Information (E) & " - 3");
|
" raised - " & Exception_Information (E) & " - 3");
|
end;
|
end;
|
|
|
declare
|
declare
|
type A is access R2;
|
type A is access R2;
|
X : A;
|
X : A;
|
begin
|
begin
|
X := new R2;
|
X := new R2;
|
Failed
|
Failed
|
("No exception raised when evaluating a per-object constraint " &
|
("No exception raised when evaluating a per-object constraint " &
|
"containing an attribute - 4");
|
"containing an attribute - 4");
|
exception
|
exception
|
when Constraint_Error =>
|
when Constraint_Error =>
|
null;
|
null;
|
when E: others =>
|
when E: others =>
|
Failed ("Exception " & Exception_Name (E) &
|
Failed ("Exception " & Exception_Name (E) &
|
" raised - " & Exception_Information (E) & " - 4");
|
" raised - " & Exception_Information (E) & " - 4");
|
end;
|
end;
|
|
|
Result;
|
Result;
|
end C380001;
|
end C380001;
|
|
|