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/] [c4/] [c43207d.ada] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 jeremybenn
-- C43207D.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
-- FOR A MULTIDIMENSIONAL AGGREGATE OF THE FORM (F..G => (H..I => J)),
26
-- CHECK THAT:
27
 
28
--     D) J IS EVALUATED ONCE FOR EACH COMPONENT (ZERO TIMES IF THE
29
--        ARRAY IS NULL).
30
 
31
-- EG  01/18/84
32
 
33
WITH REPORT;
34
 
35
PROCEDURE C43207D IS
36
 
37
     USE REPORT;
38
 
39
BEGIN
40
 
41
     TEST("C43207D", "CHECK THAT THE EVALUATION OF A MULTI" &
42
                     "DIMENSIONAL AGGREGATE OF THE FORM "   &
43
                     "(F..G => (H..I = J)) IS PERFORMED "   &
44
                     "CORRECTLY");
45
 
46
     DECLARE
47
 
48
          TYPE CHOICE_INDEX IS (F, G, H, I, J);
49
          TYPE CHOICE_CNTR  IS ARRAY(CHOICE_INDEX) OF INTEGER;
50
 
51
          CNTR : CHOICE_CNTR := (CHOICE_INDEX => 0);
52
 
53
          SUBTYPE SINT IS INTEGER RANGE 1 .. 8;
54
          TYPE T0 IS ARRAY(SINT RANGE <>, SINT RANGE <>) OF INTEGER;
55
 
56
          FUNCTION CALC (A : CHOICE_INDEX; B : INTEGER)
57
                         RETURN INTEGER IS
58
          BEGIN
59
               CNTR(A) := CNTR(A) + 1;
60
               RETURN IDENT_INT(B);
61
          END CALC;
62
 
63
     BEGIN
64
 
65
CASE_D :  BEGIN
66
 
67
     CASE_D1 : DECLARE
68
                    D1 : T0(8 .. 4, 5 .. 1);
69
               BEGIN
70
                    CNTR := (CHOICE_INDEX => 0);
71
                    D1 := (8 .. 4 => (5 .. 1 => CALC(J,2)));
72
                    IF CNTR(J) /= 0 THEN
73
                         FAILED("CASE D1 : INCORRECT NUMBER " &
74
                                "OF EVALUATIONS. J EVALUATED" &
75
                                INTEGER'IMAGE(CNTR(J)) & " TIMES");
76
                    END IF;
77
               EXCEPTION
78
                    WHEN OTHERS =>
79
                         FAILED("CASE D1 : EXCEPTION RAISED");
80
               END CASE_D1;
81
 
82
     CASE_D2 : DECLARE
83
                    D2 : T0(8 .. 4, 5 .. 1);
84
               BEGIN
85
                    CNTR := (CHOICE_INDEX => 0);
86
                    D2 := (CALC(F,8) .. CALC(G,4) =>
87
                              (CALC(H,5) .. CALC(I,1) => CALC(J,2)));
88
                    IF CNTR(J) /= 0 THEN
89
                         FAILED("CASE D2 : INCORRECT NUMBER " &
90
                                "OF EVALUATIONS. J EVALUATED" &
91
                                INTEGER'IMAGE(CNTR(J)) & " TIMES");
92
                    END IF;
93
               EXCEPTION
94
                    WHEN OTHERS =>
95
                         FAILED("CASE D2 : EXCEPTION RAISED");
96
               END CASE_D2;
97
 
98
     CASE_D3 : DECLARE
99
                    D3 : T0(3 .. 5, 1 .. 2);
100
               BEGIN
101
                    CNTR := (CHOICE_INDEX => 0);
102
                    D3 := (3 .. 5 => (1 .. 2 => CALC(J,2)));
103
                    IF CNTR(J) /= 6 THEN
104
                         FAILED("CASE D3 : INCORRECT NUMBER " &
105
                                "OF EVALUATIONS. J EVALUATED" &
106
                                INTEGER'IMAGE(CNTR(J)) & " TIMES");
107
                    END IF;
108
               EXCEPTION
109
                    WHEN OTHERS =>
110
                         FAILED("CASE D3 : EXCEPTION RAISED");
111
               END CASE_D3;
112
 
113
     CASE_D4 : DECLARE
114
                    D4 : T0(1 .. 2, 5 .. 7);
115
               BEGIN
116
                    CNTR := (CHOICE_INDEX => 0);
117
                    D4 := (CALC(F,1) .. CALC(G,2) =>
118
                              (CALC(H,5) .. CALC(I,7) => CALC(J,2)));
119
                    IF CNTR(J) /= 6 THEN
120
                         FAILED("CASE D4 : INCORRECT NUMBER " &
121
                                "OF EVALUATIONS. J EVALUATED" &
122
                                INTEGER'IMAGE(CNTR(J)) & " TIMES");
123
                    END IF;
124
               EXCEPTION
125
                    WHEN OTHERS =>
126
                         FAILED("CASE D4 : EXCEPTION RAISED");
127
               END CASE_D4;
128
 
129
          END CASE_D;
130
 
131
     END;
132
 
133
     RESULT;
134
 
135
END C43207D;

powered by: WebSVN 2.1.0

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