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/] [cc/] [cc3606b.ada] - Blame information for rev 149

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CC3606B.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 ANY CONSTRAINTS SPECIFIED FOR THE ACTUAL
27
--     SUBPROGRAM'S PARAMETERS ARE USED IN PLACE OF THOSE
28
--     ASSOCIATED WITH THE FORMAL SUBPROGRAM'S PARAMETERS
29
--     (INCLUDING PARAMETERS SPECIFIED WITH A FORMAL GENERIC TYPE).
30
 
31
-- HISTORY:
32
--     LDC  06/30/88 CREATED ORIGINAL TEST.
33
--     PWN  05/31/96 Corrected spelling problems.
34
 
35
WITH REPORT; USE REPORT;
36
 
37
PROCEDURE CC3606B IS
38
 
39
     SUBTYPE ONE_TO_TEN IS
40
          INTEGER RANGE IDENT_INT (1) .. IDENT_INT (10);
41
     SUBTYPE ONE_TO_FIVE IS
42
          INTEGER RANGE IDENT_INT (1) .. IDENT_INT (5);
43
 
44
BEGIN
45
     TEST ( "CC3606B", "CHECK THAT ANY CONSTRAINTS SPECIFIED FOR " &
46
                       "THE ACTUAL SUBPROGRAM'S PARAMETERS ARE USED " &
47
                       "IN PLACE OF THOSE ASSOCIATED WITH THE " &
48
                       "FORMAL SUBPROGRAM'S PARAMETERS (INCLUDING " &
49
                       "PARAMETERS SPECIFIED WITH A FORMAL GENERIC " &
50
                       "TYPE)");
51
     DECLARE
52
          GENERIC
53
               BRIAN : IN OUT INTEGER;
54
               WITH PROCEDURE PASSED_PROC(LYNN :IN OUT ONE_TO_TEN);
55
          PACKAGE GEN IS
56
          END GEN;
57
 
58
          DOUG : INTEGER := 10;
59
 
60
          PACKAGE BODY GEN IS
61
          BEGIN
62
               PASSED_PROC(BRIAN);
63
               FAILED("WRONG CONSTRAINTS FOR ACTUAL PARAMETER IN GEN");
64
          EXCEPTION
65
               WHEN CONSTRAINT_ERROR =>
66
                    NULL;
67
               WHEN OTHERS =>
68
                    FAILED("OTHER EXCEPTION WAS RAISED FOR ACTUAL " &
69
                           "PARAMETER");
70
          END GEN;
71
 
72
          PROCEDURE PROC(JODIE : IN OUT ONE_TO_FIVE) IS
73
               JOHN : ONE_TO_TEN;
74
          BEGIN
75
               JOHN := IDENT_INT(JODIE);
76
          EXCEPTION
77
               WHEN OTHERS =>
78
                    FAILED("EXCEPTION RAISED INSIDE PROCEDURE");
79
          END PROC;
80
 
81
          PACKAGE GEN_PCK IS NEW GEN( DOUG, PROC);
82
 
83
     BEGIN
84
          NULL;
85
     END;
86
     DECLARE
87
          TYPE ENUM IS (DAYTON, BEAVERCREEK, CENTERVILLE, ENGLEWOOD,
88
                        FAIRBORN, HUBER_HEIGHTS, KETTERING, MIAMISBURG,
89
                        OAKWOOD, RIVERSIDE, TROTWOOD, WEST_CARROLLTON,
90
                        VANDALIA);
91
          SUBTYPE SUB_ENUM IS ENUM RANGE  CENTERVILLE..FAIRBORN;
92
 
93
          GENERIC
94
               TYPE T_TYPE IS (<>);
95
               BRIAN : T_TYPE;
96
               WITH FUNCTION PASSED_FUNC(LYNN : T_TYPE)
97
                    RETURN T_TYPE;
98
 
99
          PACKAGE GEN_TWO IS
100
          END GEN_TWO;
101
 
102
          DOUG : ENUM := ENUM'FIRST;
103
 
104
          PACKAGE BODY GEN_TWO IS
105
 
106
          DAVE : T_TYPE;
107
 
108
          BEGIN
109
               DAVE := PASSED_FUNC(BRIAN);
110
               FAILED("WRONG CONSTRAINTS FOR ACTUAL PARAMETER IN " &
111
                      "GEN_TWO");
112
          EXCEPTION
113
               WHEN CONSTRAINT_ERROR =>
114
                    NULL;
115
               WHEN OTHERS =>
116
                    FAILED("OTHER EXCEPTION WAS " &
117
                           "RAISED FOR ACTUAL " &
118
                           "PARAMETER");
119
          END GEN_TWO;
120
 
121
          FUNCTION FUNC(JODIE : SUB_ENUM) RETURN SUB_ENUM IS
122
          BEGIN
123
               RETURN ENUM'VAL(IDENT_INT(ENUM'POS(JODIE)));
124
          EXCEPTION
125
               WHEN OTHERS =>
126
                    FAILED("EXCEPTION RAISED INSIDE PROCEDURE");
127
          END FUNC;
128
 
129
          PACKAGE GEN_PCK_TWO IS NEW GEN_TWO( ENUM, DOUG, FUNC);
130
 
131
     BEGIN
132
          RESULT;
133
     END;
134
END CC3606B;

powered by: WebSVN 2.1.0

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