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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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