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

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

Line No. Rev Author Line
1 149 jeremybenn
-- CE3801A.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 EACH FLOAT_IO OPERATION RAISES STATUS_ERROR WHEN
27
--     CALLED WITH A FILE PARAMETER DESIGNATING AN UN-OPEN FILE.
28
 
29
-- HISTORY:
30
--     SPS 09/07/82
31
--     SPS 12/22/82
32
--     DWC 09/11/87  CORRECTED EXCEPTION HANDLING AND REVISED IFS
33
--                   TO CHECK FOR CASE WHEN VALUE IS NEGATIVE OF
34
--                   WHAT IS EXPECTED.
35
 
36
WITH REPORT;
37
USE REPORT;
38
WITH TEXT_IO;
39
USE TEXT_IO;
40
 
41
PROCEDURE CE3801A IS
42
BEGIN
43
 
44
     TEST ("CE3801A", "CHECK THAT EACH FLOAT_IO AND FIXED_IO " &
45
                      "OPERATION RAISES STATUS_ERROR WHEN CALLED " &
46
                      "WITH A FILE PARAMETER DESIGNATING AN " &
47
                      "UN-OPEN FILE");
48
 
49
     DECLARE
50
          TYPE FLT IS NEW FLOAT RANGE 1.0 .. 10.0;
51
          PACKAGE FLT_IO IS NEW FLOAT_IO (FLT);
52
          USE FLT_IO;
53
          X : FLT := FLT'FIRST;
54
          FT : FILE_TYPE;
55
     BEGIN
56
 
57
          BEGIN
58
               GET (FT, X);
59
               FAILED ("STATUS_ERROR NOT RAISED - GET FLOAT_IO - 1");
60
          EXCEPTION
61
               WHEN STATUS_ERROR =>
62
                    NULL;
63
               WHEN OTHERS =>
64
                    FAILED ("WRONG EXCEPTION RAISED - GET " &
65
                            "FLOAT_IO - 1");
66
          END;
67
 
68
          BEGIN
69
               PUT (FT, X);
70
               FAILED ("STATUS_ERROR NOT RAISED - PUT FLOAT_IO - 1");
71
          EXCEPTION
72
               WHEN STATUS_ERROR =>
73
                    NULL;
74
               WHEN OTHERS =>
75
                    FAILED ("WRONG EXCEPTION RAISED - PUT " &
76
                            "FLOAT_IO - 1");
77
          END;
78
 
79
          BEGIN
80
               CREATE (FT, OUT_FILE);    -- THIS IS JUST AN ATTEMPT
81
               CLOSE (FT);               -- TO CREATE A FILE.
82
          EXCEPTION                      -- OBJECTIVE MET EITHER WAY.
83
               WHEN USE_ERROR =>
84
                    NULL;
85
          END;
86
 
87
          BEGIN
88
               GET (FT, X);
89
               FAILED ("STATUS_ERROR NOT RAISED - GET FLOAT_IO - 2");
90
          EXCEPTION
91
               WHEN STATUS_ERROR =>
92
                    NULL;
93
               WHEN OTHERS =>
94
                    FAILED ("WRONG EXCEPTION RAISED - GET " &
95
                            "FLOAT_IO - 2");
96
          END;
97
 
98
          BEGIN
99
               PUT (FT, X);
100
               FAILED ("STATUS_ERROR NOT RAISED - PUT FLOAT_IO - 2");
101
          EXCEPTION
102
               WHEN STATUS_ERROR =>
103
                    NULL;
104
               WHEN OTHERS =>
105
                    FAILED ("WRONG EXCEPTION RAISED - PUT " &
106
                            "FLOAT_IO - 2");
107
          END;
108
     END;
109
 
110
     RESULT;
111
 
112
END CE3801A;

powered by: WebSVN 2.1.0

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