OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [cc/] [cc1004a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CC1004A.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 THE ELABORATION OF A GENERIC DECLARATION
27
--     DOES NOT ELABORATE THE SUBPROGRAM OR PACKAGE SPECIFICATION.
28
 
29
-- HISTORY:
30
--     DAT 07/31/81  CREATED ORIGINAL TEST.
31
--     SPS 10/18/82
32
--     SPS 02/09/83
33
--     JET 01/07/88  UPDATED HEADER FORMAT AND ADDED CODE TO
34
--                   PREVENT OPTIMIZATION.
35
 
36
WITH REPORT; USE REPORT;
37
 
38
PROCEDURE CC1004A IS
39
BEGIN
40
     TEST ("CC1004A", "THE SPECIFICATION PART OF A GENERIC " &
41
                      "SUBPROGRAM IS NOT ELABORATED AT THE " &
42
                      "ELABORATION OF THE DECLARATION");
43
 
44
     BEGIN
45
          DECLARE
46
               SUBTYPE I1 IS INTEGER RANGE 1 .. 1;
47
 
48
               GENERIC
49
               PROCEDURE PROC (P1: I1 := IDENT_INT(2));
50
 
51
               PROCEDURE PROC (P1: I1 := IDENT_INT(2)) IS
52
               BEGIN
53
                    IF NOT EQUAL (P1,P1) THEN
54
                         COMMENT ("DON'T OPTIMIZE THIS");
55
                    END IF;
56
               END PROC;
57
          BEGIN
58
               BEGIN
59
                    DECLARE
60
                         PROCEDURE P IS NEW PROC;
61
                    BEGIN
62
                         IF NOT EQUAL(3,3) THEN
63
                              P(1);
64
                         END IF;
65
                    END;
66
               EXCEPTION
67
                    WHEN OTHERS =>
68
                         FAILED ("INSTANTIATION ELABORATES SPEC");
69
               END;
70
 
71
          END;
72
     EXCEPTION
73
          WHEN OTHERS =>
74
               FAILED ("DECL ELABORATED SPEC PART - 1");
75
     END;
76
 
77
     BEGIN
78
          DECLARE
79
               SUBTYPE I1 IS INTEGER RANGE 1 .. 1;
80
 
81
               GENERIC
82
               PACKAGE PKG IS
83
                    X : INTEGER := I1(IDENT_INT(2));
84
               END PKG;
85
          BEGIN
86
               BEGIN
87
                    DECLARE
88
                         PACKAGE P IS NEW PKG;
89
                    BEGIN
90
                         FAILED ("PACKAGE INSTANTIATION FAILED");
91
                         IF NOT EQUAL(P.X,P.X) THEN
92
                              COMMENT("DON'T OPTIMIZE THIS");
93
                         END IF;
94
                    END;
95
               EXCEPTION
96
                    WHEN CONSTRAINT_ERROR => NULL;
97
                    WHEN OTHERS => FAILED ("WRONG EXCEPTION - 2");
98
               END;
99
 
100
          END;
101
     EXCEPTION
102
          WHEN OTHERS =>
103
               FAILED ("DECL ELABORATED SPEC PART - 2");
104
     END;
105
 
106
     RESULT;
107
 
108
END CC1004A;

powered by: WebSVN 2.1.0

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