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/] [cd/] [cd2c11a.tst] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
--CD2C11A.TST
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
--     IF A TASK STORAGE SIZE SPECIFICATION IS GIVEN FOR A TASK
27
--     TYPE, THEN OPERATIONS ON VALUES OF THE TASK TYPE ARE NOT
28
--     AFFECTED.
29
 
30
-- MACRO SUBSTITUTION:
31
--     $TASK_STORAGE_SIZE IS THE NUMBER OF STORAGE_UNITS REQUIRED FOR
32
--     THE ACTIVATION OF A TASK.
33
 
34
-- HISTORY
35
--     DHH 09/24/87  CREATED ORIGINAL TEST.
36
--     RJW 07/06/88  REVISED THE TEST TO REMOVE UNINITIALIZED 'IN OUT'
37
--                   PARAMETER.  CHANGED EXTENSION TO 'TST'.
38
 
39
WITH REPORT; USE REPORT;
40
PROCEDURE CD2C11A IS
41
 
42
    TASK_STORAGE_SIZE : CONSTANT := $TASK_STORAGE_SIZE;
43
 
44
BEGIN
45
 
46
     TEST ("CD2C11A", "IF A TASK STORAGE SIZE SPECIFICATION IS " &
47
                      "GIVEN FOR A TASK TYPE, THEN OPERATIONS " &
48
                      "ON VALUES OF THE TASK TYPE ARE NOT AFFECTED");
49
 
50
     DECLARE
51
          PACKAGE PACK IS
52
 
53
               TYPE FLT IS DIGITS 1;
54
 
55
               TASK TYPE TTYPE IS
56
                    ENTRY ADD(J :IN INTEGER; K : IN OUT INTEGER);
57
                    ENTRY MULT(Y : IN FLT; Z : IN OUT FLT);
58
               END TTYPE;
59
 
60
 
61
               M : INTEGER := 81;
62
               N : INTEGER := 0;
63
               V,W : FLT RANGE 1.0..512.0 := 2.0;
64
 
65
               FOR TTYPE'STORAGE_SIZE USE TASK_STORAGE_SIZE;
66
 
67
               T : TTYPE;
68
 
69
          END PACK;
70
 
71
          PACKAGE BODY PACK IS
72
               FUNCTION IDENT_FLT(FT : FLT) RETURN FLT IS
73
               BEGIN
74
                    IF EQUAL(5,5) THEN
75
                         RETURN FT;
76
                    ELSE
77
                         RETURN 0.0;
78
                    END IF;
79
               END IDENT_FLT;
80
 
81
               TASK BODY TTYPE IS
82
                    ITEMP : INTEGER := 0;
83
                    FTEMP : FLT := 0.0;
84
               BEGIN
85
                    ACCEPT ADD(J :IN INTEGER; K : IN OUT INTEGER) DO
86
                         ITEMP := J;
87
                         IF EQUAL(3,3) THEN
88
                              K := ITEMP;
89
                         ELSE
90
                              K := 0;
91
                         END IF;
92
                    END ADD;
93
                    ACCEPT MULT(Y : IN FLT; Z : IN OUT FLT) DO
94
                         FTEMP := Y;
95
                         IF EQUAL(3,3) THEN
96
                              Z := FTEMP;
97
                         ELSE
98
                              Z := 0.0;
99
                         END IF;
100
                    END MULT;
101
               END TTYPE;
102
 
103
               PROCEDURE TEST_TASK(G : IN TTYPE;
104
                                 S : IN  FLT; T : IN OUT FLT) IS
105
                    R : FLT := 4.0;
106
               BEGIN
107
                    IF NOT (G'CALLABLE) OR G'TERMINATED THEN
108
                         FAILED("TASK INSIDE PROCEDURE IS SHOWING " &
109
                                "WRONG VALUE FOR 'CALLABLE OR " &
110
                                "'TERMINATED");
111
                    END IF;
112
                    G.MULT(S,T);
113
               END TEST_TASK;
114
 
115
          BEGIN
116
 
117
               IF TTYPE'STORAGE_SIZE < IDENT_INT(TASK_STORAGE_SIZE) THEN
118
                    FAILED("ACTUAL 'STORAGE_SIZE USED IS SMALLER " &
119
                           "THAN SIZE REQUESTED");
120
               END IF;
121
 
122
               T.ADD(M,N);
123
 
124
               IF M /= IDENT_INT(N) THEN
125
                    FAILED("TASK CALL PARAMETERS NOT EQUAL");
126
               END IF;
127
 
128
               V := IDENT_FLT(13.0);
129
               TEST_TASK(T,V,W);
130
               IF V /= IDENT_FLT(W)  THEN
131
                    FAILED("TASK AS PARAMETER FAILED");
132
               END IF;
133
 
134
          END PACK;
135
     BEGIN
136
          NULL;
137
     END;
138
 
139
     RESULT;
140
END CD2C11A;

powered by: WebSVN 2.1.0

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