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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C64109C.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
--   (C) CHECK RECORDS HAVING A DISCRIMINANT, WITH MORE THAN ONE ARRAY
28
--       COMPONENT, WHERE THE BOUNDS OF THE ARRAY DEPEND ON THE
29
--       DISCRIMINANT.
30
 
31
-- CPP 8/20/84
32
 
33
WITH REPORT;  USE REPORT;
34
PROCEDURE C64109C IS
35
 
36
BEGIN
37
     TEST ("C64109C", "CHECK THAT ARRAYS WHICH ARE COMPONENTS OF " &
38
           "RECORDS ARE PASSED CORRECTLY TO SUBPROGRAMS - " &
39
           "RECORDS WITH DISCRIMINANTS");
40
 
41
     DECLARE   -- (C)
42
 
43
          SUBTYPE SUBINT IS INTEGER RANGE 1..6;
44
          TYPE ARRAY_TYPE IS ARRAY (SUBINT RANGE <>) OF INTEGER;
45
          TYPE RECORD_TYPE (BOUND : INTEGER) IS
46
               RECORD
47
                    B : BOOLEAN;
48
                    A : ARRAY_TYPE (1..BOUND);
49
                    AA : ARRAY_TYPE (BOUND..6);
50
               END RECORD;
51
          REC : RECORD_TYPE (BOUND => IDENT_INT(4)) :=
52
                               (BOUND => 4,
53
                                B => TRUE,
54
                                A => (1..IDENT_INT(4) => 6),
55
                                AA => (4..6 => 8));
56
          BOOL : BOOLEAN;
57
 
58
          PROCEDURE P1 (ARR : ARRAY_TYPE) IS
59
          BEGIN
60
               IF ARR /= (6, 6, 6, 6) THEN
61
                    FAILED ("IN PARAM NOT PASSED CORRECTLY");
62
               END IF;
63
 
64
               IF ARR'FIRST /= 1 OR ARR'LAST /= IDENT_INT(4) THEN
65
                    FAILED ("WRONG BOUNDS - IN PARAMETER");
66
               END IF;
67
          END P1;
68
 
69
          FUNCTION F1 (ARR : ARRAY_TYPE) RETURN BOOLEAN IS
70
          BEGIN
71
               IF ARR /= (6, 6, 6, 6) THEN
72
                    FAILED ("IN PARAM NOT PASSED CORRECTLY TO FN");
73
               END IF;
74
 
75
               IF ARR'FIRST /= 1 OR ARR'LAST /= IDENT_INT(4) THEN
76
                    FAILED ("WRONG BOUNDS - IN PARAMETER FOR FN");
77
               END IF;
78
               RETURN TRUE;
79
          END F1;
80
 
81
          PROCEDURE P2 (ARR : IN OUT ARRAY_TYPE) IS
82
          BEGIN
83
               IF ARR /= (8, 8, 8) THEN
84
                    FAILED ("IN OUT PARAM NOT PASSED CORRECTLY");
85
               END IF;
86
 
87
               IF ARR'FIRST /= 4 OR ARR'LAST /= IDENT_INT(6) THEN
88
                    FAILED ("WRONG BOUNDS - IN OUT PARAMETER");
89
               END IF;
90
 
91
               ARR := (ARR'RANGE => 10);
92
          END P2;
93
 
94
          PROCEDURE P3 (ARR : OUT ARRAY_TYPE) IS
95
          BEGIN
96
               IF ARR'FIRST /= 1 OR ARR'LAST /= IDENT_INT(4) THEN
97
                    FAILED ("WRONG BOUNDS - OUT PARAMETER");
98
               END IF;
99
               ARR := (ARR'RANGE => 4);
100
          END P3;
101
 
102
     BEGIN     -- (C)
103
 
104
          P1 (REC.A);
105
          IF REC.A /= (6, 6, 6, 6) THEN
106
               FAILED ("IN PARAM CHANGED BY PROCEDURE");
107
          END IF;
108
 
109
          BOOL := F1 (REC.A);
110
          IF REC.A /= (6, 6, 6, 6) THEN
111
               FAILED ("IN PARAM CHANGED BY FUNCTION");
112
          END IF;
113
 
114
          P2 (REC.AA);
115
          IF REC.AA /= (10, 10, 10) THEN
116
               FAILED ("IN OUT PARAM NOT RETURNED CORRECTLY");
117
          END IF;
118
 
119
          P3 (REC.A);
120
          IF REC.A /= (4, 4, 4, 4) THEN
121
               FAILED ("OUT PARAM NOT RETURNED CORRECTLY");
122
          END IF;
123
 
124
     END; -- (C)
125
 
126
     RESULT;
127
END C64109C;

powered by: WebSVN 2.1.0

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