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/] [c6/] [c64109f.ada] - Blame information for rev 309

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

Line No. Rev Author Line
1 294 jeremybenn
-- C64109F.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 SUBPROGRAMS.  SPECIFICALLY,
27
--   (F) CHECK THAT A FORMAL PARAMETER CAN BE USED AS AN ACTUAL IN
28
--       ANOTHER CALL.
29
 
30
-- CPP 8/20/84
31
 
32
WITH REPORT;  USE REPORT;
33
PROCEDURE C64109F IS
34
 
35
BEGIN
36
     TEST ("C64109F", "CHECK THAT ARRAYS WHICH ARE COMPONENTS OF " &
37
           "RECORDS ARE PASSED CORRECTLY TO SUBPROGRAMS - " &
38
           "FORMAL AS AN ACTUAL");
39
 
40
     DECLARE   -- (F)
41
 
42
          TYPE ARRAY_TYPE IS ARRAY (POSITIVE RANGE <>) OF INTEGER;
43
          SUBTYPE ARRAY_SUBTYPE IS
44
                    ARRAY_TYPE (IDENT_INT(1)..IDENT_INT(5));
45
          TYPE RECORD_TYPE IS
46
               RECORD
47
                    I : INTEGER;
48
                    A : ARRAY_SUBTYPE;
49
               END RECORD;
50
          REC : RECORD_TYPE := (I => 23,
51
                                A => (1..3 => 7, 4..5 => 9));
52
          BOOL : BOOLEAN;
53
 
54
          PROCEDURE P_CALLED (A : IN OUT ARRAY_TYPE) IS
55
          BEGIN
56
               IF A /= (7, 7, 7, 9, 9) THEN
57
                    FAILED ("IN OUT PARAM NOT RECEIVED CORRECTLY");
58
               END IF;
59
               IF A'FIRST /= 1 OR A'LAST /= 5 THEN
60
                    FAILED ("BOUNDS WRONG - IN OUT");
61
               END IF;
62
               A := (6, 6, 6, 6, 6);
63
          END P_CALLED;
64
 
65
          PROCEDURE P (A : IN OUT ARRAY_TYPE) IS
66
          BEGIN
67
               P_CALLED (A);
68
          END P;
69
 
70
          FUNCTION F_CALLED (A : ARRAY_SUBTYPE) RETURN BOOLEAN IS
71
               GOOD : BOOLEAN;
72
          BEGIN
73
               GOOD := (A = (7, 7, 7, 9, 9));
74
               IF NOT GOOD THEN
75
                    FAILED ("IN PARAMETER NOT RECEIVED CORRECTLY");
76
               END IF;
77
               IF A'FIRST /= 1 OR A'LAST /= IDENT_INT(5) THEN
78
                    FAILED ("BOUNDS WRONG - FUNCTION");
79
               END IF;
80
               RETURN GOOD;
81
          END F_CALLED;
82
 
83
          FUNCTION F (A : ARRAY_TYPE) RETURN BOOLEAN IS
84
          BEGIN
85
               RETURN (F_CALLED (A));
86
          END F;
87
 
88
          PROCEDURE P_OUT_CALLED (A : OUT ARRAY_TYPE) IS
89
          BEGIN
90
               IF A'FIRST /= 1 OR A'LAST /= 5 THEN
91
                    FAILED ("BOUNDS WRONG - OUT");
92
               END IF;
93
               A := (8, 8, 8, 8, 8);
94
          END P_OUT_CALLED;
95
 
96
          PROCEDURE P_OUT (A : OUT ARRAY_TYPE) IS
97
          BEGIN
98
               P_OUT_CALLED (A);
99
               A := (9, 9, 9, 9, 9);
100
          END P_OUT;
101
 
102
     BEGIN     -- (F)
103
 
104
          P (REC.A);
105
          IF REC.A /= (6, 6, 6, 6, 6) THEN
106
               FAILED ("IN OUT PARAM NOT RETURNED CORRECTLY");
107
          END IF;
108
 
109
          REC.A := (7, 7, 7, 9, 9);
110
          BOOL := F (REC.A);
111
          IF NOT BOOL THEN
112
               FAILED ("IN PARAM NOT RETURNED CORRECTLY");
113
          END IF;
114
 
115
          REC.A := (7, 7, 7, 9, 9);
116
          P_OUT (REC.A);
117
          IF REC.A /= (9, 9, 9, 9, 9) THEN
118
               FAILED ("OUT PARAM NOT RETURNED CORRECTLY - 2");
119
          END IF;
120
 
121
     END; -- (F)
122
 
123
     --------------------------------------------
124
 
125
     RESULT;
126
END C64109F;

powered by: WebSVN 2.1.0

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