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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [cc/] [cc3236a.ada] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
-- CC3236A.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 A FORMAL PRIVATE AND LIMITED PRIVATE TYPE DENOTES ITS
27
--      ACTUAL PARAMETER, AND OPERATIONS OF THE FORMAL TYPE ARE
28
--      IDENTIFIED WITH CORRESPONDING OPERATIONS OF THE ACTUAL TYPE
29
--      WHEN THE ACTUAL PARAMETER IS A TYPE WITH DISCRIMINANTS.
30
 
31
-- HISTORY:
32
--      DHH 10/24/88 CREATED ORIGINAL TEST.
33
--      PWN 02/02/95  REMOVED INCONSISTENCIES WITH ADA 9X.
34
 
35
WITH REPORT; USE REPORT;
36
PROCEDURE CC3236A IS
37
 
38
     GENERIC
39
          TYPE T IS PRIVATE;
40
     PACKAGE P IS
41
          SUBTYPE SUB_T IS T;
42
          PAC_VAR : T;
43
     END P;
44
 
45
     GENERIC
46
          TYPE T IS LIMITED PRIVATE;
47
     PACKAGE LP IS
48
          SUBTYPE SUB_T IS T;
49
          PAC_VAR : T;
50
     END LP;
51
 
52
BEGIN
53
     TEST ("CC3236A", "CHECK THAT A FORMAL PRIVATE OR LIMITED " &
54
                      "PRIVATE TYPE DENOTES ITS ACTUAL PARAMETER AND " &
55
                      "OPERATIONS OF THE FORMAL TYPE ARE IDENTIFIED " &
56
                      "WITH CORRESPONDING OPERATIONS OF THE ACTUAL " &
57
                      "TYPE, WHEN THE ACTUAL PARAMETER IS A TYPE " &
58
                      "WITH DISCRIMINANTS");
59
 
60
     DECLARE
61
          TYPE REC(X : INTEGER := 5) IS
62
               RECORD
63
                    NULL;
64
               END RECORD;
65
          OBJ_REC : REC(4);
66
 
67
          PACKAGE P2 IS NEW P (REC);
68
          USE P2;
69
 
70
          TYPE NEW_T IS NEW SUB_T;
71
          OBJ_NEWT : NEW_T(4);
72
     BEGIN
73
          PAC_VAR := SUB_T'((X => 4));
74
          IF PAC_VAR /= OBJ_REC THEN
75
               FAILED ("INCORRECT RESULTS - 1");
76
          END IF;
77
          IF PAC_VAR NOT IN REC THEN
78
               FAILED ("INCORRECT RESULTS - 2");
79
          END IF;
80
          IF OBJ_REC NOT IN SUB_T THEN
81
               FAILED ("INCORRECT RESULTS - 3");
82
          END IF;
83
          IF PAC_VAR.X /= OBJ_NEWT.X THEN
84
               FAILED ("INCORRECT RESULTS - 4");
85
          END IF;
86
     END;
87
 
88
     DECLARE
89
          TYPE REC(X : INTEGER := 5) IS
90
               RECORD
91
                    NULL;
92
               END RECORD;
93
          OBJ_REC : REC(4);
94
 
95
          PACKAGE P2 IS NEW LP (REC);
96
          USE P2;
97
 
98
          TYPE NEW_T IS NEW SUB_T;
99
          OBJ_NEWT : NEW_T(4);
100
     BEGIN
101
          PAC_VAR := SUB_T'(X => 4);
102
          IF PAC_VAR /= OBJ_REC THEN
103
               FAILED ("INCORRECT RESULTS - 7");
104
          END IF;
105
          IF PAC_VAR NOT IN REC THEN
106
               FAILED ("INCORRECT RESULTS - 8");
107
          END IF;
108
          IF OBJ_REC NOT IN SUB_T THEN
109
               FAILED ("INCORRECT RESULTS - 9");
110
          END IF;
111
          IF PAC_VAR.X /= OBJ_NEWT.X THEN
112
               FAILED ("INCORRECT RESULTS - 10");
113
          END IF;
114
     END;
115
 
116
     RESULT;
117
END CC3236A;

powered by: WebSVN 2.1.0

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