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/] [c64109g.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
-- C64109G.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 SLICES OF ARRAYS ARE PASSED CORRECTLY TO SUBPROGRAMS.
26
-- SPECIFICALLY,
27
--   (A) CHECK ALL PARAMETER MODES.
28
 
29
-- CPP 8/28/84
30
-- PWN 05/31/96  Corrected spelling problem.
31
 
32
WITH REPORT;  USE REPORT;
33
PROCEDURE C64109G IS
34
 
35
BEGIN
36
     TEST ("C64109G", "CHECK THAT SLICES OF ARRAYS ARE PASSED " &
37
           "CORRECTLY TO SUBPROGRAMS");
38
 
39
     --------------------------------------------
40
 
41
     DECLARE   -- (A)
42
 
43
          SUBTYPE SUBINT IS INTEGER RANGE 1..5;
44
          TYPE ARRAY_TYPE IS ARRAY (SUBINT RANGE <>) OF INTEGER;
45
          ARR : ARRAY_TYPE (1..5) := (1..3 => 7, 4..5 => 9);
46
          BOOL : BOOLEAN;
47
 
48
          PROCEDURE P1 (S : ARRAY_TYPE) IS
49
          BEGIN
50
               IF S(IDENT_INT(3)) /= 7 THEN
51
                    FAILED ("IN PARAMETER NOT PASSED CORRECTLY - (A)");
52
               END IF;
53
               IF S(4) /= 9 THEN
54
                    FAILED ("IN PARAMETER NOT PASSED CORRECTLY - (A)2");
55
               END IF;
56
          END P1;
57
 
58
          FUNCTION F1 (S : ARRAY_TYPE) RETURN BOOLEAN IS
59
          BEGIN
60
               IF S(3) /= 7 THEN
61
                    FAILED ("IN PARAMETER NOT PASSED CORRECTLY - (A)");
62
               END IF;
63
               IF S(IDENT_INT(4)) /= 9 THEN
64
                    FAILED ("IN PARAMETER NOT PASSED CORRECTLY - (A)2");
65
               END IF;
66
               RETURN TRUE;
67
          END F1;
68
 
69
          PROCEDURE P2 (S : IN OUT ARRAY_TYPE) IS
70
          BEGIN
71
               IF S(3) /= 7 THEN
72
                    FAILED ("IN OUT PARAM NOT PASSED CORRECTLY - (A)");
73
               END IF;
74
               IF S(4) /= 9 THEN
75
                    FAILED ("IN OUT PARAM NOT PASSED CORRECTLY - (A)2");
76
               END IF;
77
               FOR I IN 3 .. 4 LOOP
78
                    S(I) := 5;
79
               END LOOP;
80
          END P2;
81
 
82
          PROCEDURE P3 (S : OUT ARRAY_TYPE) IS
83
          BEGIN
84
               FOR I IN 3 .. 4 LOOP
85
                    S(I) := 3;
86
               END LOOP;
87
          END P3;
88
 
89
     BEGIN     -- (A)
90
 
91
          P1 (ARR(3..4));
92
          IF ARR(3) /= 7 THEN
93
               FAILED ("IN PARAM CHANGED BY PROCEDURE - (A)");
94
          END IF;
95
          IF ARR(4) /= 9 THEN
96
               FAILED ("IN PARAM CHANGED BY PROCEDURE - (A)2");
97
          END IF;
98
 
99
          BOOL := F1 (ARR(IDENT_INT(3)..IDENT_INT(4)));
100
          IF ARR(3) /= 7 THEN
101
               FAILED ("IN PARAM CHANGED BY FUNCTION - (A)");
102
          END IF;
103
          IF ARR(4) /= 9 THEN
104
               FAILED ("IN PARAM CHANGED BY FUNCTION - (A)2");
105
          END IF;
106
 
107
          P2 (ARR(3..4));
108
          FOR I IN 3 .. 4 LOOP
109
               IF ARR(I) /= 5 THEN
110
                    FAILED ("IN OUT PARAM RETURNED INCORRECTLY - (A)");
111
               END IF;
112
          END LOOP;
113
 
114
          P3 (ARR(IDENT_INT(3)..4));
115
          FOR I IN 3 .. 4 LOOP
116
               IF ARR(I) /= 3 THEN
117
                    FAILED ("OUT PARAM RETURNED INCORRECTLY - (A)");
118
               END IF;
119
          END LOOP;
120
 
121
     END;
122
 
123
     RESULT;
124
 
125
END C64109G;

powered by: WebSVN 2.1.0

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