OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c3/] [c34006a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C34006A.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 THE REQUIRED PREDEFINED OPERATIONS ARE DECLARED
27
--     (IMPLICITLY) FOR DERIVED RECORD TYPES WITHOUT DISCRIMINANTS
28
--     AND WITH NON-LIMITED COMPONENT TYPES.
29
 
30
-- HISTORY:
31
--     JRK 09/22/86  CREATED ORIGINAL TEST.
32
--     BCB 09/26/88  REMOVED COMPARISONS INVOLVING SIZE.
33
--     PWN 11/30/94  REMOVED 'BASE USE ILLEGAL IN ADA 9X.
34
 
35
WITH SYSTEM; USE SYSTEM;
36
WITH REPORT; USE REPORT;
37
 
38
PROCEDURE C34006A IS
39
 
40
     SUBTYPE COMPONENT IS INTEGER;
41
 
42
     TYPE PARENT IS
43
          RECORD
44
               C : COMPONENT;
45
               B : BOOLEAN := TRUE;
46
          END RECORD;
47
 
48
     TYPE T IS NEW PARENT;
49
 
50
     X : T         := (2, FALSE);
51
     K : INTEGER   := X'SIZE;
52
     W : PARENT    := (2, FALSE);
53
     C : COMPONENT := 1;
54
     B : BOOLEAN   := FALSE;
55
 
56
     PROCEDURE A (X : ADDRESS) IS
57
     BEGIN
58
          B := IDENT_BOOL (TRUE);
59
     END A;
60
 
61
     FUNCTION IDENT (X : T) RETURN T IS
62
     BEGIN
63
          IF EQUAL (X.C, X.C) THEN
64
               RETURN X;                          -- ALWAYS EXECUTED.
65
          END IF;
66
          RETURN (-1, FALSE);
67
     END IDENT;
68
 
69
BEGIN
70
     TEST ("C34006A", "CHECK THAT THE REQUIRED PREDEFINED OPERATIONS " &
71
                      "ARE DECLARED (IMPLICITLY) FOR DERIVED " &
72
                      "RECORD TYPES WITHOUT DISCRIMINANTS AND WITH " &
73
                      "NON-LIMITED COMPONENT TYPES");
74
 
75
     X := IDENT ((1, TRUE));
76
     IF X /= (1, TRUE) THEN
77
          FAILED ("INCORRECT :=");
78
     END IF;
79
 
80
     IF T'(X) /= (1, TRUE) THEN
81
          FAILED ("INCORRECT QUALIFICATION");
82
     END IF;
83
 
84
     IF T (X) /= (1, TRUE) THEN
85
          FAILED ("INCORRECT SELF CONVERSION");
86
     END IF;
87
 
88
     IF EQUAL (3, 3) THEN
89
          W := (1, TRUE);
90
     END IF;
91
     IF T (W) /= (1, TRUE) THEN
92
          FAILED ("INCORRECT CONVERSION FROM PARENT");
93
     END IF;
94
 
95
     IF PARENT (X) /= (1, TRUE) THEN
96
          FAILED ("INCORRECT CONVERSION TO PARENT");
97
     END IF;
98
 
99
     IF IDENT ((1, TRUE)) /= (1, TRUE) THEN
100
          FAILED ("INCORRECT AGGREGATE");
101
     END IF;
102
 
103
     IF X.C /= 1 OR X.B /= TRUE THEN
104
          FAILED ("INCORRECT SELECTION (VALUE)");
105
     END IF;
106
 
107
     X.C := IDENT_INT (3);
108
     X.B := IDENT_BOOL (FALSE);
109
     IF X /= (3, FALSE) THEN
110
          FAILED ("INCORRECT SELECTION (ASSIGNMENT)");
111
     END IF;
112
 
113
     X := IDENT ((1, TRUE));
114
     IF X = IDENT ((1, FALSE)) THEN
115
          FAILED ("INCORRECT =");
116
     END IF;
117
 
118
     IF X /= IDENT ((1, TRUE)) THEN
119
          FAILED ("INCORRECT /=");
120
     END IF;
121
 
122
     IF NOT (X IN T) THEN
123
          FAILED ("INCORRECT ""IN""");
124
     END IF;
125
 
126
     IF X NOT IN T THEN
127
          FAILED ("INCORRECT ""NOT IN""");
128
     END IF;
129
 
130
     B := FALSE;
131
     A (X'ADDRESS);
132
     IF NOT B THEN
133
          FAILED ("INCORRECT 'ADDRESS");
134
     END IF;
135
 
136
     IF X.C'FIRST_BIT < 0 THEN
137
          FAILED ("INCORRECT 'FIRST_BIT");
138
     END IF;
139
 
140
     IF X.C'LAST_BIT < 0 OR
141
        X.C'LAST_BIT - X.C'FIRST_BIT + 1 /= X.C'SIZE THEN
142
          FAILED ("INCORRECT 'LAST_BIT");
143
     END IF;
144
 
145
     IF X.C'POSITION < 0 THEN
146
          FAILED ("INCORRECT 'POSITION");
147
     END IF;
148
 
149
 
150
     RESULT;
151
END C34006A;

powered by: WebSVN 2.1.0

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