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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C87B23A.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 OVERLOADING RESOLUTION USES THE RULE THAT:
26
--
27
-- FOR AN INDEXED COMPONENT OF AN ARRAY, THE PREFIX MUST BE 
28
-- APPROPRIATE FOR AN ARRAY TYPE. EACH EXPRESSION FOR THE INDEXED 
29
-- COMPONENT MUST BE OF THE TYPE OF THE CORRESPONDING INDEX AND
30
-- THERE MUST BE ONE SUCH EXPRESSION FOR EACH INDEX POSITION OF THE 
31
-- ARRAY TYPE.
32
 
33
-- TRH  15 SEPT 82
34
-- DSJ  07 JUNE 83
35
 
36
WITH REPORT; USE REPORT;
37
 
38
PROCEDURE C87B23A IS
39
 
40
     SUBTYPE CHAR IS CHARACTER;
41
     TYPE GRADE IS (A, B, C, D, F);
42
     TYPE NOTE  IS (A, B, C, D, E, F, G);
43
     TYPE INT   IS NEW INTEGER;
44
     TYPE POS   IS NEW INTEGER RANGE 1 .. INTEGER'LAST;
45
     TYPE NAT   IS NEW POS;
46
     TYPE BOOL  IS NEW BOOLEAN;
47
     TYPE BIT   IS NEW BOOL;
48
     TYPE LIT   IS (FALSE, TRUE);
49
     TYPE FLAG  IS (PASS, FAIL);
50
 
51
     TYPE NUM2 IS DIGITS(2);
52
     TYPE NUM3 IS DIGITS(2);
53
     TYPE NUM4 IS DIGITS(2);
54
 
55
     TYPE A1 IS ARRAY (POS'(1)..5, NOTE'(A)..D, BOOL'(FALSE)..TRUE)
56
          OF FLOAT;
57
     TYPE A2 IS ARRAY (INT'(1)..5, NOTE'(A)..D, BIT'(FALSE)..TRUE)
58
          OF NUM2;
59
     TYPE A3 IS ARRAY (POS'(1)..5, GRADE'(A)..D, BOOL'(FALSE)..TRUE)
60
          OF NUM3;
61
     TYPE A4 IS ARRAY (NAT'(1)..5, NOTE'(A)..D, LIT'(FALSE)..TRUE)
62
          OF NUM4;
63
 
64
     OBJ1 : A1 := (OTHERS => (OTHERS => (OTHERS => 0.0)));
65
     OBJ2 : A2 := (OTHERS => (OTHERS => (OTHERS => 0.0)));
66
     OBJ3 : A3 := (OTHERS => (OTHERS => (OTHERS => 0.0)));
67
     OBJ4 : A4 := (OTHERS => (OTHERS => (OTHERS => 0.0)));
68
 
69
     GENERIC
70
          TYPE T IS PRIVATE;
71
          ARG  : IN T;
72
          STAT : IN FLAG;
73
     FUNCTION F1 RETURN T;
74
 
75
     FUNCTION F1 RETURN T IS
76
     BEGIN
77
          IF STAT = FAIL THEN
78
               FAILED ("PREFIX OR INDEX IS NOT APPROPRIATE FOR" &
79
                       " INDEXED COMPONENT");
80
          END IF;
81
          RETURN ARG;
82
     END F1;
83
 
84
     FUNCTION A IS NEW F1 (A1, OBJ1, PASS);
85
     FUNCTION A IS NEW F1 (A2, OBJ2, FAIL);
86
     FUNCTION A IS NEW F1 (A3, OBJ3, FAIL);
87
     FUNCTION A IS NEW F1 (A4, OBJ4, FAIL);
88
 
89
BEGIN
90
     TEST ("C87B23A","OVERLOADED ARRAY INDEXES");
91
 
92
     DECLARE
93
          F1 : FLOAT := A (3, C, TRUE);
94
 
95
     BEGIN
96
          NULL;
97
     END;
98
 
99
     RESULT;
100
END C87B23A;

powered by: WebSVN 2.1.0

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