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/] [cc/] [cc3305a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CC3305A.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 WHEN A GENERIC FORMAL TYPE IS A SCALAR TYPE, THE BOUNDS OF
26
-- THE ACTUAL PARAMETER ARE USED WITHIN THE INSTANTIATED UNIT.
27
 
28
-- CHECK WHEN THE SCALAR TYPE IS DEFINED BY (<>).
29
 
30
-- SPS 7/15/82
31
 
32
WITH REPORT;
33
USE REPORT;
34
 
35
PROCEDURE CC3305A IS
36
BEGIN
37
 
38
     TEST ("CC3305A", "TEST THE BOUNDS OF GENERIC FORMAL SCALAR " &
39
           "TYPES OF THE FORM (<>)");
40
 
41
     DECLARE
42
          TYPE COLOR IS (RED, BLUE, YELLOW, ORANGE, GREEN, PURPLE);
43
          SUBTYPE P_COLOR IS COLOR RANGE BLUE .. ORANGE;
44
          SUBTYPE INT IS INTEGER RANGE 1 .. 3;
45
          SUBTYPE ATOC IS CHARACTER RANGE CHARACTER'VAL(1) ..
46
               CHARACTER'VAL(3);
47
 
48
          GENERIC
49
               TYPE GFT IS (<>);
50
          PACKAGE PK IS END PK;
51
 
52
          PACKAGE BODY PK IS
53
          BEGIN
54
               FOR I IN IDENT_INT(0) .. IDENT_INT(4) LOOP
55
                    COMMENT ("START OF ITERATION");
56
                    DECLARE
57
                         VAR : GFT;
58
                    BEGIN
59
                         VAR := GFT'VAL (I);
60
                         IF I = 0 OR I = 4 THEN
61
                              FAILED ("CONSTRAINT_ERROR NOT RAISED");
62
                         END IF;
63
                    EXCEPTION
64
                         WHEN CONSTRAINT_ERROR =>
65
                              IF I /= 0 AND I /= 4 THEN
66
                                   FAILED ("CONSTRAINT_ERROR RAISED " &
67
                                      "INAPPROPRIATELY");
68
                              END IF;
69
                    END;
70
               END LOOP;
71
          END PK;
72
 
73
     BEGIN
74
          COMMENT ("INSTANTIATION WITH P_COLOR");
75
          DECLARE
76
               PACKAGE NPC IS NEW PK (P_COLOR);
77
          BEGIN
78
               NULL;
79
          END;
80
 
81
          COMMENT ("INSTANTIATION WITH INT");
82
 
83
          DECLARE
84
               PACKAGE NPI IS NEW PK (INT);
85
          BEGIN
86
               NULL;
87
          END;
88
 
89
          COMMENT ("INSTANTIATION WITH ATOC");
90
 
91
          DECLARE
92
               PACKAGE NPA IS NEW PK (ATOC);
93
          BEGIN
94
               NULL;
95
          END;
96
 
97
     EXCEPTION
98
          WHEN CONSTRAINT_ERROR =>
99
               FAILED ("CONSTRAINT_ERROR RAISED ON INSTANTIATION");
100
     END;
101
 
102
     RESULT;
103
END CC3305A;

powered by: WebSVN 2.1.0

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