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/] [c36204a.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
-- C36204A.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 EACH ARRAY ATTRIBUTE YIELDS THE CORRECT VALUES.
26
-- BOTH ARRAY OBJECTS AND TYPES ARE CHECKED.
27
 
28
-- DAT 2/12/81
29
-- SPS 11/1/82
30
-- WMC 03/16/92  CREATED TYPE RANGE CHECK FOR AE_TYPE.
31
 
32
WITH REPORT;
33
PROCEDURE C36204A IS
34
 
35
     USE REPORT;
36
 
37
BEGIN
38
     TEST ("C36204A", "ARRAY ATTRIBUTES RETURN CORRECT VALUES");
39
 
40
     DECLARE
41
          A1 : ARRAY (BOOLEAN,
42
                      INTEGER RANGE IDENT_INT(1)..IDENT_INT(10))
43
               OF STRING(IDENT_INT(5)..IDENT_INT(7));
44
          TYPE NI IS  RANGE -3 .. 3;
45
          N : NI := NI(IDENT_INT(2));
46
          SUBTYPE SNI IS NI RANGE -N .. N;
47
          TYPE AA IS ARRAY (NI, SNI, BOOLEAN)
48
               OF NI;
49
          A1_1_1 : BOOLEAN := A1'FIRST;
50
          A1_1_2 : BOOLEAN := A1'LAST(1);
51
          A1_2_1 : INTEGER RANGE A1'RANGE(2) := A1'FIRST(2);  -- 1
52
          A1_2_2 : INTEGER RANGE A1'RANGE(2) := A1'LAST(2);   -- 10
53
          SUBTYPE AE_TYPE IS INTEGER RANGE A1(TRUE,5)'RANGE;    -- RANGE 5..7
54
          A2 : AA;
55
          A4 : ARRAY (A1_1_1 .. A1_1_2, A1_2_1 .. A1_2_2) OF
56
               STRING (IDENT_INT(1)..IDENT_INT(3));
57
 
58
          I : INTEGER;
59
          B : BOOLEAN;
60
     BEGIN
61
          IF A4'FIRST /= IDENT_BOOL(FALSE)
62
             OR A4'LAST /= IDENT_BOOL(TRUE)
63
             OR A4'FIRST(2) /= INTEGER'(1)
64
             OR A4'LAST(2) /= INTEGER'(10)
65
          THEN
66
               FAILED ("INCORRECT 'FIRST OR 'LAST  - 1");
67
          END IF;
68
 
69
          IF A4'LENGTH /= INTEGER'(2)
70
             OR A4'LENGTH /= NI'(2)
71
             OR A4'LENGTH(1) /= N
72
             OR A4'LENGTH(2) /= A4'LAST(2)
73
          THEN
74
               FAILED ("INCORRECT 'LENGTH - 1");
75
          END IF;
76
 
77
          A4 := (BOOLEAN => (1 .. 10 => "XYZ"));
78
          FOR L1 IN A1'RANGE(1) LOOP
79
               FOR L2 IN A4'RANGE(2) LOOP
80
                    A1(L1,L2) := A4(L1,L2);
81
               END LOOP;
82
          END LOOP;
83
 
84
          IF AA'FIRST(1) /= NI'(-3)
85
             OR AA'LAST(1) /= N + 1
86
             OR AA'FIRST(2) /= -N
87
             OR AA'LAST(2) /= N
88
             OR AA'FIRST(3) /= IDENT_BOOL(FALSE)
89
             OR AA'LAST(3) /= IDENT_BOOL(TRUE)
90
          THEN
91
               FAILED ("INCORRECT 'FIRST OR 'LAST - 2");
92
          END IF;
93
 
94
          IF N NOT IN AA'RANGE(2)
95
             OR IDENT_BOOL(FALSE) NOT IN AA'RANGE(3)
96
             OR N + 1 NOT IN AA'RANGE
97
             OR N + 1 IN AA'RANGE(2)
98
          THEN
99
               FAILED ("INCORRECT 'RANGE - 1");
100
          END IF;
101
 
102
          IF AA'LENGTH /= INTEGER'(7)
103
             OR AA'LENGTH(2) - 3 /= N
104
             OR AA'LENGTH(3) /= 2
105
          THEN
106
               FAILED ("INCORRECT 'LENGTH - 2");
107
          END IF;
108
 
109
          IF A2'FIRST(1) /= NI'(-3)
110
             OR A2'LAST(1) /= N + 1
111
             OR A2'FIRST(2) /= -N
112
             OR A2'LAST(2) /= N
113
             OR A2'FIRST(3) /= IDENT_BOOL(FALSE)
114
             OR A2'LAST(3) /= IDENT_BOOL(TRUE)
115
          THEN
116
               FAILED ("INCORRECT 'FIRST OR 'LAST - 3");
117
          END IF;
118
 
119
          IF N NOT IN A2'RANGE(2)
120
             OR IDENT_BOOL(FALSE) NOT IN A2'RANGE(3)
121
             OR N + 1 NOT IN A2'RANGE
122
             OR N + 1 IN A2'RANGE(2)
123
          THEN
124
               FAILED ("INCORRECT 'RANGE - 2");
125
          END IF;
126
 
127
          IF A2'LENGTH /= INTEGER'(7)
128
             OR A2'LENGTH(2) - 3 /= INTEGER(N)
129
             OR A2'LENGTH(3) /= 2
130
          THEN
131
               FAILED ("INCORRECT 'LENGTH - 3");
132
          END IF;
133
 
134
          IF (AE_TYPE'FIRST /= 5) OR (AE_TYPE'LAST /= 7) THEN
135
             FAILED ("INCORRECT TYPE RANGE DEFINED FOR AE_TYPE");
136
          END IF;
137
     EXCEPTION
138
          WHEN OTHERS => FAILED  ("EXCEPTION RAISED ?");
139
     END;
140
 
141
     RESULT;
142
END C36204A;

powered by: WebSVN 2.1.0

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