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/] [c3/] [c35a05a.ada] - Blame information for rev 316

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

Line No. Rev Author Line
1 294 jeremybenn
-- C35A05A.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
-- CHECK THAT FOR FIXED POINT TYPES THE FORE AND AFT ATTRIBUTES YIELD
26
-- THE CORRECT VALUES.
27
 
28
-- CASE A: BASIC TYPES THAT FIT THE CHARACTERISTICS OF DURATION'BASE.
29
 
30
-- WRG 8/8/86
31
 
32
WITH REPORT; USE REPORT;
33
PROCEDURE C35A05A IS
34
 
35
     -- THE NAME OF EACH TYPE OR SUBTYPE ENDS WITH THAT TYPE'S
36
     -- 'MANTISSA VALUE.
37
 
38
     TYPE LEFT_OUT_M1       IS DELTA 0.25  RANGE -0.5 .. 0.5;
39
     TYPE LEFT_EDGE_M1      IS DELTA 0.5   RANGE -1.0 .. 1.0;
40
     TYPE RIGHT_EDGE_M1     IS DELTA 1.0   RANGE -2.0 .. 2.0;
41
     TYPE RIGHT_OUT_M1      IS DELTA 2.0   RANGE -4.0 .. 4.0;
42
     TYPE MIDDLE_M2         IS DELTA 0.5   RANGE -2.0 .. 2.0;
43
     TYPE MIDDLE_M3         IS DELTA 0.5   RANGE  0.0 .. 2.5;
44
     TYPE MIDDLE_M15        IS DELTA 2.0 **(-6) RANGE  -512.0 ..  512.0;
45
     TYPE MIDDLE_M16        IS DELTA 2.0 **(-6) RANGE -1024.0 .. 1024.0;
46
     TYPE LIKE_DURATION_M23 IS DELTA 0.020 RANGE -86_400.0 .. 86_400.0;
47
     TYPE DECIMAL_M18       IS DELTA 0.1   RANGE -10_000.0 .. 10_000.0;
48
     TYPE DECIMAL_M4        IS DELTA 100.0 RANGE   -1000.0 ..   1000.0;
49
     TYPE DECIMAL_M11       IS DELTA 0.09999 RANGE  -100.0 ..    100.0;
50
     TYPE DECIMAL2_M18      IS DELTA 0.1   RANGE   -9999.0 ..   9999.0;
51
 
52
     -------------------------------------------------------------------
53
 
54
     SUBTYPE ST_LEFT_EDGE_M6 IS MIDDLE_M15
55
          DELTA 2.0 ** (-6) RANGE IDENT_INT (1) * (-1.0) .. 1.0;
56
     SUBTYPE ST_MIDDLE_M14   IS MIDDLE_M16
57
          DELTA 2.0 ** (-5) RANGE -512.0 .. IDENT_INT (1) * 512.0;
58
     SUBTYPE ST_MIDDLE_M2    IS LIKE_DURATION_M23
59
          DELTA 0.5 RANGE -2.0 .. 2.0;
60
     SUBTYPE ST_MIDDLE_M3    IS LIKE_DURATION_M23
61
          DELTA 0.5 RANGE  0.0 .. 2.5;
62
     SUBTYPE ST_DECIMAL_M7   IS DECIMAL_M18
63
          DELTA  10.0 RANGE -1000.0 .. 1000.0;
64
     SUBTYPE ST_DECIMAL_M3   IS DECIMAL_M4
65
          DELTA 100.0 RANGE  -500.0 ..  500.0;
66
 
67
     -------------------------------------------------------------------
68
 
69
     PROCEDURE CHECK_FORE_AND_AFT
70
         (NAME        : STRING;
71
          ACTUAL_FORE : INTEGER; CORRECT_FORE : POSITIVE;
72
          ACTUAL_AFT  : INTEGER; CORRECT_AFT  : POSITIVE) IS
73
     BEGIN
74
          IF ACTUAL_FORE /= IDENT_INT (CORRECT_FORE) THEN
75
               FAILED (NAME & "'FORE =" & INTEGER'IMAGE(ACTUAL_FORE) );
76
          END IF;
77
          IF ACTUAL_AFT /= IDENT_INT (CORRECT_AFT) THEN
78
               FAILED (NAME & "'AFT  =" & INTEGER'IMAGE(ACTUAL_AFT) );
79
          END IF;
80
     END CHECK_FORE_AND_AFT;
81
 
82
BEGIN
83
 
84
     TEST ("C35A05A", "CHECK THAT FOR FIXED POINT TYPES THE FORE AND " &
85
                      "AFT ATTRIBUTES YIELD THE CORRECT VALUES - " &
86
                      "BASIC TYPES");
87
 
88
     CHECK_FORE_AND_AFT ("LEFT_OUT_M1",       LEFT_OUT_M1'FORE, 2,
89
                                              LEFT_OUT_M1'AFT,  1);
90
 
91
     CHECK_FORE_AND_AFT ("LEFT_EDGE_M1",      LEFT_EDGE_M1'FORE, 2,
92
                                              LEFT_EDGE_M1'AFT,  1);
93
 
94
     CHECK_FORE_AND_AFT ("RIGHT_EDGE_M1",     RIGHT_EDGE_M1'FORE, 2,
95
                                              RIGHT_EDGE_M1'AFT,  1);
96
 
97
     CHECK_FORE_AND_AFT ("RIGHT_OUT_M1",      RIGHT_OUT_M1'FORE, 2,
98
                                              RIGHT_OUT_M1'AFT,  1);
99
 
100
     CHECK_FORE_AND_AFT ("MIDDLE_M2",         MIDDLE_M2'FORE, 2,
101
                                              MIDDLE_M2'AFT,  1);
102
 
103
     CHECK_FORE_AND_AFT ("MIDDLE_M3",         MIDDLE_M3'FORE, 2,
104
                                              MIDDLE_M3'AFT,  1);
105
 
106
     CHECK_FORE_AND_AFT ("MIDDLE_M15",        MIDDLE_M15'FORE, 4,
107
                                              MIDDLE_M15'AFT,  2);
108
 
109
     CHECK_FORE_AND_AFT ("MIDDLE_M16",        MIDDLE_M16'FORE, 5,
110
                                              MIDDLE_M16'AFT,  2);
111
 
112
     CHECK_FORE_AND_AFT ("LIKE_DURATION_M23", LIKE_DURATION_M23'FORE, 6,
113
                                              LIKE_DURATION_M23'AFT, 2);
114
 
115
     CHECK_FORE_AND_AFT ("DECIMAL_M18",       DECIMAL_M18'FORE, 6,
116
                                              DECIMAL_M18'AFT,  1);
117
 
118
     IF DECIMAL_M4'FORE /= 5 AND DECIMAL_M4'FORE /= 4 THEN
119
          FAILED ("DECIMAL_M4'FORE =" &
120
                  INTEGER'IMAGE(DECIMAL_M4'FORE) );
121
     END IF;
122
     IF DECIMAL_M4'AFT /= 1 THEN
123
          FAILED ("DECIMAL_M4'AFT  =" &
124
                  INTEGER'IMAGE(DECIMAL_M4'AFT) );
125
     END IF;
126
 
127
     CHECK_FORE_AND_AFT ("DECIMAL_M11",       DECIMAL_M11'FORE, 4,
128
                                              DECIMAL_M11'AFT,  2);
129
 
130
     CHECK_FORE_AND_AFT ("DECIMAL2_M18",      DECIMAL2_M18'FORE, 5,
131
                                              DECIMAL2_M18'AFT,  1);
132
 
133
     CHECK_FORE_AND_AFT ("ST_LEFT_EDGE_M6",   ST_LEFT_EDGE_M6'FORE, 2,
134
                                              ST_LEFT_EDGE_M6'AFT,  2);
135
 
136
     CHECK_FORE_AND_AFT ("ST_MIDDLE_M14",     ST_MIDDLE_M14'FORE, 4,
137
                                              ST_MIDDLE_M14'AFT,  2);
138
 
139
     CHECK_FORE_AND_AFT ("ST_MIDDLE_M2",      ST_MIDDLE_M2'FORE, 2,
140
                                              ST_MIDDLE_M2'AFT,  1);
141
 
142
     CHECK_FORE_AND_AFT ("ST_MIDDLE_M3",      ST_MIDDLE_M3'FORE, 2,
143
                                              ST_MIDDLE_M3'AFT,  1);
144
 
145
     CHECK_FORE_AND_AFT ("ST_DECIMAL_M7",     ST_DECIMAL_M7'FORE, 5,
146
                                              ST_DECIMAL_M7'AFT,  1);
147
 
148
     CHECK_FORE_AND_AFT ("ST_DECIMAL_M3",     ST_DECIMAL_M3'FORE, 4,
149
                                              ST_DECIMAL_M3'AFT,  1);
150
 
151
     RESULT;
152
 
153
END C35A05A;

powered by: WebSVN 2.1.0

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