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

Subversion Repositories openrisc_me

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C39007A.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
-- CHECK THAT PROGRAM_ERROR IS RAISED IF AN ATTEMPT IS MADE TO
26
-- INSTANTIATE A GENERIC UNIT WHOSE BODY HAS NOT BEEN ELABORATED.
27
-- CHECK THE FOLLOWING CASE:
28
--     A) A SIMPLE CASE WHERE THE GENERIC UNIT BODY OCCURS LATER IN
29
--        THE SAME DECLARATIVE PART.
30
 
31
-- TBN  9/12/86
32
 
33
WITH REPORT; USE REPORT;
34
PROCEDURE C39007A IS
35
 
36
BEGIN
37
     TEST ("C39007A", "CHECK THAT PROGRAM_ERROR IS RAISED IF AN " &
38
                      "ATTEMPT IS MADE TO INSTANTIATE A GENERIC " &
39
                      "UNIT WHOSE BODY HAS NOT BEEN ELABORATED, " &
40
                      "BUT OCCURS IN THE SAME DECLARATIVE PART");
41
 
42
     BEGIN
43
          IF EQUAL (1, 1) THEN
44
               DECLARE
45
                    GENERIC
46
                    PACKAGE P IS
47
                         A : INTEGER;
48
                         PROCEDURE ASSIGN (X : OUT INTEGER);
49
                    END P;
50
 
51
                    PACKAGE NEW_P IS NEW P;
52
 
53
                    PACKAGE BODY P IS
54
                         PROCEDURE ASSIGN (X : OUT INTEGER) IS
55
                         BEGIN
56
                              X := IDENT_INT (1);
57
                         END ASSIGN;
58
                    BEGIN
59
                         ASSIGN (A);
60
                    END P;
61
 
62
               BEGIN
63
                    NULL;
64
               END;
65
               FAILED ("PROGRAM_ERROR WAS NOT RAISED - 1");
66
          END IF;
67
 
68
     EXCEPTION
69
          WHEN PROGRAM_ERROR =>
70
               NULL;
71
          WHEN OTHERS =>
72
               FAILED ("UNEXPECTED EXCEPTION RAISED - 1");
73
     END;
74
 
75
------------------------------------------------------------------------
76
 
77
     BEGIN
78
          IF EQUAL (2, 2) THEN
79
               DECLARE
80
                    GENERIC
81
                    PROCEDURE ADD1 (X : IN OUT INTEGER);
82
 
83
                    PROCEDURE NEW_ADD1 IS NEW ADD1;
84
 
85
                    PROCEDURE ADD1 (X : IN OUT INTEGER) IS
86
                    BEGIN
87
                         X := X + IDENT_INT (1);
88
                    END ADD1;
89
               BEGIN
90
                    NULL;
91
               END;
92
               FAILED ("PROGRAM_ERROR WAS NOT RAISED - 2");
93
          END IF;
94
 
95
     EXCEPTION
96
          WHEN PROGRAM_ERROR =>
97
               NULL;
98
          WHEN OTHERS =>
99
               FAILED ("UNEXPECTED EXCEPTION RAISED - 2");
100
     END;
101
 
102
------------------------------------------------------------------------
103
 
104
     BEGIN
105
          IF EQUAL (3, 3) THEN
106
               DECLARE
107
                    GENERIC
108
                    FUNCTION INIT RETURN INTEGER;
109
 
110
                    FUNCTION NEW_INIT IS NEW INIT;
111
 
112
                    FUNCTION INIT RETURN INTEGER IS
113
                    BEGIN
114
                         RETURN (IDENT_INT (1));
115
                    END INIT;
116
               BEGIN
117
                    NULL;
118
               END;
119
               FAILED ("PROGRAM_ERROR WAS NOT RAISED - 3");
120
          END IF;
121
 
122
     EXCEPTION
123
          WHEN PROGRAM_ERROR =>
124
               NULL;
125
          WHEN OTHERS =>
126
               FAILED ("UNEXPECTED EXCEPTION RAISED - 3");
127
     END;
128
 
129
------------------------------------------------------------------------
130
 
131
     RESULT;
132
END C39007A;

powered by: WebSVN 2.1.0

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