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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE2102G.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 USE_ERROR IS RAISED IF AN IMPLEMENTATION DOES NOT
27
--     SUPPORT RESET FOR SEQUENTIAL_IO.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
31
--     SEQUENTIAL FILES.
32
 
33
-- HISTORY:
34
--     SPS 08/27/82
35
--     JBG 06/04/84
36
--     TBN 02/12/86  SPLIT TEST.  PUT DIRECT_IO INTO CE2102K.ADA.
37
--     TBN 09/15/87  COMPLETELY REVISED TEST.
38
 
39
WITH SEQUENTIAL_IO;
40
WITH REPORT; USE REPORT;
41
PROCEDURE CE2102G IS
42
     INCOMPLETE : EXCEPTION;
43
BEGIN
44
     TEST ("CE2102G", "CHECK THAT USE_ERROR IS RAISED IF AN " &
45
                      "IMPLEMENTATION DOES NOT SUPPORT RESET FOR " &
46
                      "SEQUENTIAL_IO");
47
     DECLARE
48
          PACKAGE SEQ IS NEW SEQUENTIAL_IO (INTEGER);
49
          USE SEQ;
50
          FILE1 : FILE_TYPE;
51
          INT1 : INTEGER := IDENT_INT(1);
52
          INT2 : INTEGER := 2;
53
     BEGIN
54
          BEGIN
55
               CREATE (FILE1, OUT_FILE, LEGAL_FILE_NAME);
56
          EXCEPTION
57
               WHEN USE_ERROR =>
58
                    NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE OF " &
59
                                    "SEQUENTIAL FILE WITH OUT_FILE " &
60
                                    "MODE");
61
                    RAISE INCOMPLETE;
62
               WHEN NAME_ERROR =>
63
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE OF " &
64
                                    "SEQUENTIAL FILE WITH OUT_FILE " &
65
                                    "MODE");
66
                    RAISE INCOMPLETE;
67
          END;
68
 
69
          WRITE (FILE1, INT2);
70
          BEGIN
71
               RESET (FILE1, IN_FILE);
72
               COMMENT ("RESET FROM OUT_FILE TO IN_FILE IS ALLOWED");
73
               BEGIN
74
                    READ (FILE1, INT1);
75
                    IF INT1 /= IDENT_INT(2) THEN
76
                         FAILED ("RESETTING FROM OUT_FILE TO IN_FILE " &
77
                                 "AFFECTED DATA");
78
                    END IF;
79
               EXCEPTION
80
                    WHEN OTHERS =>
81
                         FAILED ("UNEXPECTED EXCEPTION RAISED WHILE " &
82
                                 "READING FROM FILE");
83
               END;
84
          EXCEPTION
85
               WHEN USE_ERROR =>
86
                    COMMENT ("RESET FROM OUT_FILE TO IN_FILE IS NOT " &
87
                             "ALLOWED");
88
               WHEN OTHERS =>
89
                    FAILED ("UNEXPECTED EXCEPTION RAISED WHEN " &
90
                            "RESETTING FROM OUT_FILE TO IN_FILE");
91
          END;
92
 
93
          CLOSE (FILE1);
94
 
95
          BEGIN
96
               OPEN (FILE1, IN_FILE, LEGAL_FILE_NAME);
97
          EXCEPTION
98
               WHEN USE_ERROR =>
99
                    NOT_APPLICABLE ("USE_ERROR RAISED ON OPENING OF " &
100
                                    "SEQUENTIAL FILE WITH IN_FILE " &
101
                                    "MODE");
102
                    RAISE INCOMPLETE;
103
          END;
104
 
105
          BEGIN
106
               RESET (FILE1, OUT_FILE);
107
               COMMENT ("RESET FROM IN_FILE TO OUT_FILE IS ALLOWED");
108
          EXCEPTION
109
               WHEN USE_ERROR =>
110
                    COMMENT ("RESET FROM IN_FILE TO OUT_FILE IS NOT " &
111
                             "ALLOWED");
112
               WHEN OTHERS =>
113
                    FAILED ("UNEXPECTED EXCEPTION RAISED WHEN " &
114
                            "RESETTING FROM IN_FILE TO OUT_FILE");
115
          END;
116
 
117
          BEGIN
118
               DELETE (FILE1);
119
          EXCEPTION
120
               WHEN USE_ERROR =>
121
                    NULL;
122
          END;
123
 
124
     EXCEPTION
125
          WHEN INCOMPLETE =>
126
               NULL;
127
     END;
128
 
129
     RESULT;
130
END CE2102G;

powered by: WebSVN 2.1.0

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