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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C35503P.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
-- OBJECTIVE:
26
--     CHECK THAT 'FIRST' AND 'LAST' YIELD THE CORRECT RESULTS WHEN THE
27
--     PREFIX IS A GENERIC FORMAL DISCRETE TYPE WHOSE ARGUMENT IS AN
28
--     INTEGER TYPE.
29
 
30
-- HISTORY:
31
--     RJW 03/24/86 CREATED ORIGINAL TEST.
32
--     DHH 10/19/87 SHORTENED LINES CONTAINING MORE THAN 72 CHARACTERS.
33
 
34
WITH REPORT; USE REPORT;
35
 
36
PROCEDURE C35503P IS
37
 
38
BEGIN
39
     TEST ("C35503P", "CHECK THAT 'FIRST' AND 'LAST' YIELD THE " &
40
                      "CORRECT RESULTS WHEN THE PREFIX IS A " &
41
                      "GENERIC FORMAL DISCRETE TYPE WHOSE ARGUMENT " &
42
                      "IS AN INTEGER TYPE" );
43
 
44
 
45
     DECLARE
46
 
47
          TYPE INT IS RANGE -6 .. 6;
48
          SUBTYPE SINT IS INT RANGE INT(IDENT_INT(-4)) ..
49
                                                     INT(IDENT_INT(4));
50
          SUBTYPE NOINT IS INT RANGE INT(IDENT_INT(1)) ..
51
                                                    INT(IDENT_INT(-1));
52
 
53
          GENERIC
54
               TYPE I IS (<>);
55
               F, L : I;
56
          PROCEDURE P ( STR : STRING );
57
 
58
          PROCEDURE P ( STR : STRING ) IS
59
          BEGIN
60
               IF I'FIRST /= F THEN
61
                    FAILED ( "INCORRECT 'FIRST' FOR " & STR );
62
               END IF;
63
               IF I'LAST /= L THEN
64
                    FAILED ( "INCORRECT 'LAST' FOR " & STR );
65
               END IF;
66
          END P;
67
 
68
          GENERIC
69
               TYPE I IS (<>);
70
               F, L : I;
71
          PROCEDURE Q;
72
 
73
          PROCEDURE Q IS
74
               SUBTYPE SI IS I;
75
          BEGIN
76
               IF SI'FIRST /= F THEN
77
                    FAILED ( "INCORRECT VALUE FOR INTEGER'FIRST" );
78
               END IF;
79
               IF SI'LAST /= L THEN
80
                    FAILED ( "INCORRECT VALUE FOR INTEGER'LAST" );
81
               END IF;
82
          END Q;
83
 
84
          GENERIC
85
               TYPE I IS (<>);
86
          PROCEDURE R;
87
 
88
          PROCEDURE R IS
89
               SUBTYPE SI IS I;
90
          BEGIN
91
               IF SI'FIRST /= SI'VAL (IDENT_INT(1)) THEN
92
                    FAILED ( "INCORRECT VALUE FOR NOINT'FIRST" );
93
               END IF;
94
               IF SI'LAST /= SI'VAL (IDENT_INT(-1)) THEN
95
                    FAILED ( "INCORRECT VALUE FOR NOINT'LAST" );
96
               END IF;
97
          END R;
98
 
99
          PROCEDURE P1 IS NEW P ( I => INT, F => -6, L => 6 );
100
          PROCEDURE P2 IS NEW P ( I => SINT, F => -4, L => 4 );
101
          PROCEDURE Q1 IS NEW Q
102
               ( I => INTEGER, F => INTEGER'FIRST, L => INTEGER'LAST );
103
          PROCEDURE R1 IS NEW R ( I => NOINT);
104
 
105
     BEGIN
106
          P1 ( "INT" );
107
          P2 ( "SINT" );
108
          Q1;
109
          R1;
110
     END;
111
 
112
     RESULT;
113
END C35503P;

powered by: WebSVN 2.1.0

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