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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C45252B.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 NO EXCEPTION IS RAISED WHEN A FIXED POINT LITERAL
27
--     OPERAND IN A COMPARISON OR A FIXED POINT LITERAL LEFT OPERAND
28
--     IN A MEMBERSHIP TEST BELONGS TO THE BASE TYPE BUT IS OUTSIDE
29
--     THE RANGE OF THE SUBTYPE.
30
 
31
-- *** NOTE: This test has been modified since ACVC version 1.11 to    -- 9X
32
-- ***       remove incompatibilities associated with the transition   -- 9X
33
-- ***       to Ada 9X.                                                -- 9X
34
 
35
-- HISTORY:
36
--     PWB 09/04/86 CREATED ORIGINAL TEST.
37
--     DHH 10/19/87 SHORTENED LINES CONTAINING MORE THAN 72 CHARACTERS.
38
--     JRL 03/30/93 REMOVED NUMERIC_ERROR FROM TEST.
39
 
40
WITH REPORT, SYSTEM; USE REPORT;
41
PROCEDURE C45252B IS
42
 
43
BEGIN
44
 
45
     TEST ("C45252B", "NO EXCEPTION IS RAISED WHEN A FIXED " &
46
                      "LITERAL USED IN A COMPARISON OR AS THE " &
47
                      "LEFT OPERAND IN A MEMBERSHIP TEST " &
48
                      "BELONGS TO THE BASE TYPE BUT IS OUTSIDE " &
49
                      "THE RANGE OF THE SUBTYPE");
50
 
51
     DECLARE
52
          TYPE FIXED IS DELTA 0.25 RANGE -10.0 .. 10.0;
53
          SUBTYPE FIXED_1 IS FIXED RANGE -1.0 .. 1.0;
54
          NUM : FIXED_1 := 0.0;
55
     BEGIN    -- FIXED COMPARISON
56
 
57
          IF EQUAL(3,3) THEN
58
               NUM := FIXED_1'(0.5);
59
          END IF;
60
 
61
          IF 2.0 > NUM THEN
62
               COMMENT ("NO EXCEPTION RAISED FOR FIXED " &
63
                        "COMPARISON");
64
          ELSE
65
               FAILED ("WRONG RESULT FROM FIXED " &
66
                       "COMPARISON");
67
          END IF;
68
     EXCEPTION
69
          WHEN CONSTRAINT_ERROR =>
70
               FAILED ("CONSTRAINT_ERROR RAISED FOR " &
71
                       "FIXED COMPARISON");
72
          WHEN OTHERS =>
73
               FAILED ("OTHER EXCEPTION RAISED FOR " &
74
                       "FIXED COMPARISON");
75
     END;  -- FIXED COMPARISON
76
 
77
     DECLARE
78
          TYPE FIXED IS DELTA 0.25 RANGE -10.0 .. 10.0;
79
          SUBTYPE FIXED_1 IS FIXED RANGE -1.0 .. 1.0;
80
     BEGIN    -- FIXED MEMBERSHIP
81
 
82
          IF 2.0 IN FIXED_1 THEN
83
               FAILED ("WRONG RESULT FROM FIXED " &
84
                       "MEMBERSHIP");
85
          ELSE
86
               COMMENT ("NO EXCEPTION RAISED FOR FIXED " &
87
                        "MEMBERSHIP");
88
          END IF;
89
     EXCEPTION
90
          WHEN CONSTRAINT_ERROR =>
91
               FAILED ("CONSTRAINT_ERROR RAISED FOR  " &
92
                       "FIXED MEMBERSHIP");
93
          WHEN OTHERS =>
94
               FAILED ("OTHER EXCEPTION RAISED FOR  " &
95
                       "FIXED MEMBERSHIP");
96
     END;  -- FIXED MEMBERSHIP
97
 
98
     DECLARE -- PRECISE FIXED COMPARISON
99
          TYPE FINE_FIXED IS DELTA SYSTEM.FINE_DELTA RANGE -1.0 .. 1.0;
100
          SUBTYPE SUB_FINE IS FINE_FIXED RANGE -0.5 .. 0.5;
101
          NUM : SUB_FINE := 0.0;
102
     BEGIN
103
          IF EQUAL(3,3) THEN
104
               NUM := 0.25;
105
          END IF;
106
 
107
          IF 0.75 > NUM THEN
108
               COMMENT ("NO EXCEPTION RAISED FOR FINE_FIXED " &
109
                        "COMPARISON");
110
          ELSE
111
               FAILED ("WRONG RESULT FROM FINE_FIXED COMPARISON");
112
          END IF;
113
 
114
     EXCEPTION
115
          WHEN CONSTRAINT_ERROR =>
116
               FAILED ("CONSTRAINT_ERROR RAISED FOR " &
117
                       "FINE_FIXED COMPARISON");
118
          WHEN OTHERS =>
119
               FAILED ("OTHER EXCEPTION RAISED FOR  " &
120
                       "FINE_FIXED COMPARISON");
121
     END;  --  FINE_FIXED COMPARISON
122
 
123
     DECLARE -- PRECISE FIXED MEMBERSHIP
124
          TYPE FINE_FIXED IS DIGITS SYSTEM.MAX_DIGITS;
125
          SUBTYPE SUB_FINE IS FINE_FIXED RANGE -0.5 .. 0.5;
126
     BEGIN
127
 
128
          IF 0.75 IN SUB_FINE THEN
129
               FAILED ("WRONG RESULT FROM FINE_FIXED MEMBERSHIP");
130
          ELSE
131
               COMMENT ("NO EXCEPTION RAISED FOR FINE_FIXED " &
132
                        "MEMBERSHIP");
133
          END IF;
134
 
135
     EXCEPTION
136
          WHEN CONSTRAINT_ERROR =>
137
               FAILED ("CONSTRAINT_ERROR RAISED FOR " &
138
                       "FINE_FIXED MEMBERSHIP");
139
          WHEN OTHERS =>
140
               FAILED ("OTHER EXCEPTION RAISED FOR  " &
141
                       "FINE_FIXED MEMBERSHIP");
142
     END;  --  FINE_FIXED MEMBERSHIP
143
 
144
     RESULT;
145
 
146
END C45252B;

powered by: WebSVN 2.1.0

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