Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / ce / ce3704d.ada
blob233b8642a040fa98cea72c2291699739b01317c8
1 -- CE3704D.ADA
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.
16 -- DISCLAIMER
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 INTEGER_IO GET READS AT MOST WIDTH CHARACTERS
27 -- OR UP TO THE NEXT TERMINATOR; INCLUDING LEADING BLANKS
28 -- AND HORIZONTAL TABULATION CHARACTERS, WHEN WIDTH IS
29 -- NONZERO.
31 -- CHECK THAT INPUT TERMINATES WHEN A LINE TERMINATOR IS
32 -- ENCOUNTERED AND THAT DATA_ERROR IS RAISED IF THE DATA
33 -- READ IS INVALID.
35 -- APPLICABILITY CRITERIA:
37 -- THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH
38 -- SUPPORT TEXT FILES.
40 -- HISTORY:
41 -- SPS 10/04/82
42 -- VKG 01/12/83
43 -- SPS 02/08/83
44 -- JBG 02/22/84 CHANGED TO .ADA TEST
45 -- RJW 11/04/86 REVISED TEST TO OUTPUT A NON_APPLICABLE
46 -- RESULT WHEN FILES ARE NOT SUPPORTED.
47 -- DWC 09/09/87 ADDED CASES FOR TABS, REMOVED UNNECESSARY
48 -- CODE, AND CHECKED FOR USE_ERROR ON DELETE.
50 WITH REPORT; USE REPORT;
51 WITH TEXT_IO; USE TEXT_IO;
53 PROCEDURE CE3704D IS
54 INCOMPLETE : EXCEPTION;
56 BEGIN
58 TEST ("CE3704D", "CHECK THAT INTEGER_IO GET READS AT MOST " &
59 "WIDTH CHARACTERS OR UP TO THE NEXT " &
60 "TERMINATOR; INCLUDING LEADING BLANKS AND " &
61 "HORIZONTAL TABULATION CHARACTERS, WHEN WIDTH " &
62 "IS NONZERO");
64 DECLARE
65 FT : FILE_TYPE;
66 X : INTEGER;
67 PACKAGE IIO IS NEW INTEGER_IO (INTEGER);
68 USE IIO;
69 BEGIN
71 -- CREATE AND INITIALIZE FILE
73 BEGIN
74 CREATE (FT, OUT_FILE, LEGAL_FILE_NAME);
75 EXCEPTION
76 WHEN USE_ERROR =>
77 NOT_APPLICABLE ("USE_ERROR RAISED; TEXT CREATE " &
78 "WITH OUT_FILE MODE");
79 RAISE INCOMPLETE;
80 WHEN NAME_ERROR =>
81 NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT CREATE " &
82 "WITH OUT_FILE MODE");
83 RAISE INCOMPLETE;
84 END;
86 PUT (FT, " 123");
87 NEW_LINE (FT);
88 PUT (FT, "-5678");
89 NEW_LINE (FT);
90 PUT (FT, " ");
91 NEW_PAGE (FT);
92 PUT (FT, ASCII.HT & "9");
93 NEW_PAGE (FT);
95 CLOSE (FT);
97 BEGIN
98 OPEN (FT, IN_FILE, LEGAL_FILE_NAME);
99 EXCEPTION
100 WHEN USE_ERROR =>
101 NOT_APPLICABLE ("USE_ERROR RAISED; TEXT OPEN " &
102 "WITH IN_FILE MODE");
103 RAISE INCOMPLETE;
104 END;
106 -- BEGIN TEST
108 GET (FT, X, 5);
109 IF X /= IDENT_INT (123) THEN
110 FAILED ("WIDTH CHARACTERS NOT READ - 1");
111 ELSE
112 BEGIN
113 GET (FT, X, 2);
114 FAILED ("DATA_ERROR NOT RAISED - 1");
115 EXCEPTION
116 WHEN DATA_ERROR =>
117 NULL;
118 WHEN OTHERS =>
119 FAILED ("WRONG EXCEPTION RAISED -1");
120 END;
121 SKIP_LINE (FT);
122 GET (FT, X, 6);
123 IF X /= IDENT_INT (-5678) THEN
124 FAILED ("GET WITH WIDTH " &
125 "INCORRECT - 2");
126 ELSE
127 BEGIN
128 GET (FT, X, 2);
129 FAILED ("DATA_ERROR NOT RAISED - 2");
130 EXCEPTION
131 WHEN DATA_ERROR =>
132 NULL;
133 WHEN OTHERS =>
134 FAILED ("WRONG EXCEPTION RAISED - 2");
135 END;
136 SKIP_LINE(FT);
137 BEGIN
138 GET (FT, X, 2);
139 FAILED ("DATA_ERROR NOT RAISED - 3");
140 EXCEPTION
141 WHEN DATA_ERROR =>
142 NULL;
143 WHEN OTHERS =>
144 FAILED ("WRONG EXCEPTION RAISED - 3");
145 END;
146 SKIP_LINE(FT);
147 GET (FT, X, 2);
148 IF X /= IDENT_INT (9) THEN
149 FAILED ("GET WITH WIDTH " &
150 "INCORRECT - 3");
151 END IF;
152 END IF;
153 END IF;
155 BEGIN
156 DELETE (FT);
157 EXCEPTION
158 WHEN USE_ERROR =>
159 NULL;
160 END;
162 EXCEPTION
163 WHEN INCOMPLETE =>
164 NULL;
165 END;
167 RESULT;
169 END CE3704D;