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/] [c8/] [c87b26b.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C87B26B.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 'ADDRESS, 'CONSTRAINED, 'SIZE, AND 'STORAGE_SIZE MAY BE
26
-- USED WITH THE DESIGNATED OBJECTS OF ACCESS VALUES RETURNED FROM
27
-- OVERLOADED FUNCTIONS, AND THAT EXPLICIT DEREFERENCING IS USED BY
28
-- OVERLOADING RESOLUTION TO RESOLVE THE PREFIXES OF THE ATTRIBUTES.
29
 
30
-- DSJ 22 JUN 83
31
-- JBG 11/22/83
32
-- JBG 4/23/84
33
-- JBG 5/25/85
34
 
35
WITH REPORT;  WITH SYSTEM;
36
USE  REPORT;  USE  SYSTEM;
37
 
38
PROCEDURE C87B26B IS
39
 
40
     TYPE REC (D : INTEGER) IS
41
          RECORD
42
               C1, C2 : INTEGER;
43
          END RECORD;
44
     TYPE P_REC IS ACCESS REC;
45
 
46
     P_REC_OBJECT : P_REC := NEW REC'(1,1,1);
47
 
48
     TYPE BIG_INT IS RANGE 0..SYSTEM.MAX_INT;
49
     TASK TYPE TASK_TYPE IS
50
          -- NOTHING AT ALL
51
     END TASK_TYPE;
52
 
53
     TYPE P_TASK IS ACCESS TASK_TYPE;
54
 
55
     P_TASK_OBJECT : P_TASK;
56
 
57
     TASK BODY TASK_TYPE IS
58
     BEGIN
59
          NULL;
60
     END TASK_TYPE;
61
 
62
     ------------------------------------------------------------
63
 
64
     FUNCTION F RETURN REC IS
65
     BEGIN
66
          RETURN (0,0,0);
67
     END F;
68
 
69
     FUNCTION F RETURN P_REC IS
70
     BEGIN
71
          RETURN P_REC_OBJECT;
72
     END F;
73
 
74
     ------------------------------------------------------------
75
 
76
     FUNCTION G RETURN TASK_TYPE IS
77
          NEW_TASK : TASK_TYPE;
78
     BEGIN
79
          RETURN NEW_TASK;
80
     END G;
81
 
82
     FUNCTION G RETURN P_TASK IS
83
     BEGIN
84
          RETURN P_TASK_OBJECT;
85
     END G;
86
 
87
     ------------------------------------------------------------
88
 
89
BEGIN
90
 
91
     TEST("C87B26B","CHECK THAT EXPLICIT DEREFERENCING IN AN " &
92
          "ATTRIBUTE PREFIX IS USED IN OVERLOADING RESOLUTION " &
93
          "WITH 'ADDRESS, 'CONSTRAINED, 'SIZE, AND 'STORAGE_SIZE");
94
 
95
     DECLARE
96
 
97
          A : ADDRESS;   -- FOR 'ADDRESS OF RECORD
98
          B : BOOLEAN;   -- FOR 'CONSTRAINED OF RECORD
99
          C : INTEGER;   -- FOR 'SIZE OF RECORD
100
          D : ADDRESS;   -- FOR 'ADDRESS OF TASK
101
          E : BIG_INT;   -- FOR 'STORAGE_SIZE OF TASK
102
 
103
     BEGIN
104
 
105
          P_TASK_OBJECT := NEW TASK_TYPE;
106
          A := F.ALL'ADDRESS;
107
          B := F.ALL'CONSTRAINED;
108
          C := F.ALL'SIZE;
109
          D := G.ALL'ADDRESS;
110
          E := G.ALL'STORAGE_SIZE;
111
 
112
          IF A /= P_REC_OBJECT.ALL'ADDRESS THEN
113
               FAILED("INCORRECT RESOLUTION FOR 'ADDRESS - REC");
114
          END IF;
115
 
116
          IF B /= P_REC_OBJECT.ALL'CONSTRAINED THEN
117
               FAILED("INCORRECT RESOLUTION FOR 'CONSTRAINED");
118
          END IF;
119
 
120
          IF C /= P_REC_OBJECT.ALL'SIZE THEN
121
               FAILED("INCORRECT RESOLUTION FOR 'SIZE");
122
          END IF;
123
 
124
          IF D /= P_TASK_OBJECT.ALL'ADDRESS THEN
125
               FAILED("INCORRECT RESOLUTION FOR 'ADDRESS - TASK");
126
          END IF;
127
 
128
          IF E /= P_TASK_OBJECT.ALL'STORAGE_SIZE THEN
129
               FAILED("INCORRECT RESOLUTION FOR 'STORAGE_SIZE");
130
          END IF;
131
 
132
          IF A = P_REC_OBJECT'ADDRESS THEN
133
               FAILED("INCORRECT DEREFERENCING FOR 'ADDRESS - REC");
134
          END IF;
135
 
136
          IF C = P_REC_OBJECT'SIZE AND C /= P_REC_OBJECT.ALL'SIZE THEN
137
               FAILED("INCORRECT DEREFERENCING FOR 'SIZE");
138
          END IF;
139
 
140
          IF D = P_TASK_OBJECT'ADDRESS THEN
141
               FAILED("INCORRECT DEREFERENCING FOR 'ADDRESS - TASK");
142
          END IF;
143
 
144
 
145
     END;
146
 
147
     RESULT;
148
 
149
END C87B26B;

powered by: WebSVN 2.1.0

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