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/] [c37107a.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
-- C37107A.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 DEFAULT DISCRIMINANT EXPRESSION NEED NOT BE STATIC AND
26
-- IS EVALUATED ONLY WHEN NEEDED.
27
 
28
-- R.WILLIAMS 8/25/86
29
-- GMT        6/29/87  ADDED INTEGER ARGUMENT TO THE FUNCTION F.
30
 
31
 
32
WITH REPORT; USE REPORT;
33
PROCEDURE C37107A IS
34
 
35
     FUNCTION  F (  B : BOOLEAN;
36
                    I : INTEGER  ) RETURN INTEGER IS
37
     BEGIN
38
          IF NOT B THEN
39
               FAILED ( "DEFAULT DISCRIMINANT EVALUATED " &
40
                        "UNNECESSARILY - "                &
41
                        INTEGER'IMAGE(I)  );
42
          END IF;
43
 
44
          RETURN IDENT_INT (1);
45
     END F;
46
 
47
BEGIN
48
     TEST ( "C37107A", "CHECK THAT A DEFAULT DISCRIMINANT " &
49
                       "EXPRESSION NEED NOT BE STATIC AND IS " &
50
                       "EVALUATED ONLY WHEN NEEDED" );
51
 
52
     DECLARE
53
          TYPE REC1 (  D : INTEGER := F (TRUE,1)  ) IS
54
               RECORD
55
                    NULL;
56
               END RECORD;
57
 
58
          R1 : REC1;
59
 
60
          TYPE REC2 (  D : INTEGER := F (FALSE,2)  ) IS
61
               RECORD
62
                    NULL;
63
               END RECORD;
64
 
65
          R2 : REC2 (D => 0);
66
 
67
     BEGIN
68
          IF R1.D /= 1 THEN
69
               FAILED ( "INCORRECT VALUE FOR R1.D" );
70
          END IF;
71
 
72
          IF R2.D /= 0 THEN
73
               FAILED ( "INCORRECT VALUE FOR R2.D" );
74
          END IF;
75
     END;
76
 
77
     DECLARE
78
 
79
          PACKAGE PRIV IS
80
               TYPE REC3 (  D : INTEGER := F (TRUE,3)  ) IS PRIVATE;
81
               TYPE REC4 (  D : INTEGER := F (FALSE,4) ) IS PRIVATE;
82
 
83
          PRIVATE
84
               TYPE REC3 (  D : INTEGER := F (TRUE,3)  ) IS
85
                    RECORD
86
                         NULL;
87
                    END RECORD;
88
 
89
               TYPE REC4 (  D : INTEGER := F (FALSE,4)  ) IS
90
                    RECORD
91
                         NULL;
92
                    END RECORD;
93
          END PRIV;
94
 
95
          USE PRIV;
96
 
97
     BEGIN
98
          DECLARE
99
               R3 : REC3;
100
               R4 : REC4 (D => 0);
101
 
102
          BEGIN
103
               IF R3.D /= 1 THEN
104
                    FAILED ( "INCORRECT VALUE FOR R3.D" );
105
               END IF;
106
 
107
               IF R4.D /= 0 THEN
108
                    FAILED ( "INCORRECT VALUE FOR R4.D" );
109
               END IF;
110
          END;
111
 
112
     END;
113
 
114
     DECLARE
115
 
116
          PACKAGE LPRIV IS
117
               TYPE  REC5
118
                     (  D : INTEGER := F (TRUE,5)  ) IS LIMITED PRIVATE;
119
               TYPE  REC6
120
                     (  D : INTEGER := F (FALSE,6) ) IS LIMITED PRIVATE;
121
 
122
          PRIVATE
123
               TYPE REC5 (  D : INTEGER := F (TRUE,5)  ) IS
124
                    RECORD
125
                         NULL;
126
                    END RECORD;
127
 
128
               TYPE REC6 (  D : INTEGER := F (FALSE,6) ) IS
129
                    RECORD
130
                         NULL;
131
                    END RECORD;
132
          END LPRIV;
133
 
134
          USE LPRIV;
135
 
136
     BEGIN
137
          DECLARE
138
               R5 : REC5;
139
               R6 : REC6 (D => 0);
140
 
141
          BEGIN
142
               IF R5.D /= 1 THEN
143
                    FAILED ( "INCORRECT VALUE FOR R5.D" );
144
               END IF;
145
 
146
               IF R6.D /= 0 THEN
147
                    FAILED ( "INCORRECT VALUE FOR R6.D" );
148
               END IF;
149
          END;
150
 
151
     END;
152
 
153
     RESULT;
154
END C37107A;

powered by: WebSVN 2.1.0

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