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

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

Line No. Rev Author Line
1 149 jeremybenn
-- C95090A.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 ARRAYS THAT ARE COMPONENTS OF RECORDS ARE PASSED CORRECTLY
26
-- TO ENTRIES.  SPECIFICALLY,
27
--   (A) CHECK ALL PARAMETER MODES.
28
 
29
-- GLH 7/25/85
30
 
31
WITH REPORT; USE REPORT;
32
PROCEDURE C95090A IS
33
 
34
BEGIN
35
     TEST ("C95090A", "CHECK THAT ARRAYS WHICH ARE COMPONENTS OF " &
36
                      "RECORDS ARE PASSED CORRECTLY TO ENTRIES");
37
 
38
     --------------------------------------------
39
 
40
     DECLARE   -- (A)
41
 
42
          TYPE ARRAY_TYPE IS ARRAY (POSITIVE RANGE <>) OF INTEGER;
43
          SUBTYPE ARRAY_SUBTYPE IS ARRAY_TYPE (1..IDENT_INT(5));
44
 
45
          TYPE RECORD_TYPE IS
46
               RECORD
47
                    I : INTEGER;
48
                    A : ARRAY_SUBTYPE;
49
               END RECORD;
50
 
51
          REC : RECORD_TYPE := (I => 23,
52
                                A => (1..3 => IDENT_INT(7), 4..5 => 9));
53
          BOOL : BOOLEAN;
54
 
55
          TASK T1 IS
56
               ENTRY E1 (ARR : ARRAY_TYPE);
57
          END T1;
58
 
59
          TASK BODY T1 IS
60
          BEGIN
61
               ACCEPT E1 (ARR : ARRAY_TYPE) DO
62
                    IF ARR /= (7, 7, 7, 9, 9) THEN
63
                         FAILED ("IN PARAMETER NOT PASSED CORRECTLY");
64
                    END IF;
65
                    IF ARR'FIRST /= IDENT_INT (1) OR
66
                       ARR'LAST /= IDENT_INT (5) THEN
67
                         FAILED ("WRONG BOUNDS FOR IN PARAMETER");
68
                    END IF;
69
               END E1;
70
          END T1;
71
 
72
          TASK T2 IS
73
               ENTRY E2 (ARR : IN OUT ARRAY_TYPE);
74
          END T2;
75
 
76
          TASK BODY T2 IS
77
          BEGIN
78
               ACCEPT E2 (ARR : IN OUT ARRAY_TYPE) DO
79
                    IF ARR /= (7, 7, 7, 9, 9) THEN
80
                         FAILED ("IN OUT PARAMETER NOT PASSED " &
81
                                 "CORRECTLY");
82
                    END IF;
83
                    IF ARR'FIRST /= IDENT_INT (1) OR
84
                       ARR'LAST /= IDENT_INT (5) THEN
85
                         FAILED ("WRONG BOUNDS FOR IN OUT PARAMETER");
86
                    END IF;
87
                    ARR := (ARR'RANGE => 5);
88
               END E2;
89
          END T2;
90
 
91
          TASK T3 IS
92
               ENTRY E3 (ARR : OUT ARRAY_TYPE);
93
          END T3;
94
 
95
          TASK BODY T3 IS
96
          BEGIN
97
               ACCEPT E3 (ARR : OUT ARRAY_TYPE) DO
98
                    IF ARR'FIRST /= IDENT_INT (1) OR
99
                       ARR'LAST /= IDENT_INT (5) THEN
100
                         FAILED ("WRONG BOUNDS FOR OUT PARAMETER");
101
                    END IF;
102
                    ARR := (ARR'RANGE => 3);
103
               END E3;
104
          END T3;
105
 
106
     BEGIN     -- (A)
107
 
108
          T1.E1 (REC.A);
109
          IF REC.A /= (7, 7, 7, 9, 9) THEN
110
               FAILED ("IN PARAM CHANGED BY PROCEDURE");
111
          END IF;
112
 
113
          T2.E2 (REC.A);
114
          IF REC.A /= (5, 5, 5, 5, 5) THEN
115
               FAILED ("IN OUT PARAM RETURNED INCORRECTLY");
116
          END IF;
117
 
118
          T3.E3 (REC.A);
119
          IF REC.A /= (3, 3, 3, 3, 3) THEN
120
               FAILED ("OUT PARAM RETURNED INCORRECTLY");
121
          END IF;
122
 
123
     END; -- (A)
124
 
125
     --------------------------------------------
126
 
127
     RESULT;
128
END C95090A;

powered by: WebSVN 2.1.0

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