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/] [cc1204a.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
-- CC1204A.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 GENERIC FORMAL TYPES MAY HAVE A DISCRIMINANT PART,
26
-- WHICH MAY BE OF A GENERIC FORMAL TYPE.
27
 
28
-- DAT 8/14/81
29
-- SPS 5/12/82
30
 
31
WITH REPORT; USE REPORT;
32
 
33
PROCEDURE CC1204A IS
34
BEGIN
35
     TEST ("CC1204A", "DISCRIMINANT PARTS FOR GENERIC FORMAL TYPES");
36
 
37
     DECLARE
38
          GENERIC
39
               TYPE T IS ( <> );
40
               TYPE I IS RANGE <> ;
41
               TYPE R1 (C : BOOLEAN) IS PRIVATE;
42
               TYPE R2 (C : T) IS PRIVATE;
43
               TYPE R3 (C : I) IS LIMITED PRIVATE;
44
               P1 : IN R1;
45
               P2 : IN R2;
46
               V1 : IN OUT R1;
47
               V2 : IN OUT R2;
48
               V3 : IN OUT R3;
49
          PROCEDURE PROC;
50
 
51
          TYPE DD IS NEW INTEGER RANGE 1 .. 10;
52
          TYPE ARR IS ARRAY (DD RANGE <>) OF CHARACTER;
53
          TYPE RECD (C : DD := DD (IDENT_INT (1))) IS
54
               RECORD
55
                    C1 : ARR (1..C);
56
               END RECORD;
57
 
58
          X1 : RECD;
59
          X2 : RECD := (1, "Y");
60
 
61
          TYPE RECB (C : BOOLEAN) IS
62
               RECORD
63
                    V : INTEGER := 6;
64
               END RECORD;
65
          RB : RECB (IDENT_BOOL (TRUE));
66
          RB1 : RECB (IDENT_BOOL (TRUE));
67
 
68
          PROCEDURE PROC IS
69
          BEGIN
70
               IF P1.C /= TRUE
71
                  OR P2.C /= T'FIRST
72
                  OR V1.C /= TRUE
73
                  OR V2.C /= T'FIRST
74
                  OR V3.C /= I'FIRST
75
               THEN
76
                    FAILED ("WRONG GENERIC PARAMETER VALUE");
77
               END IF;
78
 
79
               V1 := P1;
80
               V2 := P2;
81
 
82
               IF V1 /= P1
83
                  OR V2 /= P2
84
               THEN
85
                    FAILED ("BAD ASSIGNMENT TO GENERIC PARAMETERS");
86
               END IF;
87
          END PROC;
88
 
89
     BEGIN
90
          RB1.V := IDENT_INT (1);
91
          X1.C1 := "X";
92
 
93
          DECLARE
94
 
95
               PROCEDURE PR IS NEW PROC
96
                    (T => DD,
97
                     I => DD,
98
                     R1 => RECB,
99
                     R2 => RECD,
100
                     R3 => RECD,
101
                     P1 => RB1,
102
                     P2 => X1,
103
                     V1 => RB,
104
                     V2 => X2,
105
                     V3 => X2);
106
          BEGIN
107
               PR;
108
               IF RB /= (TRUE, 1) OR X2.C1 /= "X" THEN
109
                    FAILED ("PR NOT CALLED CORRECTLY");
110
               END IF;
111
          END;
112
     END;
113
 
114
     RESULT;
115
END CC1204A;

powered by: WebSVN 2.1.0

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