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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C92006A.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 TASK OBJECTS CAN BE INTERCHANGED BY ASSIGNMENT OF
26
-- CORRESPONDING ACCESS TYPE OBJECTS.
27
 
28
-- WEI  3/ 4/82
29
-- JWC 6/28/85   RENAMED FROM C920BIA-B.ADA
30
 
31
WITH REPORT;
32
 USE REPORT;
33
PROCEDURE C92006A IS
34
 
35
     TASK TYPE TT1 IS
36
          ENTRY E1;
37
          ENTRY E2;
38
     END TT1;
39
 
40
     TYPE ATT1 IS ACCESS TT1;
41
     POINTER_TT1_1, POINTER_TT1_2 : ATT1;
42
 
43
     SUBTYPE ARG IS NATURAL RANGE 0..9;
44
     SPYNUMB : NATURAL := 0;
45
 
46
     PROCEDURE PSPY_NUMB (DIGT: IN ARG) IS
47
     BEGIN
48
          SPYNUMB := 10*SPYNUMB+DIGT;
49
     END PSPY_NUMB;
50
 
51
     PROCEDURE PROC (P1, P2 : IN OUT ATT1) IS
52
     -- SWAP TASK OBJECTS P1, P2.
53
          SCRATCH : ATT1;
54
     BEGIN
55
          SCRATCH := P1;
56
          P1 := P2;
57
          P2 := SCRATCH;
58
 
59
          P1.E2;  -- ENTRY2 SECOND OBJECT.
60
          P2.E1;  -- VICE VERSA.
61
 
62
     END PROC;
63
 
64
     TASK BODY TT1 IS
65
     BEGIN
66
          ACCEPT E1 DO
67
               PSPY_NUMB (1);
68
          END E1;
69
          ACCEPT E2 DO
70
               PSPY_NUMB (2);
71
          END E2;
72
     END TT1;
73
 
74
BEGIN
75
 
76
     TEST ("C92006A", "INTERCHANGING TASK OBJECTS");
77
     POINTER_TT1_1 := NEW TT1;
78
     POINTER_TT1_2 := NEW TT1;
79
 
80
     POINTER_TT1_2.ALL.E1;
81
     PROC (POINTER_TT1_1, POINTER_TT1_2);
82
     POINTER_TT1_2.E2;        -- E2 OF FIRST OBJECT
83
-- EACH ENTRY OF EACH TASK OBJECT SHOULD HAVE BEEN CALLED.
84
 
85
     IF SPYNUMB /= 1212 THEN
86
          FAILED ("FAILURE TO SWAP TASK OBJECTS " &
87
                  "IN PROCEDURE PROC");
88
          COMMENT ("ACTUAL ORDER WAS:" & INTEGER'IMAGE(SPYNUMB));
89
     END IF;
90
 
91
     RESULT;
92
 
93
END C92006A;

powered by: WebSVN 2.1.0

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