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

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

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

powered by: WebSVN 2.1.0

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