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

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

Line No. Rev Author Line
1 149 jeremybenn
-- CE3804A.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 FOR FLOAT_IO READS A PLUS OR MINUS SIGN
27
--     IF PRESENT.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS ONLY APPLICABLE TO IMPLEMENTATIONS WHICH
31
--     SUPPORT TEXT FILES.
32
 
33
-- HISTORY:
34
--     SPS 09/07/82
35
--     JBG 02/22/84  CHANGED TO .ADA TEST
36
--     RJW 11/04/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
37
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
38
--     DWC 09/11/87  CORRECTED EXCEPTION HANDLING AND REVISED IFS
39
--                   TO CHECK FOR CASE WHEN VALUE IS NEGATIVE OF WHAT
40
--                   IS EXPECTED.
41
 
42
WITH REPORT;
43
USE REPORT;
44
WITH TEXT_IO;
45
USE TEXT_IO;
46
 
47
PROCEDURE CE3804A IS
48
     INCOMPLETE : EXCEPTION;
49
 
50
BEGIN
51
 
52
     TEST ("CE3804A", "CHECK THAT GET FOR FLOAT_IO READS A PLUS OR " &
53
                      "MINUS SIGN IF PRESENT");
54
 
55
     DECLARE
56
          FT : FILE_TYPE;
57
          TYPE FL IS NEW FLOAT RANGE -3.0 .. 3.0;
58
          X : FL;
59
          ST1 : CONSTANT STRING := IDENT_STR ("-3.0");
60
          ST2 : CONSTANT STRING := IDENT_STR ("+2.0");
61
          ST3 : CONSTANT STRING := IDENT_STR ("1.0");
62
     BEGIN
63
 
64
-- CREATE AND INITIALIZE DATA FILE
65
 
66
          BEGIN
67
               CREATE (FT, OUT_FILE, LEGAL_FILE_NAME);
68
          EXCEPTION
69
               WHEN USE_ERROR =>
70
                    NOT_APPLICABLE ("USE_ERROR RAISED; TEXT CREATE " &
71
                                    "WITH OUT_FILE MODE");
72
                    RAISE INCOMPLETE;
73
               WHEN NAME_ERROR =>
74
                    NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT CREATE " &
75
                                    "WITH OUT_FILE MODE");
76
                    RAISE INCOMPLETE;
77
          END;
78
 
79
          PUT (FT, ST1);
80
          NEW_LINE(FT);
81
          PUT (FT, ST2);
82
          NEW_LINE(FT);
83
          PUT (FT, ST3);
84
          NEW_LINE(FT);
85
          CLOSE (FT);
86
 
87
-- BEGIN TEST
88
 
89
          DECLARE
90
               PACKAGE FL_IO IS NEW FLOAT_IO (FL);
91
               USE FL_IO;
92
               LST : POSITIVE;
93
          BEGIN
94
 
95
               BEGIN
96
                    OPEN (FT, IN_FILE, LEGAL_FILE_NAME);
97
               EXCEPTION
98
                    WHEN USE_ERROR =>
99
                         NOT_APPLICABLE ("USE_ERROR RAISED; TEXT " &
100
                                         "OPEN WITH IN_FILE MODE");
101
                         RAISE INCOMPLETE;
102
               END;
103
 
104
               GET (FT, X);
105
               IF X = 3.0 THEN
106
                    FAILED ("MINUS SIGN NOT READ - 1");
107
               ELSIF X /= -3.0 THEN
108
                    FAILED ("INCORRECT VALUE READ - 1");
109
               END IF;
110
 
111
               GET (FT, X);
112
               IF X = -2.0 THEN
113
                    FAILED ("PLUS SIGN NOT READ - 2");
114
               ELSIF X /= +2.0 THEN
115
                    FAILED ("INCORRECT VALUE READ - 2");
116
               END IF;
117
 
118
               GET (FT, X);
119
               IF X /= 1.0 THEN
120
                    FAILED ("INCORRECT VALUE READ - 3");
121
               END IF;
122
 
123
               GET (ST1, X, LST);
124
               IF X = 3.0 THEN
125
                    FAILED ("MINUS SIGN NOT READ - 4");
126
               ELSIF X /= -3.0 THEN
127
                    FAILED ("INCORRECT VALUE READ - 4");
128
               END IF;
129
 
130
               GET (ST2, X, LST);
131
               IF X = -2.0 THEN
132
                    FAILED ("PLUS SIGN NOT READ - 5");
133
               ELSIF X /= +2.0 THEN
134
                    FAILED ("INCORRECT VALUE READ - 5");
135
               END IF;
136
 
137
               GET (ST3, X, LST);
138
               IF X /= 1.0 THEN
139
                    FAILED ("INCORRECT VALUE READ - 6");
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 CE3804A;

powered by: WebSVN 2.1.0

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