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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c7/] [c74305b.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- C74305B.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 A DEFERRED CONSTANT CAN BE USED AS A DEFAULT
26
--    INITIALIZATION FOR A PARAMETER OR AS A DEFAULT INITIA-
27
--    LIZATION FOR A COMPONENT (GENERIC CASE).
28
 
29
-- EG  12/20/83
30
 
31
WITH REPORT;
32
 
33
PROCEDURE C74305B IS
34
 
35
     USE REPORT;
36
 
37
     PACKAGE PK IS
38
          TYPE TD IS PRIVATE;
39
          CD : CONSTANT TD;
40
          DD : CONSTANT TD;
41
 
42
          GENERIC
43
               TYPE T1 IS PRIVATE;
44
               C1 : T1;
45
               WITH PROCEDURE P2 (A1 : T1 := C1; A2 : TD := CD);
46
          PROCEDURE P1 (A1 : TD := CD);
47
 
48
     PRIVATE
49
          TYPE TD IS NEW INTEGER;
50
          CD : CONSTANT TD := 2;
51
          DD : CONSTANT TD := 3;
52
     END PK;
53
 
54
     USE PK;
55
 
56
     PACKAGE BODY PK IS
57
 
58
          PROCEDURE P1 (A1 : TD := CD) IS
59
          BEGIN
60
              IF ( A1 /= 2 ) THEN
61
                   FAILED ("WRONG ACTUAL PARAMETER RECEIVED (1)");
62
              END IF;
63
              P2;
64
          END P1;
65
 
66
          PROCEDURE P3 (X : TD := DD; Y : TD := DD) IS
67
          BEGIN
68
              IF ( X /= 2 ) THEN
69
                   FAILED ("WRONG ACTUAL PARAMETER RECEIVED (2)");
70
              END IF;
71
              IF ( Y /= 2 ) THEN
72
                   FAILED ("WRONG ACTUAL PARAMETER RECEIVED (3)");
73
              END IF;
74
          END P3;
75
 
76
          PROCEDURE P4 IS NEW P1 (TD,CD,P3);
77
 
78
     BEGIN
79
          TEST ("C74305B","CHECK THAT A DEFERRED CONSTANT CAN BE "    &
80
                          "USED AS A DEFAULT INITIALIZATION FOR A "   &
81
                          "PARAMETER OR AS A DEFAULT INITIALIZATION " &
82
                          "FOR A COMPONENT (GENERIC CASE)");
83
          P4;
84
     END PK;
85
 
86
     PROCEDURE P5 (X : TD := DD; Y : TD := DD) IS
87
     BEGIN
88
          IF ( X /= CD ) THEN
89
               FAILED ("WRONG ACTUAL PARAMETER RECEIVED (4)");
90
          END IF;
91
          IF ( Y /= CD ) THEN
92
               FAILED ("WRONG ACTUAL PARAMETER RECEIVED (5)");
93
          END IF;
94
     END P5;
95
 
96
     PROCEDURE P6 IS NEW P1 (TD,CD,P5);
97
 
98
BEGIN
99
     P6;
100
     RESULT;
101
END C74305B;

powered by: WebSVN 2.1.0

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