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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C32001D.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 IN MULTIPLE OBJECT DECLARATIONS FOR ACCESS TYPES, THE 
26
-- SUBTYPE INDICATION AND THE INITIALIZATION EXPRESSIONS ARE EVALUATED
27
-- ONCE FOR EACH NAMED OBJECT THAT IS DECLARED AND THE SUBTYPE 
28
-- INDICATION IS EVALUATED FIRST.  ALSO, CHECK THAT THE EVALUATIONS 
29
-- YIELD THE SAME RESULT AS A SEQUENCE OF SINGLE OBJECT DECLARATIONS.
30
 
31
-- RJW 7/16/86
32
 
33
WITH REPORT; USE REPORT;
34
 
35
PROCEDURE C32001D IS
36
 
37
     TYPE ARR IS ARRAY (1 .. 2) OF INTEGER;
38
     BUMP : ARR := (0, 0);
39
     F1 : ARR;
40
 
41
     FUNCTION F (I : INTEGER) RETURN INTEGER IS
42
     BEGIN
43
          BUMP (I) := BUMP (I) + 1;
44
          F1 (I) := BUMP (I);
45
          RETURN BUMP (I);
46
     END F;
47
 
48
     FUNCTION G (I : INTEGER) RETURN INTEGER IS
49
     BEGIN
50
          BUMP (I) := BUMP (I) + 1;
51
          RETURN BUMP (I);
52
     END G;
53
 
54
BEGIN
55
     TEST ("C32001D", "CHECK THAT IN MULTIPLE OBJECT DECLARATIONS " &
56
                      "FOR ACCESS TYPES, THE SUBTYPE INDICATION " &
57
                      "AND THE INITIALIZATION EXPRESSIONS ARE " &
58
                      "EVALUATED ONCE FOR EACH NAMED OBJECT THAT " &
59
                      "IS DECLARED AND THE SUBTYPE INDICATION IS " &
60
                      "EVALUATED FIRST.  ALSO, CHECK THAT THE " &
61
                      "EVALUATIONS YIELD THE SAME RESULT AS A " &
62
                      "SEQUENCE OF SINGLE OBJECT DECLARATIONS" );
63
 
64
     DECLARE
65
 
66
          TYPE CELL (SIZE : INTEGER) IS
67
               RECORD
68
                    VALUE : INTEGER;
69
               END RECORD;
70
 
71
          TYPE LINK IS ACCESS CELL;
72
 
73
          L1, L2   : LINK (F (1)) := NEW CELL'(F1 (1), G (1));
74
 
75
          CL1, CL2 : CONSTANT LINK (F (2)) := NEW CELL'(F1 (2), G (2));
76
 
77
          PROCEDURE CHECK (L : LINK; V1, V2 : INTEGER; S : STRING) IS
78
          BEGIN
79
               IF L.SIZE /= V1 THEN
80
                    FAILED ( S & ".SIZE INITIALIZED INCORRECTLY TO " &
81
                             INTEGER'IMAGE (L.SIZE));
82
               END IF;
83
 
84
               IF L.VALUE /= V2 THEN
85
                    FAILED ( S & ".VALUE INITIALIZED INCORRECTLY TO " &
86
                             INTEGER'IMAGE (L.VALUE));
87
               END IF;
88
          END CHECK;
89
 
90
     BEGIN
91
          CHECK (L1, 1, 2, "L1");
92
          CHECK (L2, 3, 4, "L2");
93
 
94
          CHECK (CL1, 1, 2, "CL1");
95
          CHECK (CL2, 3, 4, "CL2");
96
     END;
97
 
98
     RESULT;
99
END C32001D;

powered by: WebSVN 2.1.0

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