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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C41101D.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
-- FOR INDEXED COMPONENTS OF THE FORM F(...), CHECK THAT 
26
--   THE NUMBER OF INDEX VALUES, THE TYPE OF THE INDEX
27
--   VALUES, AND THE REQUIRED TYPE OF THE INDEXED COMPONENT
28
--   ARE USED TO RESOLVE AN OVERLOADING OF F.
29
 
30
-- WKB 8/12/81
31
-- JBG 10/12/81
32
-- SPS 11/1/82
33
 
34
WITH REPORT;
35
PROCEDURE C41101D IS
36
 
37
     USE REPORT;
38
 
39
     TYPE T1 IS ARRAY (1..10) OF INTEGER;
40
     TYPE T2 IS ARRAY (1..10, 1..10) OF INTEGER;
41
     I : INTEGER;
42
 
43
     TYPE U1 IS (MON,TUE,WED,THU,FRI);
44
     TYPE U2 IS ARRAY (U1 RANGE MON..THU) OF INTEGER;
45
 
46
     TYPE V1 IS ARRAY (1..10) OF BOOLEAN;
47
     B : BOOLEAN;
48
 
49
     FUNCTION F RETURN T1 IS
50
     BEGIN
51
          RETURN (1..10 => 1);
52
     END F;
53
 
54
     FUNCTION F RETURN T2 IS
55
     BEGIN
56
          RETURN (1..10 => (1..10 => 2));
57
     END F;
58
 
59
     FUNCTION G RETURN U2 IS
60
     BEGIN
61
          RETURN (MON..THU => 3);
62
     END G;
63
 
64
     FUNCTION G RETURN T1 IS
65
     BEGIN
66
          RETURN (1..10 => 4);
67
     END G;
68
 
69
     FUNCTION H RETURN T1 IS
70
     BEGIN
71
          RETURN (1..10 => 5);
72
     END H;
73
 
74
     FUNCTION H RETURN V1 IS
75
     BEGIN
76
          RETURN (1..10 => FALSE);
77
     END H;
78
 
79
BEGIN
80
 
81
     TEST ("C41101D", "WHEN INDEXING FUNCTION RESULTS, INDEX TYPE, " &
82
                      "NUMBER OF INDICES, AND COMPONENT TYPE ARE " &
83
                      "USED FOR OVERLOADING RESOLUTION");
84
 
85
     I := F(7);              -- NUMBER OF INDEX VALUES.
86
     IF I /= IDENT_INT(1) THEN
87
          FAILED ("WRONG VALUE - 1");
88
     END IF;
89
 
90
     I := G(3);              -- INDEX TYPE.
91
     IF I /= IDENT_INT(4) THEN
92
          FAILED ("WRONG VALUE - 2");
93
     END IF;
94
 
95
     B := H(5);              -- COMPONENT TYPE.
96
     IF B /= IDENT_BOOL(FALSE) THEN
97
          FAILED ("WRONG VALUE - 3");
98
     END IF;
99
 
100
     RESULT;
101
 
102
END C41101D;

powered by: WebSVN 2.1.0

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