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

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

Line No. Rev Author Line
1 294 jeremybenn
-- CE3704O.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 GET WILL RAISE DATA_ERROR IF THE USE OF # AND :
27
--     IN BASED LITERALS IS MIXED.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH
31
--     SUPPORT TEXT FILES.
32
 
33
-- HISTORY:
34
--     VKG 02/10/83
35
--     RJW 11/04/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
36
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
37
--     DWC 09/11/87  REMOVED UNNECESSARY CODE AND CORRECTED
38
--                   EXCEPTION HANDLING.
39
 
40
WITH TEXT_IO; USE TEXT_IO;
41
WITH REPORT; USE REPORT;
42
 
43
PROCEDURE CE3704O IS
44
 
45
     INCOMPLETE : EXCEPTION;
46
 
47
BEGIN
48
     TEST ("CE3704O", "CHECK THAT MIXED USE OF # AND : " &
49
                      "IN BASED LITERALS WILL RAISE DATA_ERROR");
50
 
51
     DECLARE
52
          FT : FILE_TYPE;
53
     BEGIN
54
 
55
          BEGIN
56
               CREATE (FT, OUT_FILE, LEGAL_FILE_NAME);
57
          EXCEPTION
58
               WHEN USE_ERROR =>
59
                    NOT_APPLICABLE ("USE_ERROR RAISED; TEXT CREATE " &
60
                                    "WITH OUT_FILE MODE");
61
                    RAISE INCOMPLETE;
62
               WHEN NAME_ERROR =>
63
                    NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT CREATE " &
64
                                    "WITH OUT_FILE MODE");
65
                    RAISE INCOMPLETE;
66
          END;
67
 
68
 
69
          PUT_LINE (FT, "8#77#E+1");
70
          PUT_LINE (FT, "2:110:");
71
          PUT (FT, "2#11:");
72
          NEW_LINE (FT);
73
          PUT (FT, "4:223#");
74
          NEW_LINE (FT);
75
          CLOSE (FT);
76
 
77
 
78
          DECLARE
79
               PACKAGE INT_IO IS NEW INTEGER_IO(INTEGER);
80
               USE INT_IO;
81
               X : INTEGER := 100;
82
               CH : CHARACTER;
83
          BEGIN
84
 
85
               BEGIN
86
                    OPEN (FT, IN_FILE, LEGAL_FILE_NAME);
87
               EXCEPTION
88
                    WHEN USE_ERROR =>
89
                         NOT_APPLICABLE ("USE_ERROR RAISED; TEXT " &
90
                                         "OPEN WITH IN_FILE MODE");
91
                         RAISE INCOMPLETE;
92
               END;
93
 
94
               GET (FT, X);
95
               IF X /= 8#77#E+1 THEN
96
                    FAILED ("INCORRECT VALUE - 1");
97
               END IF;
98
 
99
               GET (FT, X);
100
               IF X /= 2#110# THEN
101
                    FAILED ("INCORRECT VALUE - 2");
102
               END IF;
103
 
104
               BEGIN
105
                    X := 100;
106
                    GET (FT,X);
107
                    FAILED ("DATA_ERROR NOT RAISED - 1");
108
               EXCEPTION
109
                    WHEN DATA_ERROR =>
110
                         IF X /= 100 THEN
111
                              FAILED ("ACTUAL PARAMETER TO GET " &
112
                                      "AFFECTED ON DATA_ERROR - 1");
113
                         END IF;
114
                    WHEN OTHERS =>
115
                         FAILED ("WRONG EXCEPTION RAISED");
116
               END;
117
 
118
               IF NOT END_OF_LINE (FT) THEN
119
                    GET (FT, CH);
120
                    IF CH /= ':' THEN
121
                         FAILED ("GET STOPPED AT WRONG POSITION - 1");
122
                    END IF;
123
               END IF;
124
 
125
               BEGIN
126
                    X := 100;
127
                    GET (FT,X);
128
                    FAILED ("DATA_ERROR NOT RAISED - 2");
129
               EXCEPTION
130
                    WHEN DATA_ERROR =>
131
                         IF X /= 100 THEN
132
                              FAILED ("ACTUAL PARAMETER TO GET " &
133
                                      "AFFECTED ON DATA_ERROR - 2");
134
                         END IF;
135
                    WHEN OTHERS =>
136
                         FAILED ("WRONG EXCEPTION RAISED - 2");
137
               END;
138
 
139
               IF NOT END_OF_LINE (FT) THEN
140
                    GET (FT, CH);
141
                         IF CH /='#' THEN
142
                              FAILED ("GET STOPPED AT WRONG " &
143
                                      "POSITION - 1");
144
                         END IF;
145
               END IF;
146
 
147
               BEGIN
148
                    DELETE (FT);
149
               EXCEPTION
150
                    WHEN USE_ERROR =>
151
                         NULL;
152
               END;
153
          END;
154
 
155
     EXCEPTION
156
          WHEN INCOMPLETE =>
157
               NULL;
158
     END;
159
     RESULT;
160
 
161
END CE3704O;

powered by: WebSVN 2.1.0

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