OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c3/] [c32001c.ada] - Blame information for rev 750

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

Line No. Rev Author Line
1 720 jeremybenn
-- C32001C.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 IN MULTIPLE OBJECT DECLARATIONS FOR RECORD TYPES, THE 
26
-- SUBTYPE INDICATION AND THE INITIALIZATION EXPRESSIONS ARE EVALUATED
27
-- ONCE FOR EACH NAMED OBJECT THAT IS DECLARED AND THE SUBTYPE 
28
-- INDICATION IS EVALUATED FIRST.  ALSO, CHECK THAT THE EVALUATIONS 
29
-- YIELD THE SAME RESULT AS A SEQUENCE OF SINGLE OBJECT DECLARATIONS.
30
 
31
-- RJW 7/16/86
32
 
33
WITH REPORT; USE REPORT;
34
 
35
PROCEDURE C32001C IS
36
 
37
     TYPE ARR IS ARRAY (1 .. 2) OF INTEGER;
38
     F1, G1 : ARR;
39
     BUMP : ARR := (0, 0);
40
 
41
     FUNCTION F (I : INTEGER) RETURN INTEGER IS
42
     BEGIN
43
          BUMP (I) := BUMP(I) + 1;
44
          F1 (I) := BUMP (I);
45
          RETURN BUMP (I);
46
     END F;
47
 
48
     FUNCTION G (I : INTEGER) RETURN INTEGER IS
49
     BEGIN
50
          BUMP (I) := BUMP(I) + 1;
51
          G1 (I) := BUMP (I);
52
          RETURN BUMP (I);
53
     END G;
54
 
55
     FUNCTION H (I : INTEGER) RETURN INTEGER IS
56
     BEGIN
57
          BUMP (I) := BUMP(I) + 1;
58
          RETURN BUMP (I);
59
     END H;
60
 
61
BEGIN
62
     TEST ("C32001C", "CHECK THAT IN MULTIPLE OBJECT DECLARATIONS " &
63
                      "FOR RECORD TYPES, THE SUBTYPE INDICATION " &
64
                      "AND THE INITIALIZATION EXPRESSIONS ARE " &
65
                      "EVALUATED ONCE FOR EACH NAMED OBJECT THAT " &
66
                      "IS DECLARED AND THE SUBTYPE INDICATION IS " &
67
                      "EVALUATED FIRST.  ALSO, CHECK THAT THE " &
68
                      "EVALUATIONS YIELD THE SAME RESULT AS A " &
69
                      "SEQUENCE OF SINGLE OBJECT DECLARATIONS" );
70
 
71
     DECLARE
72
 
73
          TYPE REC (D1, D2 : INTEGER) IS
74
               RECORD
75
                    VALUE : INTEGER;
76
               END RECORD;
77
 
78
          R1, R2   : REC (F (1), G (1)) :=
79
                     (F1 (1), G1 (1), VALUE => H (1));
80
          CR1, CR2 : CONSTANT REC (F (2), G (2)) :=
81
                     (F1 (2), G1 (2), VALUE => H (2));
82
 
83
          PROCEDURE CHECK
84
            (R : REC; V1, V2, VAL : INTEGER; S : STRING) IS
85
          BEGIN
86
               IF R.D1 = V1 THEN
87
                    IF R.D2 = V2 THEN
88
                         COMMENT ( S & ".D1 INITIALIZED TO " &
89
                                   INTEGER'IMAGE (V1) & " AND " &
90
                                   S & ".D2 INITIALIZED TO " &
91
                                   INTEGER'IMAGE (V2));
92
                    ELSE
93
                         FAILED ( S &
94
                                  ".D2 INITIALIZED INCORRECTLY - 1" );
95
                    END IF;
96
               ELSIF R.D1 = V2 THEN
97
                    IF R.D2 =V1 THEN
98
                         COMMENT ( S & ".D1 INITIALIZED TO " &
99
                                   INTEGER'IMAGE (V2) & " AND " &
100
                                   S & ".D2 INITIALIZED TO " &
101
                                   INTEGER'IMAGE (V1));
102
                    ELSE
103
                         FAILED ( S &
104
                                  ".D2 INITIALIZED INCORRECTLY - 2" );
105
                    END IF;
106
               ELSE
107
                    FAILED ( S & ".D1 INITIALIZED INCORRECTLY TO " &
108
                              INTEGER'IMAGE (R.D1) );
109
               END IF;
110
 
111
               IF R.VALUE /= VAL THEN
112
                    FAILED ( S & ".VALUE INITIALIZED INCORRECTLY" );
113
               END IF;
114
          END CHECK;
115
 
116
     BEGIN
117
          CHECK (R1, 1, 2, 3, "R1");
118
          CHECK (R2, 4, 5, 6, "R2");
119
 
120
          CHECK (CR1, 1, 2, 3, "CR1");
121
          CHECK (CR2, 4, 5, 6, "CR2");
122
     END;
123
 
124
     RESULT;
125
END C32001C;

powered by: WebSVN 2.1.0

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