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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C85005G.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 ANY SUBTYPE CONSTRAINT IMPOSED BY THE TYPE MARK USED
27
--     IN THE RENAMING DECLARATION IS IGNORED, AND THE SUBTYPE
28
--     CONSTRAINT ASSOCIATED WITH THE RENAMED VARIABLE IS USED INSTEAD.
29
 
30
-- *** NOTE: This test has been modified since ACVC version 1.11 to    -- 9X
31
-- ***       remove incompatibilities associated with the transition   -- 9X
32
-- ***       to Ada 9X.                                                -- 9X
33
-- ***                                                                 -- 9X
34
 
35
-- HISTORY:
36
--     JET 07/26/88  CREATED ORIGINAL TEST.
37
--     MRM 03/30/93  REMOVED NUMERIC_ERROR FOR 9X COMPATIBILITY
38
 
39
WITH REPORT; USE REPORT;
40
PROCEDURE C85005G IS
41
 
42
     SUBTYPE INT IS INTEGER RANGE -100 .. 100;
43
 
44
     I : INTEGER := IDENT_INT(INTEGER'LAST);
45
     J : INT := IDENT_INT(INT'LAST);
46
 
47
     DG1 : INTEGER := IDENT_INT(INTEGER'LAST);
48
     DG2 : INT := IDENT_INT(INT'LAST);
49
 
50
     XI : INT RENAMES I;
51
     XJ : INTEGER RENAMES J;
52
 
53
     GENERIC
54
          G1 : IN OUT INT;
55
          G2 : IN OUT INTEGER;
56
     PROCEDURE GEN;
57
 
58
     PROCEDURE GEN IS
59
          XG1 : INT RENAMES G1;
60
          XG2 : INTEGER RENAMES G2;
61
     BEGIN
62
          IF XG1 /= INTEGER'LAST THEN
63
               FAILED("INCORRECT VALUE OF RENAMING VARIABLE - G1");
64
          END IF;
65
 
66
          XG1 := IDENT_INT(INTEGER'FIRST);
67
 
68
          IF XG1 /= INTEGER'FIRST THEN
69
               FAILED("INCORRECT VALUE OF RENAMING VARIABLE - G2");
70
          END IF;
71
 
72
          IF XG2 /= INT'LAST THEN
73
               FAILED("INCORRECT VALUE OF RENAMING VARIABLE - G3");
74
          END IF;
75
 
76
          XG2 := IDENT_INT(INT'FIRST);
77
 
78
          IF XG2 /= INT'FIRST THEN
79
               FAILED("INCORRECT VALUE OF RENAMING VARIABLE - G4");
80
          END IF;
81
 
82
          BEGIN
83
               XG2 := IDENT_INT(INTEGER'LAST);
84
               FAILED ("NO EXCEPTION RAISED BY XG2 := INTEGER'LAST");
85
               IF NOT EQUAL(XG2,XG2) THEN
86
                    COMMENT ("DON'T OPTIMIZE XG2");
87
               END IF;
88
          EXCEPTION
89
               WHEN CONSTRAINT_ERROR =>
90
                    NULL;
91
               WHEN OTHERS =>
92
                    FAILED ("UNEXPECTED EXCEPTION (G)");
93
          END;
94
     END GEN;
95
 
96
     PROCEDURE PROC IS NEW GEN(DG1, DG2);
97
 
98
BEGIN
99
     TEST ("C85005G", "CHECK THAT ANY SUBTYPE CONSTRAINT IMPOSED BY " &
100
                      "THE TYPE MARK USED IN THE RENAMING " &
101
                      "DECLARATION IS IGNORED, AND THE SUBTYPE " &
102
                      "CONSTRAINT ASSOCIATED WITH THE RENAMED " &
103
                      "VARIABLE IS USED INSTEAD");
104
 
105
     IF XI /= INTEGER'LAST THEN
106
          FAILED("INCORRECT VALUE OF RENAMING VARIABLE - 1");
107
     END IF;
108
 
109
     XI := IDENT_INT(INTEGER'FIRST);
110
 
111
     IF XI /= INTEGER'FIRST THEN
112
          FAILED("INCORRECT VALUE OF RENAMING VARIABLE - 2");
113
     END IF;
114
 
115
     IF XJ /= INT'LAST THEN
116
          FAILED("INCORRECT VALUE OF RENAMING VARIABLE - 3");
117
     END IF;
118
 
119
     XJ := IDENT_INT(INT'FIRST);
120
 
121
     IF XJ /= INT'FIRST THEN
122
          FAILED("INCORRECT VALUE OF RENAMING VARIABLE - 4");
123
     END IF;
124
 
125
     BEGIN
126
          XJ := IDENT_INT(INTEGER'LAST);
127
          FAILED ("NO EXCEPTION RAISED BY XJ := INTEGER'LAST");
128
          IF NOT EQUAL(XJ,XJ) THEN
129
               COMMENT ("DON'T OPTIMIZE XJ");
130
          END IF;
131
     EXCEPTION
132
          WHEN CONSTRAINT_ERROR =>
133
                NULL;
134
          WHEN OTHERS =>
135
                FAILED ("UNEXPECTED EXCEPTION - 1");
136
     END;
137
 
138
     PROC;
139
 
140
     RESULT;
141
EXCEPTION
142
     WHEN OTHERS =>
143
          FAILED("UNEXPECTED EXCEPTION - 2");
144
          RESULT;
145
END C85005G;

powered by: WebSVN 2.1.0

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