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/] [c83012d.ada] - Blame information for rev 309

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

Line No. Rev Author Line
1 294 jeremybenn
-- C83012D.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 WITHIN A GENERIC PACKAGE INSTANTIATION, A DECLARATION
27
--     HAVING THE SAME IDENTIFIER AS THE PACKAGE IS VISIBLE BY
28
--     SELECTION.
29
 
30
-- HISTORY:
31
--     JET 08/11/88  CREATED ORIGINAL TEST.
32
 
33
WITH REPORT; USE REPORT;
34
PROCEDURE C83012D IS
35
 
36
     PACKAGE PACK IS
37
          SUBTYPE PACK1 IS INTEGER;
38
          PACK2 : INTEGER := 2;
39
     END PACK;
40
 
41
     TYPE REC IS RECORD
42
          PACK3 : INTEGER;
43
          PACK4 : INTEGER;
44
     END RECORD;
45
 
46
     R : REC := (PACK3 => 3, PACK4 => 1);
47
 
48
     GENERIC
49
          TYPE T IS RANGE <>;
50
     PACKAGE GEN1 IS
51
          J : INTEGER := IDENT_INT(1);
52
     END GEN1;
53
 
54
     GENERIC
55
          I : INTEGER;
56
     PACKAGE GEN2 IS
57
          J : INTEGER := IDENT_INT(I);
58
     END GEN2;
59
 
60
     GENERIC
61
          R : REC;
62
     PACKAGE GEN3 IS
63
          J : INTEGER := IDENT_INT(R.PACK4);
64
     END GEN3;
65
 
66
     GENERIC
67
          PACK6 : INTEGER;
68
     PACKAGE GEN4 IS
69
          J : INTEGER := IDENT_INT(PACK6);
70
     END GEN4;
71
 
72
     FUNCTION FUNC (PACK5: INTEGER) RETURN INTEGER IS
73
     BEGIN
74
          RETURN IDENT_INT(PACK5);
75
     END FUNC;
76
 
77
     PACKAGE PACK1 IS NEW GEN1(PACK.PACK1);
78
     PACKAGE PACK2 IS NEW GEN2(PACK.PACK2);
79
     PACKAGE PACK3 IS NEW GEN2(R.PACK3);
80
     PACKAGE PACK4 IS NEW GEN3((1, PACK4 => 4));
81
     PACKAGE PACK5 IS NEW GEN2(FUNC(PACK5 => 5));
82
     PACKAGE PACK6 IS NEW GEN4(PACK6 => 6);
83
 
84
BEGIN
85
     TEST ("C83012D", "CHECK THAT WITHIN A GENERIC PACKAGE " &
86
                      "INSTANTIATION, A DECLARATION HAVING THE SAME " &
87
                      "IDENTIFIER AS THE PACKAGE IS VISIBLE BY " &
88
                      "SELECTION");
89
 
90
     IF PACK1.J /= 1 THEN
91
          FAILED ("INCORRECT VALUE OF PACK1.J");
92
     END IF;
93
 
94
     IF PACK2.J /= 2 THEN
95
          FAILED ("INCORRECT VALUE OF PACK2.J");
96
     END IF;
97
 
98
     IF PACK3.J /= 3 THEN
99
          FAILED ("INCORRECT VALUE OF PACK3.J");
100
     END IF;
101
 
102
     IF PACK4.J /= 4 THEN
103
          FAILED ("INCORRECT VALUE OF PACK4.J");
104
     END IF;
105
 
106
     IF PACK5.J /= 5 THEN
107
          FAILED ("INCORRECT VALUE OF PACK5.J");
108
     END IF;
109
 
110
     IF PACK6.J /= 6 THEN
111
          FAILED ("INCORRECT VALUE OF PACK6.J");
112
     END IF;
113
 
114
     RESULT;
115
 
116
END C83012D;

powered by: WebSVN 2.1.0

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