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/] [ce/] [ce2201e.dep] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE2201E.DEP
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 WHETHER READ, WRITE, AND END_OF_FILE ARE SUPPORTED FOR
27
--     SEQUENTIAL FILES WITH VARIANT RECORDS WITH NON-DEFAULT
28
--     DISCRIMINANTS.
29
 
30
--     IF I/O IS NOT SUPPORTED, THEN CREATE AND OPEN CAN RAISE USE_ERROR
31
--     OR NAME_ERROR. SEE (AI-00332).
32
 
33
-- APPLICABILITY CRITERIA:
34
--     THIS TEST IS NON-APPLICABLE IF THE INSTANTIATION OF
35
--     SEQUENTIAL_IO WITH VARIANT RECORDS HAVING NO DEFAULT
36
--     DISCRIMINANT VALUES IS REJECTED.
37
 
38
-- HISTORY:
39
--     JBG 1/6/83
40
--     JBG 5/2/83
41
--     TBN 11/18/85     RENAMED FROM CE2201E.DEP AND MODIFIED COMMENTS.
42
--                      SPLIT DEFAULT DISCRIMINANT CASE INTO
43
--                      CE2201G.ADA.
44
--     TBN 11/04/86     REVISED TEST TO OUTPUT A NON_APPLICABLE
45
--                      RESULT WHEN FILES ARE NOT SUPPORTED.
46
--     THS 03/30/90     RENAMED FROM EE2201E.ADA.
47
 
48
WITH REPORT; USE REPORT;
49
WITH SEQUENTIAL_IO;
50
 
51
PROCEDURE CE2201E IS
52
     INCOMPLETE : EXCEPTION;
53
 
54
BEGIN
55
 
56
     TEST ("CE2201E", "CHECK WHETHER READ, WRITE, AND END_OF_FILE " &
57
                      "ARE SUPPORTED FOR SEQUENTIAL FILES WITH " &
58
                      "UNCONSTRAINED VARIANT RECORD TYPES WITH " &
59
                      "NON-DEFAULT DISCRIMINANTS.");
60
 
61
     DECLARE
62
          TYPE VAR_REC (DISCR : BOOLEAN) IS
63
               RECORD
64
                    CASE DISCR IS
65
                         WHEN TRUE =>
66
                              A : INTEGER;
67
                         WHEN FALSE =>
68
                              B : STRING (1..20);
69
                    END CASE;
70
               END RECORD;
71
 
72
          PACKAGE SEQ_VAR_REC
73
               IS NEW SEQUENTIAL_IO (VAR_REC);  -- N/A => ERROR.
74
          USE SEQ_VAR_REC;
75
 
76
          FILE_VAR_REC : FILE_TYPE;
77
          ITEM_TRUE  : VAR_REC(TRUE);
78
          ITEM_FALSE : VAR_REC(FALSE);
79
 
80
     BEGIN
81
 
82
          BEGIN
83
               CREATE (FILE_VAR_REC);
84
          EXCEPTION
85
               WHEN USE_ERROR =>
86
                    NOT_APPLICABLE ("USE_ERROR RAISED; SEQUENTIAL " &
87
                                    "CREATE");
88
                    RAISE INCOMPLETE;
89
               WHEN NAME_ERROR =>
90
                    NOT_APPLICABLE ("NAME_ERROR RAISED; SEQUENTIAL " &
91
                                    "CREATE");
92
                    RAISE INCOMPLETE;
93
               WHEN OTHERS =>
94
                    FAILED ("UNEXPECTED EXCEPTION RAISED; SEQUENTIAL " &
95
                            "CREATE");
96
                    RAISE INCOMPLETE;
97
          END;
98
 
99
          BEGIN
100
               WRITE (FILE_VAR_REC, (TRUE, -6));
101
               WRITE (FILE_VAR_REC, (FALSE, (1..20 => 'C')));
102
          EXCEPTION
103
               WHEN OTHERS =>
104
                    FAILED ("WRITE FOR RECORD WITH DISCRIMINANT");
105
          END;
106
 
107
          BEGIN
108
               RESET (FILE_VAR_REC,IN_FILE);
109
          EXCEPTION
110
               WHEN USE_ERROR =>
111
                    NOT_APPLICABLE ("USE_ERROR FOR RESET");
112
                    RAISE INCOMPLETE;
113
          END;
114
 
115
          IF END_OF_FILE (FILE_VAR_REC) THEN
116
               FAILED ("WRONG END_OF_FILE VALUE FOR RECORD" &
117
                       "WITH DISCRIMINANT");
118
          END IF;
119
 
120
          BEGIN
121
               READ (FILE_VAR_REC,ITEM_TRUE);
122
 
123
               IF ITEM_TRUE /= (TRUE, IDENT_INT(-6)) THEN
124
                    FAILED ("READ WRONG VALUE - 1");
125
               END IF;
126
 
127
               IF END_OF_FILE (FILE_VAR_REC) THEN
128
                    FAILED ("PREMATURE END OF FILE");
129
               END IF;
130
 
131
               READ (FILE_VAR_REC, ITEM_FALSE);
132
 
133
               IF ITEM_FALSE /= (FALSE, (1..IDENT_INT(20) => 'C')) THEN
134
                    FAILED ("READ WRONG VALUE - 2");
135
               END IF;
136
 
137
               IF NOT END_OF_FILE(FILE_VAR_REC) THEN
138
                    FAILED ("NOT AT END OF FILE");
139
               END IF;
140
 
141
          EXCEPTION
142
               WHEN OTHERS =>
143
                    FAILED ("READ FOR VARIANT RECORD");
144
          END;
145
 
146
          CLOSE (FILE_VAR_REC);
147
 
148
     END;
149
     RESULT;
150
 
151
EXCEPTION
152
     WHEN INCOMPLETE =>
153
          RESULT;
154
 
155
END CE2201E;

powered by: WebSVN 2.1.0

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