1-- CDD1001.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.
15--
16--                                    DISCLAIMER
17--
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--*
25--
26-- OBJECTIVE:
27--    Check that components of Stream_Element_Array are aliased.  (Defect
28--    Report 8652/0044).
29--
30-- APPLICABILITY CRITERIA:
31--    All implementations must attempt to compile this test.
32--
33--    For implementations for which Stream_Element'Size is a multiple of
34--    System.Storage_Unit, this test must execute.
35--
36--    For other implementations, if this test compiles without error messages
37--    at compilation, it must bind and execute.
38--
39-- PASS/FAIL CRITERIA:
40--    For implementations for which Stream_Element'Size is a multiple of
41--      System.Storage_Unit, this test must execute, report PASSED, and
42--      complete normally, otherwise the test FAILS.
43--
44--    For other implementations:
45--      PASSING behavior is:
46--        this test executes, reports PASSED, and completes normally
47--      or
48--        this test produces at least one error message at compilation, and
49--        the error message is associated with one of the items marked:
50--           -- N/A => ERROR.
51--
52--      All other behaviors are FAILING.
53--
54--
55-- CHANGE HISTORY:
56--    12 FEB 2001   PHL   Initial version
57--    15 MAR 2001   RLB   Readied for release.
58
59--!
60with Ada.Streams;
61use Ada.Streams;
62with Report;
63use Report;
64procedure CDD1001 is
65
66    type Acc is access all Stream_Element;
67
68    A : Stream_Element_Array
69	   (Stream_Element_Offset (Ident_Int (1)) ..
70	       Stream_Element_Offset (Ident_Int (10)));
71    B : array (A'Range) of Acc;
72begin
73    Test ("CDD1001",
74	  "Check that components of Stream_Element_Array are aliased");
75
76    for I in A'Range loop
77	A (I) := Stream_Element (Ident_Int (Integer (I)) * Ident_Int (3));
78    end loop;
79
80    for I in B'Range loop
81	B (I) := A (I)'Access;                                -- N/A => ERROR.
82    end loop;
83
84    for I in B'Range loop
85	if B (I).all /= Stream_Element
86			   (Ident_Int (Integer (I)) * Ident_Int (3)) then
87	    Failed ("Unable to build access values designating elements " &
88		    "of a Stream_Element_Array");
89	end if;
90    end loop;
91
92    Result;
93end CDD1001;
94
95