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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3804B.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 FIXED_IO READS A PLUS OR MINUS SIGN IF
27
--     PRESENT.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY 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
40
--                   WHAT IS EXPECTED.
41
 
42
WITH REPORT;
43
USE REPORT;
44
WITH TEXT_IO;
45
USE TEXT_IO;
46
 
47
PROCEDURE CE3804B IS
48
     INCOMPLETE : EXCEPTION;
49
 
50
BEGIN
51
 
52
     TEST ("CE3804B", "CHECK THAT GET FOR FIXED_IO READS A PLUS OR " &
53
                      "MINUS SIGN IF PRESENT");
54
 
55
     DECLARE
56
          FT : FILE_TYPE;
57
          TYPE FIX IS DELTA 0.01 RANGE -3.0 .. 3.0;
58
          X : FIX;
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
          DECLARE
88
               PACKAGE FIX_IO IS NEW FIXED_IO (FIX);
89
               USE FIX_IO;
90
               LST : POSITIVE;
91
          BEGIN
92
 
93
               BEGIN
94
                    OPEN (FT, IN_FILE, LEGAL_FILE_NAME);
95
               EXCEPTION
96
                    WHEN USE_ERROR =>
97
                         NOT_APPLICABLE ("USE_ERROR RAISED; TEXT " &
98
                                         "OPEN WITH IN_FILE MODE");
99
                         RAISE INCOMPLETE;
100
               END;
101
 
102
               GET (FT, X);
103
               IF X /= -3.0 THEN
104
                    FAILED ("MINUS SIGN NOT READ - 1");
105
               END IF;
106
 
107
               GET (FT, X);
108
               IF X /= +2.0 THEN
109
                    FAILED ("PLUS SIGN NOT READ - 2");
110
               END IF;
111
 
112
               GET (FT, X);
113
               IF X /= 1.0 THEN
114
                    FAILED ("INCORRECT VALUE READ - 3");
115
               END IF;
116
 
117
               GET (ST1, X, LST);
118
               IF X /= -3.0 THEN
119
                    FAILED ("MINUS SIGN NOT READ - 4");
120
               END IF;
121
 
122
               GET (ST2, X, LST);
123
               IF X /= +2.0 THEN
124
                    FAILED ("PLUS SIGN NOT READ - 5");
125
               END IF;
126
 
127
               GET (ST3, X, LST);
128
               IF X /= 1.0 THEN
129
                    FAILED ("INCORRECT VALUE READ - 6");
130
               END IF;
131
 
132
               BEGIN
133
                    DELETE (FT);
134
               EXCEPTION
135
                    WHEN USE_ERROR =>
136
                         NULL;
137
               END;
138
          END;
139
 
140
     EXCEPTION
141
          WHEN INCOMPLETE =>
142
               NULL;
143
     END;
144
 
145
     RESULT;
146
 
147
END CE3804B;

powered by: WebSVN 2.1.0

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