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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- E52103Y.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 WHETHER A NULL ARRAY WITH ONE DIMENSION OF LENGTH GREATER THAN
26
-- INTEGER'LAST RAISES CONSTRAINT_ERROR OR NO EXCEPTION,
27
-- EITHER WHEN DECLARED OR  ASSIGNED.
28
 
29
-- CHECK THAT LENGTHS MUST MATCH IN ARRAY AND SLICE ASSIGNMENTS.
30
--    MORE SPECIFICALLY, TEST THAT ARRAY ASSIGNMENTS WITH MATCHING
31
--    LENGTHS DO NOT CAUSE  CONSTRAINT_ERROR  TO BE RAISED AND
32
--    ARE PERFORMED CORRECTLY.
33
--    (OVERLAPS BETWEEN THE OPERANDS OF THE ASSIGNMENT STATEMENT
34
--    ARE TREATED ELSEWHERE.)
35
 
36
 
37
-- THIS IS A SPECIAL CASE IN
38
 
39
--    DIVISION  D :  NULL ARRAYS WHOSE LENGTHS ARE NOT DETERMINABLE
40
--                   STATICALLY
41
 
42
-- WHICH (THE SPECIAL CASE) TREATS TWO-DIMENSIONAL ARRAYS WHOSE LENGTH
43
--    ALONG ONE DIMENSION IS GREATER THAN  INTEGER'LAST  AND WHOSE
44
--    LENGTH ALONG THE OTHER DIMENSION IS  0 .
45
 
46
 
47
-- *** NOTE: This test has been modified since ACVC version 1.11 to    -- 9X
48
-- ***       remove incompatibilities associated with the transition   -- 9X
49
-- ***       to Ada 9X.                                                -- 9X
50
-- ***                                                                 -- 9X
51
 
52
-- RM  07/31/81
53
-- SPS 03/22/83
54
-- JBG 05/02/83
55
-- JBG 06/01/85
56
-- EG  10/28/85  FIX NUMERIC_ERROR/CONSTRAINT_ERROR ACCORDING TO
57
--               AI-00387.
58
-- LDC 06/01/88  CHANGED HEADER COMMENT TO INDICATE CONSTRAINT_ERROR
59
--               IS ALLOWED.  ADDED CODE TO PREVENT DEAD VARIABLE
60
--               OPTIMIZATION.
61
-- MRM 03/30/93  REMOVED NUMERIC_ERROR FOR 9X COMPATIBILITY
62
 
63
WITH REPORT;
64
PROCEDURE  E52103Y  IS
65
 
66
     USE  REPORT ;
67
 
68
BEGIN
69
 
70
     TEST( "E52103Y","CHECK WHETHER CONSTRAINT_ERROR " &
71
                     "OR NO EXCEPTION IS RAISED WHEN DIMENSION OF " &
72
                     "AN ARRAY HAS LENGTH > INTEGER'LAST");
73
     BEGIN
74
 
75
          DECLARE
76
 
77
               TYPE  TA42  IS  ARRAY(
78
                    INTEGER RANGE IDENT_INT( 13 )..IDENT_INT( 12 ),
79
                    INTEGER RANGE IDENT_INT(-2)..IDENT_INT(INTEGER'LAST)
80
                                    )  OF BOOLEAN ;
81
 
82
               SUBTYPE  TA41  IS  TA42 ;
83
 
84
               ARR41  :  TA41 ;
85
               ARR42  :  TA42 ;
86
 
87
          BEGIN
88
 
89
               COMMENT ("NO EXCEPTION FOR ARRAY DECLARATION");
90
 
91
               -- NULL ARRAY ASSIGNMENT:
92
 
93
               ARR42 := ARR41 ;
94
               IF ARR42'LENGTH(1) /= 0 THEN
95
                    FOR I IN TA42'RANGE(2) LOOP
96
                         ARR41(13,I) := IDENT_BOOL(ARR42(13,I));
97
                    END LOOP;
98
               END IF;
99
 
100
               COMMENT ("NO EXCEPTION RAISED FOR NULL ARRAY " &
101
                        "ASSIGNMENT");
102
 
103
          EXCEPTION
104
 
105
               WHEN CONSTRAINT_ERROR =>
106
                    COMMENT ("CONSTRAINT_ERROR RAISED IN LENGTH " &
107
                             "COMPARISON");
108
 
109
               WHEN  OTHERS  =>
110
                    FAILED( "OTHER EXCEPTION RAISED  -  SUBTEST 2" );
111
 
112
          END ;
113
 
114
     EXCEPTION
115
 
116
          WHEN CONSTRAINT_ERROR =>
117
               COMMENT ("CONSTRAINT_ERROR RAISED BY DECLARATION OF " &
118
                        "NULL ARRAY TYPE WITH ONE DIMENSION > " &
119
                        "INTEGER'LAST");
120
 
121
          WHEN OTHERS =>
122
               FAILED ("SOME OTHER EXCEPTION RAISED");
123
 
124
     END;
125
 
126
     -------------------------------------------------------------------
127
 
128
 
129
     RESULT ;
130
 
131
 
132
END E52103Y;

powered by: WebSVN 2.1.0

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