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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c3/] [c38005c.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
-- C38005C.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
-- OBJECTIVE:
26
--     CHECK THAT ALL OBJECTS OF FORMAL ACCESS TYPE, INCLUDING ARRAY AND
27
--     RECORD COMPONENTS, ARE INITIALIZED BY DEFAULT WITH THE VALUE
28
--     NULL.
29
 
30
-- HISTORY:
31
--     DHH 08/04/88 CREATED ORIGINAL TEST.
32
 
33
WITH REPORT; USE REPORT;
34
PROCEDURE C38005C IS
35
 
36
     SUBTYPE INT IS INTEGER RANGE 1 .. 10;
37
 
38
     TYPE ACC_I IS ACCESS INT;
39
 
40
     SUBTYPE NEW_NODE IS CHARACTER;
41
 
42
     TYPE ACC_CHAR IS ACCESS NEW_NODE;
43
 
44
     X : ACC_I := NEW INT'(IDENT_INT(5));
45
     Y : NEW_NODE := 'A';
46
     Z : ACC_CHAR := NEW NEW_NODE'(Y);
47
 
48
     GENERIC
49
          TYPE ACC_INT IS ACCESS INT;
50
          TYPE NODE IS PRIVATE;
51
          TYPE LINK IS ACCESS NODE;
52
     PROCEDURE P(U : ACC_INT; V : NODE; W : LINK);
53
 
54
     GENERIC
55
          TYPE ACC_INT IS ACCESS INT;
56
          TYPE NODE IS PRIVATE;
57
          TYPE LINK IS ACCESS NODE;
58
     PACKAGE PACK IS
59
 
60
          SUBTYPE NEW_ACC IS ACC_INT;
61
 
62
          SUBTYPE NEW_L IS LINK;
63
 
64
          TYPE ARR IS ARRAY(1 .. 4) OF ACC_INT;
65
 
66
          TYPE REC IS
67
               RECORD
68
                    I : ACC_INT;
69
                    L : LINK;
70
               END RECORD;
71
 
72
     END PACK;
73
 
74
     PACKAGE NEW_PACK IS NEW PACK(ACC_I, NEW_NODE, ACC_CHAR);
75
     USE NEW_PACK;
76
 
77
     A : NEW_PACK.NEW_ACC;
78
     B : NEW_PACK.NEW_L;
79
     C : NEW_PACK.ARR;
80
     D : NEW_PACK.REC;
81
 
82
     PROCEDURE P(U : ACC_INT; V : NODE; W : LINK) IS
83
 
84
          TYPE ARR IS ARRAY(1 .. 4) OF ACC_INT;
85
 
86
          TYPE REC IS
87
               RECORD
88
                    I : ACC_INT;
89
                    L : LINK;
90
               END RECORD;
91
 
92
          A : ACC_INT;
93
          B : LINK;
94
          C : ARR;
95
          D : REC;
96
 
97
     BEGIN
98
          IF A /= NULL THEN
99
               FAILED("OBJECT A NOT INITIALIZED - PROC");
100
          END IF;
101
 
102
          IF B /= NULL THEN
103
               FAILED("OBJECT B NOT INITIALIZED - PROC");
104
          END IF;
105
 
106
          FOR I IN 1 .. 4 LOOP
107
               IF C(I) /= NULL THEN
108
                    FAILED("ARRAY " & INTEGER'IMAGE(I) &
109
                           "NOT INITIALIZED - PROC");
110
               END IF;
111
          END LOOP;
112
 
113
          IF D.I /= NULL THEN
114
               FAILED("RECORD.I NOT INITIALIZED - PROC");
115
          END IF;
116
 
117
          IF D.L /= NULL THEN
118
               FAILED("RECORD.L NOT INITIALIZED - PROC");
119
          END IF;
120
 
121
     END P;
122
 
123
     PROCEDURE PROC IS NEW P(ACC_I, NEW_NODE, ACC_CHAR);
124
 
125
BEGIN
126
     TEST("C38005C", "CHECK THAT ALL OBJECTS OF FORMAL ACCESS TYPE, " &
127
                     "INCLUDING ARRAY AND RECORD COMPONENTS, ARE " &
128
                     "INITIALIZED BY DEFAULT WITH THE VALUE NULL");
129
 
130
     PROC(X, Y, Z);
131
 
132
     IF A /= NULL THEN
133
          FAILED("OBJECT A NOT INITIALIZED - PACK");
134
     END IF;
135
 
136
     IF B /= NULL THEN
137
          FAILED("OBJECT B NOT INITIALIZED - PACK");
138
     END IF;
139
 
140
     FOR I IN 1 .. 4 LOOP
141
          IF C(I) /= NULL THEN
142
               FAILED("ARRAY " & INTEGER'IMAGE(I) &
143
                      "NOT INITIALIZED - PACK");
144
          END IF;
145
     END LOOP;
146
 
147
     IF D.I /= NULL THEN
148
          FAILED("RECORD.I NOT INITIALIZED - PACK");
149
     END IF;
150
 
151
     IF D.L /= NULL THEN
152
          FAILED("RECORD.L NOT INITIALIZED - PACK");
153
     END IF;
154
 
155
     RESULT;
156
END C38005C;

powered by: WebSVN 2.1.0

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