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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C93007A.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 IF AN ATTEMPT IS MADE TO ACTIVATE A TASK BEFORE ITS
27
--     BODY HAS BEEN ELABORATED, THE TASK IS COMPLETED AND "PROGRAM_
28
--     ERROR" (RATHER THAN "TASKING_ERROR") IS RAISED.
29
 
30
-- HISTORY:
31
--     DHH 03/16/88 CREATED ORIGINAL TEST.
32
 
33
WITH REPORT; USE REPORT;
34
PROCEDURE C93007A IS
35
 
36
BEGIN
37
 
38
     TEST("C93007A", "CHECK THAT IF AN ATTEMPT IS MADE TO ACTIVATE " &
39
                     "A TASK BEFORE ITS BODY HAS BEEN ELABORATED, " &
40
                     "THE TASK IS COMPLETED AND ""PROGRAM_ERROR"" " &
41
                     "(RATHER THAN ""TASKING_ERROR"") IS RAISED");
42
 
43
     DECLARE
44
          TASK TYPE PROG_ERR IS
45
               ENTRY START;
46
          END PROG_ERR;
47
 
48
          TYPE REC IS
49
               RECORD
50
                    B : PROG_ERR;
51
               END RECORD;
52
 
53
          TYPE ACC IS ACCESS PROG_ERR;
54
 
55
          PACKAGE P IS
56
               OBJ : REC;
57
          END P;
58
 
59
          PACKAGE BODY P IS
60
          BEGIN
61
               FAILED("EXCEPTION NOT RAISED - 1");
62
               OBJ.B.START;
63
          EXCEPTION
64
               WHEN PROGRAM_ERROR =>
65
                    NULL;
66
               WHEN TASKING_ERROR =>
67
                    FAILED("TASKING ERROR RAISED INCORRECTLY");
68
               WHEN OTHERS =>
69
                    FAILED("UNEXPECTED EXCEPTION RAISED");
70
          END P;
71
 
72
          PACKAGE Q IS
73
               OBJ : ACC;
74
          END Q;
75
 
76
          PACKAGE BODY Q IS
77
          BEGIN
78
               OBJ := NEW PROG_ERR;
79
               FAILED("EXCEPTION NOT RAISED - 2");
80
               OBJ.START;
81
          EXCEPTION
82
               WHEN PROGRAM_ERROR =>
83
                    NULL;
84
               WHEN TASKING_ERROR =>
85
                    FAILED("ACCESS TASKING ERROR RAISED INCORRECTLY");
86
               WHEN OTHERS =>
87
                    FAILED("ACCESS UNEXPECTED EXCEPTION RAISED");
88
          END;
89
 
90
          TASK BODY PROG_ERR IS
91
          BEGIN
92
               ACCEPT START DO
93
                    IF TRUE THEN
94
                         COMMENT("IRRELEVANT");
95
                    END IF;
96
               END START;
97
          END PROG_ERR;
98
     BEGIN
99
          NULL;
100
     END; -- DECLARE
101
 
102
     RESULT;
103
 
104
EXCEPTION
105
     WHEN PROGRAM_ERROR =>
106
          FAILED("PROGRAM_ERROR RAISED AT INCORRECT POSITION");
107
          RESULT;
108
 
109
     WHEN OTHERS =>
110
          FAILED("UNEXPECTED EXCEPTION RAISED");
111
          RESULT;
112
 
113
END C93007A;

powered by: WebSVN 2.1.0

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