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/] [c4/] [c43205k.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C43205K.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 THE BOUNDS OF A POSITIONAL AGGREGATE ARE DETERMINED
26
-- CORRECTLY. IN PARTICULAR, CHECK THAT THE LOWER BOUND IS GIVEN BY
27
-- THE LOWER BOUND OF THE APPLICABLE INDEX CONSTRAINT WHEN THE
28
-- POSITIONAL AGGREGATE IS USED AS:
29
 
30
-- THE EXPRESSION OF AN ENCLOSING RECORD OR ARRAY AGGREGATE, AND
31
-- THE EXPRESSION GIVES THE VALUE OF A RECORD OR ARRAY COMPONENT
32
-- (WHICH IS NECESSARILY CONSTRAINED).
33
 
34
-- EG  01/27/84
35
-- JBG 3/30/84
36
 
37
WITH REPORT;
38
 
39
PROCEDURE C43205K IS
40
 
41
     USE REPORT;
42
 
43
BEGIN
44
 
45
     TEST("C43205K", "THE EXPRESSION OF AN ENCLOSING RECORD " &
46
                     "OR ARRAY AGGREGATE, AND THE EXPRESSION GIVES "   &
47
                     "THE VALUE OF A RECORD OR ARRAY COMPONENT");
48
 
49
     BEGIN
50
 
51
CASE_K :  BEGIN
52
 
53
     CASE_K1 : DECLARE
54
 
55
                    SUBTYPE SK1 IS INTEGER RANGE 2 .. 6;
56
                    TYPE BASE IS ARRAY(SK1 RANGE <>) OF INTEGER;
57
                    SUBTYPE TE1 IS BASE(IDENT_INT(3) .. 5);
58
                    TYPE TE2 IS ARRAY(1 .. 2) OF TE1;
59
 
60
                    E1 : TE2;
61
 
62
               BEGIN
63
 
64
                    E1 := (1 .. 2 => (3, 2, 1));
65
                    IF (E1'FIRST /= 1 OR E1'LAST /= 2) OR ELSE
66
                       (E1(1)'FIRST /= 3 OR E1(1)'LAST /= 5 OR
67
                        E1(2)'FIRST /= 3 OR E1(2)'LAST /= 5) THEN
68
                         FAILED ("CASE K1 : INCORRECT BOUNDS");
69
                    ELSE
70
                         IF E1 /= (1 .. 2 => (3, 2, 1)) THEN
71
                              FAILED ("CASE K1 : ARRAY DOES NOT " &
72
                                      "CONTAIN THE CORRECT VALUES");
73
                         END IF;
74
                    END IF;
75
 
76
               END CASE_K1;
77
 
78
     CASE_K2 : DECLARE
79
 
80
                    TYPE SK2 IS RANGE 2 .. 6;
81
                    TYPE BASE IS ARRAY(SK2 RANGE <>) OF INTEGER;
82
                    SUBTYPE TE1 IS BASE(3 .. 5);
83
                    TYPE TER IS
84
                         RECORD
85
                              REC : TE1;
86
                         END RECORD;
87
 
88
                    E2 : TER;
89
 
90
               BEGIN
91
 
92
                    E2 := (REC => (3, 2, 1));
93
                    IF E2.REC'FIRST /= 3 OR E2.REC'LAST /= 5 THEN
94
                         FAILED ("CASE K2 : INCORRECT BOUNDS");
95
                    ELSE
96
                         IF E2.REC /= (3, 2, 1) THEN
97
                              FAILED ("CASE K2 : ARRAY DOES NOT " &
98
                                      "CONTAIN CORRECT VALUES");
99
                         END IF;
100
                    END IF;
101
 
102
               END CASE_K2;
103
 
104
          END CASE_K;
105
 
106
     END;
107
 
108
     RESULT;
109
 
110
END C43205K;

powered by: WebSVN 2.1.0

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