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/] [c9/] [c95085n.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C95085N.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 CONSTRAINT_ERROR IS RAISED AFTER AN ENTRY CALL FOR THE
26
-- CASE OF A PRIVATE TYPE IMPLEMENTED AS A SCALAR TYPE WHERE THE VALUE
27
-- OF THE FORMAL PARAMETER DOES NOT BELONG TO THE SUBTYPE OF THE ACTUAL
28
-- PARAMETER.
29
 
30
-- JWC 10/29/85
31
-- JRK 1/15/86      ENSURE THAT EXCEPTION RAISED AFTER CALL, NOT BEFORE
32
--                  CALL.
33
 
34
WITH REPORT; USE REPORT;
35
PROCEDURE C95085N IS
36
 
37
BEGIN
38
     TEST ("C95085N", "CHECK THAT PRIVATE TYPE (SCALAR) RAISES " &
39
                      "CONSTRAINT_ERROR AFTER CALL WHEN FORMAL " &
40
                      "PARAMETER VALUE IS NOT IN ACTUAL'S SUBTYPE");
41
 
42
     DECLARE
43
 
44
          CALLED : BOOLEAN := FALSE;
45
 
46
          PACKAGE P IS
47
               TYPE T IS PRIVATE;
48
               DC : CONSTANT T;
49
 
50
               GENERIC PACKAGE PP IS
51
               END PP;
52
          PRIVATE
53
               TYPE T IS NEW INTEGER;
54
               DC : CONSTANT T := -1;
55
          END P;
56
 
57
          TASK TSK IS
58
               ENTRY E (X : OUT P.T);
59
          END TSK;
60
 
61
          TASK BODY TSK IS
62
          BEGIN
63
               SELECT
64
                    ACCEPT E (X : OUT P.T) DO
65
                         CALLED := TRUE;
66
                         X := P.DC;
67
                    END E;
68
               OR
69
                    TERMINATE;
70
               END SELECT;
71
          EXCEPTION
72
               WHEN OTHERS =>
73
                    FAILED ("EXCEPTION RAISED IN TASK BODY");
74
          END TSK;
75
 
76
          GENERIC
77
               Y : IN OUT P.T;
78
          PACKAGE CALL IS
79
          END CALL;
80
 
81
          PACKAGE BODY CALL IS
82
          BEGIN
83
               TSK.E (Y);
84
               FAILED ("EXCEPTION NOT RAISED AFTER RETURN");
85
          EXCEPTION
86
               WHEN CONSTRAINT_ERROR =>
87
                    IF NOT CALLED THEN
88
                         FAILED ("EXCEPTION RAISED BEFORE CALL");
89
                    END IF;
90
               WHEN OTHERS =>
91
                    FAILED ("WRONG EXCEPTION RAISED");
92
          END CALL;
93
 
94
          PACKAGE BODY P IS
95
               Z : T RANGE 0..1 := 0;
96
               PACKAGE BODY PP IS
97
                    PACKAGE CALL_Q IS NEW CALL (Z);
98
               END PP;
99
          END P;
100
 
101
     BEGIN
102
 
103
          BEGIN
104
               DECLARE
105
                    PACKAGE CALL_Q_NOW IS NEW P.PP;    -- START HERE.
106
               BEGIN
107
                    NULL;
108
               END;
109
          EXCEPTION
110
               WHEN OTHERS =>
111
                    FAILED ("WRONG HANDLER INVOKED");
112
          END;
113
 
114
     END;
115
 
116
     RESULT;
117
END C95085N;

powered by: WebSVN 2.1.0

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