OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [cd/] [cd1009m.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CD1009M.ADA
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.
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
-- OBJECTIVE:
26
--     CHECK THAT AN ENUMERATION REPRESENTATION CLAUSE MAY BE GIVEN IN
27
--     THE VISIBLE OR PRIVATE PART OF A PACKAGE FOR AN ENUMERATION
28
--     TYPE DECLARED IN THE VISIBLE PART OF THE SAME PACKAGE.
29
 
30
-- HISTORY:
31
--     VCL  10/08/87  CREATED ORIGINAL TEST.
32
--     DHH  03/29/89  CHANGE FROM 'A' TEST TO 'C' TEST AND FROM '.DEP'
33
--                    '.ADA'.  ADDED CHECK ON REPRESENTATION CLAUSES.
34
 
35
WITH REPORT; USE REPORT;
36
WITH ENUM_CHECK;                       -- CONTAINS A CALL TO 'FAILED'.
37
PROCEDURE CD1009M IS
38
BEGIN
39
     TEST ("CD1009M", "AN ENUMERATION REPRESENTATION CLAUSE MAY BE " &
40
                      "GIVEN IN THE VISIBLE OR PRIVATE PART OF A " &
41
                      "PACKAGE FOR AN ENUMERATION TYPE DECLARED IN " &
42
                      "THE VISIBLE PART OF THE SAME PACKAGE");
43
     DECLARE
44
          PACKAGE PACK IS
45
               TYPE CHECK_TYPE_1 IS (A0, A2, A4, A8);
46
               FOR CHECK_TYPE_1 USE (A0 => 0,
47
                                     A2 => 1,
48
                                     A4 => 2,
49
                                     A8 => 3);
50
 
51
               TYPE CHECK_TYPE_2 IS (A0, A2, A4, A8);
52
               TYPE INT1 IS RANGE 0 .. 3;
53
               FOR INT1'SIZE USE CHECK_TYPE_1'SIZE;
54
 
55
               TYPE INT2 IS RANGE 2 .. 8;
56
 
57
          PRIVATE
58
               FOR CHECK_TYPE_2 USE (A0 => 2,
59
                                     A2 => 4,
60
                                     A4 => 6,
61
                                     A8 => 8);
62
               FOR INT2'SIZE USE CHECK_TYPE_2'SIZE;
63
 
64
               PROCEDURE CHECK_1 IS NEW ENUM_CHECK(CHECK_TYPE_1, INT1);
65
               PROCEDURE CHECK_2 IS NEW ENUM_CHECK(CHECK_TYPE_2, INT2);
66
 
67
          END PACK;
68
 
69
          PACKAGE BODY PACK IS
70
          BEGIN
71
               CHECK_1 (A4, 2, "CHECK_TYPE_1");
72
               CHECK_2 (A8, 8, "CHECK_TYPE_2");
73
          END PACK;
74
 
75
          USE PACK;
76
     BEGIN
77
          NULL;
78
     END;
79
 
80
     RESULT;
81
END CD1009M;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.