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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C34009G.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 LIMITED PRIVATE TYPES WITHOUT
28
--     DISCRIMINANTS.
29
 
30
-- HISTORY:
31
--     JRK 09/01/87  CREATED ORIGINAL TEST.
32
--     PWN 11/30/94  REMOVED 'BASE USE ILLEGAL IN ADA 9X.
33
--     PWN 01/31/95  REMOVED INCONSISTENCIES WITH ADA 9X.
34
 
35
WITH SYSTEM; USE SYSTEM;
36
WITH REPORT; USE REPORT;
37
 
38
PROCEDURE C34009G IS
39
 
40
     PACKAGE PKG IS
41
 
42
          TYPE PARENT IS LIMITED PRIVATE;
43
 
44
          FUNCTION CREATE (X : INTEGER) RETURN PARENT;
45
 
46
          FUNCTION CON (X : INTEGER) RETURN PARENT;
47
 
48
          FUNCTION EQUAL (X, Y : PARENT) RETURN BOOLEAN;
49
 
50
          PROCEDURE ASSIGN (X : OUT PARENT; Y : PARENT);
51
 
52
     PRIVATE
53
 
54
          TYPE PARENT IS NEW INTEGER;
55
 
56
     END PKG;
57
 
58
     USE PKG;
59
 
60
     TYPE T IS NEW PARENT;
61
 
62
     X : T;
63
     W : PARENT;
64
     B : BOOLEAN := FALSE;
65
 
66
     PROCEDURE A (X : ADDRESS) IS
67
     BEGIN
68
          B := IDENT_BOOL (TRUE);
69
     END A;
70
 
71
     PACKAGE BODY PKG IS
72
 
73
          FUNCTION CREATE (X : INTEGER) RETURN PARENT IS
74
          BEGIN
75
               RETURN PARENT (IDENT_INT (X));
76
          END CREATE;
77
 
78
          FUNCTION CON (X : INTEGER) RETURN PARENT IS
79
          BEGIN
80
               RETURN PARENT (X);
81
          END CON;
82
 
83
          FUNCTION EQUAL (X, Y : PARENT) RETURN BOOLEAN IS
84
          BEGIN
85
               RETURN X = Y;
86
          END EQUAL;
87
 
88
          PROCEDURE ASSIGN (X : OUT PARENT; Y : PARENT) IS
89
          BEGIN
90
               X := Y;
91
          END ASSIGN;
92
 
93
     END PKG;
94
 
95
BEGIN
96
     TEST ("C34009G", "CHECK THAT THE REQUIRED PREDEFINED OPERATIONS " &
97
                      "ARE DECLARED (IMPLICITLY) FOR DERIVED " &
98
                      "LIMITED PRIVATE TYPES WITHOUT DISCRIMINANTS");
99
 
100
     ASSIGN (X, CREATE (30));
101
     IF NOT EQUAL (T'(X), CON (30)) THEN
102
          FAILED ("INCORRECT QUALIFICATION");
103
     END IF;
104
 
105
     IF NOT EQUAL (T (X), CON (30)) THEN
106
          FAILED ("INCORRECT SELF CONVERSION");
107
     END IF;
108
 
109
     ASSIGN (W, CREATE (-30));
110
     IF NOT EQUAL (T (W), CON (-30)) THEN
111
          FAILED ("INCORRECT CONVERSION FROM PARENT");
112
     END IF;
113
 
114
     IF NOT EQUAL (PARENT (X), CON (30)) THEN
115
          FAILED ("INCORRECT CONVERSION TO PARENT");
116
     END IF;
117
 
118
     IF NOT (X IN T) THEN
119
          FAILED ("INCORRECT ""IN""");
120
     END IF;
121
 
122
     IF X NOT IN T THEN
123
          FAILED ("INCORRECT ""NOT IN""");
124
     END IF;
125
 
126
     B := FALSE;
127
     A (X'ADDRESS);
128
     IF NOT B THEN
129
          FAILED ("INCORRECT 'ADDRESS");
130
     END IF;
131
 
132
     IF X'SIZE < T'SIZE THEN
133
          FAILED ("INCORRECT OBJECT'SIZE");
134
     END IF;
135
 
136
     RESULT;
137
END C34009G;

powered by: WebSVN 2.1.0

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