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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C41204A.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 CONSTRAINT_ERROR IS RAISED IF A SLICE'S DISCRETE
26
--   RANGE IS NOT NULL, AND ITS LOWER OR UPPER BOUND IS NOT A
27
--   POSSIBLE INDEX FOR THE NAMED ARRAY.
28
 
29
-- WKB 8/4/81
30
-- EDS 7/14/98    AVOID OPTIMIZATION
31
 
32
WITH REPORT;
33
USE REPORT;
34
PROCEDURE C41204A IS
35
 
36
BEGIN
37
     TEST ("C41204A", "ILLEGAL UPPER OR LOWER BOUNDS FOR A " &
38
                      "SLICE RAISES CONSTRAINT_ERROR");
39
 
40
     DECLARE
41
 
42
          TYPE T IS ARRAY (INTEGER RANGE <> ) OF INTEGER;
43
          A : T (10..15) := (10,11,12,13,14,15);
44
          B : T (-20..30);
45
 
46
     BEGIN
47
 
48
          BEGIN
49
               B (IDENT_INT(9)..12) := A (IDENT_INT(9)..12);
50
               FAILED ("CONSTRAINT_ERROR NOT RAISED - 1" &
51
                       INTEGER'IMAGE(B(10)));
52
          EXCEPTION
53
               WHEN CONSTRAINT_ERROR => NULL;
54
               WHEN OTHERS           => FAILED ("WRONG EXCEPTION - 1");
55
          END;
56
 
57
          BEGIN
58
               B (IDENT_INT(-12)..14) := A (IDENT_INT(-12)..14);
59
               FAILED ("CONSTRAINT_ERROR NOT RAISED - 2" &
60
                       INTEGER'IMAGE(B(10)));
61
          EXCEPTION
62
               WHEN CONSTRAINT_ERROR => NULL;
63
               WHEN OTHERS           => FAILED ("WRONG EXCEPTION - 2");
64
          END;
65
 
66
          BEGIN
67
               B (11..IDENT_INT(16)) := A (11..IDENT_INT(16));
68
               FAILED ("CONSTRAINT_ERROR NOT RAISED - 3" &
69
                       INTEGER'IMAGE(B(15)));
70
          EXCEPTION
71
               WHEN CONSTRAINT_ERROR => NULL;
72
               WHEN OTHERS           => FAILED ("WRONG EXCEPTION - 3");
73
          END;
74
 
75
          BEGIN
76
               B (17..20) := A (IDENT_INT(17)..IDENT_INT(20));
77
               FAILED ("CONSTRAINT_ERROR NOT RAISED - 4" &
78
                       INTEGER'IMAGE(B(17)));
79
          EXCEPTION
80
               WHEN CONSTRAINT_ERROR => NULL;
81
               WHEN OTHERS           => FAILED ("WRONG EXCEPTION - 4");
82
          END;
83
     END;
84
 
85
     RESULT;
86
END C41204A;

powered by: WebSVN 2.1.0

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