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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C38104A.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 AN INCOMPLETE TYPE WITH DISCRIMINANTS CAN BE
27
--     USED IN AN ACCESS TYPE DEFINITION WITH A COMPATIBLE DISCRIMINANT
28
--     CONSTRAINT.
29
 
30
-- HISTORY:
31
--     PMW 09/01/88  CREATED ORIGINAL TEST BY RENAMING E38104A.ADA.
32
 
33
WITH REPORT;  USE REPORT;
34
PROCEDURE C38104A IS
35
 
36
BEGIN
37
 
38
     TEST ("C38104A","INCOMPLETELY DECLARED TYPE CAN BE USED AS TYPE " &
39
           "MARK IN ACCESS TYPE DEFINITION, AND CAN BE CONSTRAINED " &
40
           "THERE OR LATER IF INCOMPLETE TYPE HAD DISCRIMINANT(S)");
41
 
42
     DECLARE
43
          TYPE T1;
44
          TYPE T1_NAME IS ACCESS T1;
45
 
46
          TYPE T1 IS
47
               RECORD
48
                    COMP : INTEGER;
49
               END RECORD;
50
 
51
          TYPE T2(DISC : INTEGER := 5);
52
          TYPE T2_NAME1 IS ACCESS T2(5);
53
          TYPE T2_NAME2 IS ACCESS T2;
54
 
55
          SUBTYPE SUB_T2_NAME2 IS T2_NAME2(5);
56
          TYPE T2_NAME2_NAME IS ACCESS T2_NAME2(5);
57
          X : T2_NAME2(5);
58
 
59
          TYPE T2(DISC : INTEGER := 5) IS
60
               RECORD
61
                    COMP : T2_NAME2(DISC);
62
               END RECORD;
63
 
64
          X1N : T1_NAME;
65
          X2A,X2B : T2;
66
          X2N2 : T2_NAME2;
67
 
68
     BEGIN
69
          IF EQUAL(3,3) THEN
70
               X1N := NEW T1 '(COMP => 5);
71
          END IF;
72
 
73
          IF X1N.COMP /= 5 THEN
74
               FAILED ("ASSIGNMENT FAILED - 1");
75
          END IF;
76
 
77
          X2A := (DISC => IDENT_INT(7), COMP => NULL);
78
          X2N2 := NEW T2(IDENT_INT(7));
79
          X2N2.ALL := X2A;
80
 
81
          IF EQUAL(3,3) THEN
82
               X2B := (DISC => IDENT_INT(7), COMP => X2N2);
83
          END IF;
84
 
85
          IF X2B.COMP.COMP /= NULL
86
               OR X2B.COMP.DISC /= 7 THEN
87
               FAILED ("ASSIGNMENT FAILED - 2");
88
          END IF;
89
 
90
     EXCEPTION
91
          WHEN OTHERS =>
92
               FAILED ("EXCEPTION RAISED");
93
     END;
94
 
95
     RESULT;
96
 
97
END C38104A;

powered by: WebSVN 2.1.0

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