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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3804M.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/07/83
35
--     JBG 03/30/84
36
--     RJW 11/04/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
37
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
38
--     DWC 09/14/87  SPLIT CASE FOR FIXED_IO INTO CE3804N.ADA AND
39
--                   CORRECTED EXCEPTION HANDLING.
40
 
41
WITH TEXT_IO; USE TEXT_IO;
42
WITH REPORT; USE REPORT;
43
 
44
PROCEDURE CE3804M IS
45
 
46
     INCOMPLETE : EXCEPTION;
47
 
48
BEGIN
49
     TEST ("CE3804M", "CHECK THAT FLOAT_IO GET WILL RAISE " &
50
                      "DATA_ERROR IF THE USE OF # AND : IN " &
51
                      "BASED LITERALS IS MIXED");
52
 
53
     DECLARE
54
          FT : FILE_TYPE;
55
     BEGIN
56
 
57
          BEGIN
58
               CREATE (FT, OUT_FILE, LEGAL_FILE_NAME);
59
          EXCEPTION
60
               WHEN USE_ERROR =>
61
                    NOT_APPLICABLE ("USE_ERROR RAISED; TEXT " &
62
                                    "CREATE WITH OUT_FILE MODE");
63
                    RAISE INCOMPLETE;
64
               WHEN NAME_ERROR =>
65
                    NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT " &
66
                                    "CREATE WITH OUT_FILE MODE");
67
                    RAISE INCOMPLETE;
68
          END;
69
 
70
 
71
          PUT_LINE (FT, "2#1.1#E+2");   -- 2#1.1#E+2
72
          PUT_LINE (FT, "8:1.1:E-2");   -- 8:1.1:E-2
73
          PUT (FT, "2#1.1:E+1");        -- 2#1.1:E+1
74
          NEW_LINE (FT);
75
          PUT (FT, "4:2.23#E+2");       -- 4:2.23#E+2
76
          NEW_LINE (FT);
77
          PUT (FT, "2#1.0#E+1");        -- 2#1.0#E+1
78
          NEW_LINE (FT);
79
          CLOSE (FT);
80
 
81
          DECLARE
82
               PACKAGE FL_IO IS NEW FLOAT_IO(FLOAT);
83
               USE FL_IO;
84
               X : FLOAT := 1.00E+10;
85
          BEGIN
86
 
87
               BEGIN
88
                    OPEN (FT, IN_FILE, LEGAL_FILE_NAME);
89
               EXCEPTION
90
                    WHEN USE_ERROR =>
91
                         NOT_APPLICABLE ("USE_ERROR RAISED; TEXT " &
92
                                         "OPEN WITH IN_FILE MODE");
93
                         RAISE INCOMPLETE;
94
               END;
95
 
96
               GET (FT, X);
97
               IF X /= 2#1.1#E+2 THEN
98
                    FAILED ("DID NOT GET RIGHT VALUE - 1");
99
               END IF;
100
 
101
               GET (FT, X);
102
               IF X /= 8#1.1#E-2 THEN
103
                    FAILED ("DID NOT GET RIGHT VALUE - 2");
104
               END IF;
105
 
106
               BEGIN
107
                    X := 1.0E+10;
108
                    GET (FT,X);
109
                    FAILED ("DATA_ERROR NOT RAISED - 1");
110
               EXCEPTION
111
                    WHEN DATA_ERROR =>
112
                         IF X /= 1.00E+10 THEN
113
                              FAILED ("ACTUAL PARAMETER TO GET " &
114
                                      "AFFECTED ON DATA_ERROR - 1");
115
                         END IF;
116
                    WHEN OTHERS =>
117
                         FAILED ("WRONG EXCEPTION RAISED - 1");
118
               END;
119
 
120
               SKIP_LINE (FT);
121
 
122
               BEGIN
123
                    GET (FT,X);
124
                    FAILED ("DATA_ERROR NOT RAISED - 2");
125
               EXCEPTION
126
                    WHEN DATA_ERROR =>
127
                         IF X /= 1.00E+10 THEN
128
                              FAILED ("ACTUAL PARAMETER TO GET " &
129
                                      "AFFECTED ON DATA_ERROR - 2");
130
                         END IF;
131
                    WHEN OTHERS =>
132
                         FAILED ("WRONG EXCEPTION RAISED - 2");
133
               END;
134
 
135
               SKIP_LINE (FT);
136
 
137
               GET (FT, X);
138
               IF X /= 2#1.0#E+1 THEN
139
                    FAILED ("DID NOT GET RIGHT VALUE - 3");
140
               END IF;
141
 
142
               BEGIN
143
                    DELETE (FT);
144
               EXCEPTION
145
                    WHEN USE_ERROR =>
146
                         NULL;
147
               END;
148
          END;
149
 
150
     EXCEPTION
151
          WHEN INCOMPLETE =>
152
               NULL;
153
     END;
154
 
155
     RESULT;
156
 
157
END CE3804M;

powered by: WebSVN 2.1.0

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