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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C41206A.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 A RANGE L..R, WHERE L=SUCC(R) CAN BE USED TO FORM
26
--   A NULL SLICE FROM AN ARRAY WHEN:
27
--        BOTH L AND R SATISFY THE INDEX CONSTRAINT;
28
--        L SATISFIES THE INDEX CONSTRAINT, R DOES NOT (BUT IT
29
--             BELONGS TO THE BASE TYPE OF THE INDEX);
30
--        L SATISFIES THE CONSTRAINT IMPOSED BY THE TYPE MARK OF
31
--             THE INDEX, BUT NOT THE CONSTRAINT ASSOCIATED WITH
32
--             THE INDEX;
33
--        THE ARRAY IS NULL, AND L IS IN THE RANGE OF THE INDEX SUBTYPE.
34
 
35
-- WKB 8/10/81
36
 
37
WITH REPORT;
38
USE REPORT;
39
PROCEDURE C41206A IS
40
 
41
     TYPE SMALL IS RANGE 1..100;
42
     TYPE T IS ARRAY (SMALL RANGE <> ) OF INTEGER;
43
     SUBTYPE T1 IS T(5..10);
44
     A : T1 := (5,6,7,8,9,10);
45
     B : T(8..7) := (8..7 => 1);
46
 
47
BEGIN
48
     TEST ("C41206A", "USING A RANGE L..R, WHERE L=SUCC(R), " &
49
                      "TO FORM A NULL SLICE FROM AN ARRAY");
50
 
51
     BEGIN
52
          IF A (7..6) /= B OR A (SMALL(IDENT_INT(7))..6) /= B THEN
53
               FAILED ("SLICE NOT NULL - 1");
54
          END IF;
55
     EXCEPTION
56
          WHEN OTHERS => FAILED ("EXCEPTION RAISED - 1");
57
     END;
58
 
59
     BEGIN
60
          IF A (5..4) /= B OR A (SMALL(IDENT_INT(5))..4) /= B THEN
61
               FAILED ("SLICE NOT NULL - 2");
62
          END IF;
63
     EXCEPTION
64
          WHEN OTHERS => FAILED ("EXCEPTION RAISED - 2");
65
     END;
66
 
67
     BEGIN
68
          IF A (50..49) /= B OR A (SMALL(IDENT_INT(50))..49) /= B THEN
69
               FAILED ("SLICE NOT NULL - 3");
70
          END IF;
71
     EXCEPTION
72
          WHEN OTHERS => FAILED ("EXCEPTION RAISED - 3");
73
     END;
74
 
75
     BEGIN
76
          IF B (50..49) /= B OR B (SMALL(IDENT_INT(50))..49) /= B THEN
77
               FAILED ("SLICE NOT NULL - 4");
78
          END IF;
79
     EXCEPTION
80
          WHEN OTHERS => FAILED ("EXCEPTION RAISED - 4");
81
     END;
82
 
83
     RESULT;
84
END C41206A;

powered by: WebSVN 2.1.0

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