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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C45253A.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 "A IN T" AND "A NOT IN T" GIVE
26
-- APPROPRIATE RESULTS, EVEN WHEN USER-DEFINED ORDERING OPERATORS EXIST
27
-- FOR T.
28
 
29
-- WRG 8/27/86
30
-- JRL 06/12/96  Added function The_Delta. Eliminated static expressions
31
--               outside the base range of type T.
32
 
33
WITH REPORT; USE REPORT;
34
PROCEDURE C45253A IS
35
 
36
     TYPE FIXED IS DELTA 0.25 RANGE 0.0 .. 1000.0;
37
     TYPE T IS NEW FIXED;
38
 
39
     FUNCTION "<" (LEFT, RIGHT : T) RETURN BOOLEAN IS
40
     BEGIN
41
          RETURN FIXED (LEFT) >= FIXED (RIGHT);
42
     END "<";
43
 
44
     FUNCTION "<=" (LEFT, RIGHT : T) RETURN BOOLEAN IS
45
     BEGIN
46
          RETURN FIXED (LEFT) > FIXED (RIGHT);
47
     END "<=";
48
 
49
     FUNCTION ">" (LEFT, RIGHT : T) RETURN BOOLEAN IS
50
     BEGIN
51
          RETURN FIXED (LEFT) <= FIXED (RIGHT);
52
     END ">";
53
 
54
     FUNCTION ">=" (LEFT, RIGHT : T) RETURN BOOLEAN IS
55
     BEGIN
56
          RETURN FIXED (LEFT) < FIXED (RIGHT);
57
     END ">=";
58
 
59
     function The_Delta return T is
60
     begin
61
        return T'Delta;
62
     end The_Delta;
63
 
64
BEGIN
65
 
66
     TEST ("C45253A", "CHECK THAT FOR FIXED POINT TYPES ""A IN T"" " &
67
                      "AND ""A NOT IN T"" GIVE APPROPRIATE RESULTS, " &
68
                      "EVEN WHEN USER-DEFINED ORDERING OPERATORS " &
69
                      "EXIST FOR T");
70
 
71
     IF IDENT_INT (1) * 0.0 NOT IN T THEN
72
          FAILED ("0.0 NOT IN T");
73
     END IF;
74
 
75
-- 06/12/96      IF IDENT_INT (1) * 1000.0 NOT IN T THEN
76
     if Ident_Int (2) * 500.0 not in T then
77
          FAILED ("1000.0 NOT IN T");
78
     END IF;
79
 
80
-- 06/12/96      IF IDENT_INT (1) * (-0.25) IN T THEN
81
     if Ident_Int (1) * (-The_Delta) in T then
82
          FAILED ("-0.25 IN T");
83
     END IF;
84
 
85
-- 06/12/96      IF IDENT_INT (1) * 1000.25 IN T THEN
86
     if Ident_Int (2) * 500.0 + The_Delta in T then
87
          FAILED ("1000.25 IN T");
88
     END IF;
89
 
90
-- 06/12/96      IF IDENT_INT (1) * (-1000.0) IN T THEN
91
     if Ident_Int (2) * (-500.0) in T then
92
          FAILED ("-1000.0 IN T");
93
     END IF;
94
 
95
     RESULT;
96
 
97
END C45253A;

powered by: WebSVN 2.1.0

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