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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C37010A.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 EXPRESSIONS IN CONSTRAINTS OF COMPONENT DECLARATIONS ARE
26
-- EVALUATED IN THE ORDER THE COMPONENTS APPEAR.
27
 
28
-- R.WILLIAMS 8/22/86
29
 
30
WITH REPORT; USE REPORT;
31
PROCEDURE C37010A IS
32
 
33
     TYPE R (D : INTEGER) IS
34
             RECORD
35
                  NULL;
36
             END RECORD;
37
 
38
     TYPE ACCR IS ACCESS R;
39
 
40
     TYPE ARR IS ARRAY (POSITIVE RANGE <> ) OF INTEGER;
41
 
42
     TYPE ACCA IS ACCESS ARR;
43
 
44
     BUMP : INTEGER := 0;
45
 
46
     FUNCTION F RETURN INTEGER IS
47
     BEGIN
48
          BUMP := BUMP + 1;
49
          RETURN BUMP;
50
     END;
51
 
52
BEGIN
53
     TEST ( "C37010A", "CHECK THAT EXPRESSIONS IN CONSTRAINTS OF " &
54
                       "COMPONENT DECLARATIONS ARE EVALUATED IN " &
55
                       "THE ORDER THE COMPONENTS APPEAR" );
56
 
57
     DECLARE
58
 
59
          TYPE REC1 IS
60
               RECORD
61
                    A1 : R (D => F);
62
                    B1 : STRING (1 .. F);
63
                    C1 : ACCR (F);
64
                    D1 : ACCA (1 .. F);
65
               END RECORD;
66
 
67
          R1 : REC1;
68
 
69
     BEGIN
70
          IF R1.A1.D /= 1 THEN
71
               FAILED ( "INCORRECT VALUE FOR R1.A1.D" );
72
          END IF;
73
 
74
          IF R1.B1'LAST /= 2 THEN
75
               FAILED ( "INCORRECT VALUE FOR R1.B1'LAST" );
76
          END IF;
77
 
78
          BEGIN
79
               R1.C1 := NEW R'(D => 3);
80
          EXCEPTION
81
               WHEN OTHERS =>
82
                    FAILED ( "INCORRECT VALUE FOR R1.C1" );
83
          END;
84
 
85
          BEGIN
86
               R1.D1 := NEW ARR (1 .. 4);
87
          EXCEPTION
88
               WHEN OTHERS =>
89
                    FAILED ( "INCORRECT VALUE FOR R1.D1" );
90
          END;
91
 
92
     END;
93
 
94
     BUMP := 0;
95
 
96
     DECLARE
97
 
98
          TYPE REC2 (I : INTEGER) IS
99
               RECORD
100
                    CASE I IS
101
                         WHEN 1 =>
102
                              NULL;
103
                         WHEN OTHERS =>
104
                              A2 : R (D => F);
105
                              B2 : ARR (1 .. F);
106
                              C2 : ACCR (F);
107
                              D2 : ACCA (1 .. F);
108
                    END CASE;
109
               END RECORD;
110
 
111
          R2 : REC2 (IDENT_INT (2));
112
 
113
     BEGIN
114
 
115
          IF R2.A2.D /= 1 THEN
116
               FAILED ( "INCORRECT VALUE FOR R2.A2.D" );
117
          END IF;
118
 
119
          IF R2.B2'LAST /= 2 THEN
120
               FAILED ( "INCORRECT VALUE FOR R2.B2'LAST" );
121
          END IF;
122
 
123
          BEGIN
124
               R2.C2 := NEW R (D => 3);
125
          EXCEPTION
126
               WHEN OTHERS =>
127
                    FAILED ( "INCORRECT VALUE FOR R2.C2" );
128
          END;
129
 
130
          BEGIN
131
               R2.D2 := NEW ARR (1 .. 4);
132
          EXCEPTION
133
               WHEN OTHERS =>
134
                    FAILED ( "INCORRECT VALUE FOR R2.D2" );
135
          END;
136
 
137
     END;
138
 
139
     RESULT;
140
END C37010A;

powered by: WebSVN 2.1.0

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