OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [cd/] [cd3015f.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CD3015F.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 FOR A DERIVED
27
--     TYPE CAN BE GIVEN IN THE VISIBLE OR PRIVATE PART OF A GENERIC
28
--     PACKAGE FOR A DERIVED TYPE DECLARED IN THE VISIBLE PART, WHERE
29
--     NO ENUMERATION CLAUSE HAS BEEN GIVEN FOR THE PARENT.
30
 
31
-- HISTORY
32
--     DHH 10/01/87 CREATED ORIGINAL TEST
33
--     DHH 03/27/89  CHANGED EXTENSION FROM '.DEP' TO '.ADA',CHANGED
34
--                   FROM 'A' TEST TO 'C' TEST AND ADDED CHECK FOR
35
--                   REPRESENTATION CLAUSE.
36
 
37
WITH REPORT; USE REPORT;
38
WITH ENUM_CHECK;            -- CONTAINS A CALL TO 'FAILED'.
39
PROCEDURE CD3015F IS
40
 
41
BEGIN
42
 
43
     TEST ("CD3015F", "CHECK THAT AN " &
44
                      "ENUMERATION REPRESENTATION CLAUSE FOR A " &
45
                      "DERIVED TYPE CAN BE GIVEN IN THE VISIBLE OR " &
46
                      "PRIVATE PART OF A GENERIC PACKAGE FOR A " &
47
                      "DERIVED TYPE DECLARED IN THE VISIBLE PART, " &
48
                      "WHERE NO ENUMERATION CLAUSE HAS BEEN GIVEN " &
49
                      "FOR THE PARENT");
50
 
51
     DECLARE
52
 
53
          GENERIC
54
          PACKAGE GENPACK IS
55
 
56
               TYPE MAIN IS (RED,BLUE,YELLOW,'R','B','Y');
57
 
58
               TYPE HUE IS NEW MAIN;
59
               TYPE NEWHUE IS NEW MAIN;
60
 
61
               FOR HUE USE (RED => 8, BLUE => 9, YELLOW => 10,
62
                     'R' => 11, 'B' => 12, 'Y' => 13);
63
 
64
          PRIVATE
65
               FOR NEWHUE USE (RED => 8, BLUE => 9, YELLOW => 10,
66
                     'R' => 11, 'B' => 12, 'Y' => 13);
67
 
68
               TYPE INT_HUE IS RANGE 8 .. 13;
69
               FOR INT_HUE'SIZE USE HUE'SIZE;
70
 
71
               TYPE INT_NEW IS RANGE 8 .. 13;
72
               FOR INT_NEW'SIZE USE NEWHUE'SIZE;
73
 
74
               PROCEDURE CHECK_HUE IS NEW ENUM_CHECK(HUE, INT_HUE);
75
               PROCEDURE CHECK_NEW IS NEW ENUM_CHECK(NEWHUE, INT_NEW);
76
 
77
          END GENPACK;
78
 
79
          PACKAGE BODY GENPACK IS
80
 
81
          BEGIN
82
               CHECK_HUE (RED, 8, "HUE");
83
               CHECK_HUE ('R', 11, "NEWHUE");
84
          END GENPACK;
85
 
86
          PACKAGE P IS NEW GENPACK;
87
 
88
     BEGIN
89
          NULL;
90
     END;
91
 
92
     RESULT;
93
END CD3015F;

powered by: WebSVN 2.1.0

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