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/] [c91004b.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C91004B.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 A TASK (TYPE) IDENTIFIER, WHEN USED WITHIN ITS OWN
27
--     BODY, REFERS TO THE EXECUTING TASK.
28
 
29
--      TEST USING IDENTIFIER IN ABORT STATEMENT, AS AN EXPRESSION IN
30
--      A MEMBERSHIP TEST, AND THE PREFIX OF 'CALLABLE AND
31
--      'TERMINATED.
32
 
33
-- HISTORY:
34
--     WEI  3/ 4/82  CREATED ORIGINAL TEST.
35
--     RJW 11/13/87  RENAMED TEST FROM C910BDA.ADA.  ADDED CHECKS FOR
36
--                   MEMBERSHIP TEST, AND 'CALLABLE AND 'TERMINATED
37
--                   ATTRIBUTES.
38
 
39
WITH REPORT;  USE REPORT;
40
PROCEDURE C91004B IS
41
 
42
     TYPE I0 IS RANGE 0..1;
43
     SUBTYPE ARG IS NATURAL RANGE 0..9;
44
     SPYNUMB : NATURAL := 0;
45
 
46
     TASK TYPE TT1 IS
47
          ENTRY E1 (P1 : IN I0; P2 : ARG);
48
          ENTRY BYE;
49
     END TT1;
50
 
51
     SUBTYPE SUB_TT1 IS TT1;
52
 
53
     OBJ_TT1 : ARRAY (NATURAL RANGE 1..2) OF TT1;
54
 
55
     PROCEDURE PSPY_NUMB (DIGT: IN ARG) IS
56
     BEGIN
57
          SPYNUMB := 10*SPYNUMB+DIGT;
58
     END PSPY_NUMB;
59
 
60
     TASK BODY TT1 IS
61
     BEGIN
62
          IF TT1 NOT IN SUB_TT1 THEN
63
               FAILED ("INCORRECT RESULTS FOR MEMBERSHIP TEST");
64
          END IF;
65
 
66
          IF NOT TT1'CALLABLE THEN
67
               FAILED ("INCORRECT RESULTS FOR 'CALLABLE");
68
          END IF;
69
 
70
          IF TT1'TERMINATED THEN
71
               FAILED ("INCORRECT RESULTS FOR 'TERMINATED");
72
          END IF;
73
 
74
          ACCEPT E1 (P1 : IN I0; P2 : ARG) DO
75
               IF P1 = 1 THEN
76
                    ABORT TT1;
77
                    ACCEPT BYE;    -- WILL DEADLOCK IF NOT ABORTED.
78
               END IF;
79
               PSPY_NUMB (ARG (P2));
80
          END E1;
81
 
82
     END TT1;
83
 
84
BEGIN
85
 
86
     TEST ("C91004B", "TASK IDENTIFIER IN OWN BODY");
87
 
88
     BEGIN
89
          OBJ_TT1 (1).E1 (1,1);
90
          FAILED ("NO TASKING_ERROR RAISED");
91
-- ABORT DURING RENDEVOUS RAISES TASKING ERROR
92
     EXCEPTION
93
          WHEN TASKING_ERROR =>
94
               NULL;
95
          WHEN OTHERS =>
96
               FAILED ("OTHER EXCEPTION RAISED");
97
     END;
98
 
99
     OBJ_TT1 (2).E1 (0,2);
100
 
101
     IF SPYNUMB /= 2 THEN
102
          FAILED ("WRONG TASK OBJECT REFERENCED");
103
          COMMENT ("ACTUAL ORDER WAS:" & INTEGER'IMAGE(SPYNUMB));
104
     END IF;
105
 
106
     RESULT;
107
 
108
END C91004B;

powered by: WebSVN 2.1.0

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