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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CC3223A.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 A FIXED POINT FORMAL TYPE DENOTES ITS ACTUAL
27
--     PARAMETER, AND OPERATIONS OF THE FORMAL TYPE ARE IDENTIFIED
28
--     WITH CORRESPONDING OPERATIONS OF THE ACTUAL TYPE.
29
 
30
-- HISTORY:
31
--     TBN 10/09/86  CREATED ORIGINAL TEST.
32
--     PWN 01/31/95  REMOVED INCONSISTENCIES WITH ADA 9X.
33
 
34
WITH REPORT; USE REPORT;
35
PROCEDURE CC3223A IS
36
 
37
     TYPE FIXED IS DELTA 0.125 RANGE 0.0 .. 10.0;
38
 
39
     GENERIC
40
          TYPE T IS DELTA <>;
41
     PACKAGE P IS
42
          SUBTYPE SUB_T IS T;
43
          PAC_VAR : T;
44
     END P;
45
 
46
     FUNCTION IDENT_FIX (X : FIXED) RETURN FIXED IS
47
     BEGIN
48
          IF EQUAL (3, 3) THEN
49
               RETURN X;
50
          ELSE
51
               RETURN (0.0);
52
          END IF;
53
     END IDENT_FIX;
54
 
55
BEGIN
56
     TEST ("CC3223A", "CHECK THAT A FIXED POINT FORMAL TYPE DENOTES " &
57
                      "ITS ACTUAL PARAMETER, AND OPERATIONS OF THE " &
58
                      "FORMAL TYPE ARE IDENTIFIED WITH CORRESPONDING " &
59
                      "OPERATIONS OF THE ACTUAL TYPE");
60
 
61
     DECLARE
62
          OBJ_INT : INTEGER := 1;
63
          OBJ_FIX : FIXED := 1.0;
64
 
65
          PACKAGE P1 IS NEW P (FIXED);
66
          USE P1;
67
 
68
          TYPE NEW_T IS NEW SUB_T;
69
          OBJ_NEWT : NEW_T;
70
     BEGIN
71
          PAC_VAR := SUB_T'(1.0);
72
          IF PAC_VAR /= OBJ_FIX THEN
73
               FAILED ("INCORRECT RESULTS - 1");
74
          END IF;
75
          OBJ_FIX := IDENT_FIX (PAC_VAR) + IDENT_FIX (OBJ_FIX);
76
          IF OBJ_FIX <= PAC_VAR THEN
77
               FAILED ("INCORRECT RESULTS - 2");
78
          END IF;
79
          PAC_VAR := OBJ_INT * OBJ_FIX;
80
          IF PAC_VAR NOT IN FIXED THEN
81
               FAILED ("INCORRECT RESULTS - 3");
82
          END IF;
83
          IF OBJ_FIX NOT IN SUB_T THEN
84
               FAILED ("INCORRECT RESULTS - 4");
85
          END IF;
86
          IF SUB_T'DELTA /= 0.125 THEN
87
               FAILED ("INCORRECT RESULTS - 5");
88
          END IF;
89
          OBJ_NEWT := 1.0;
90
          OBJ_NEWT := OBJ_NEWT - 1.0;
91
          IF OBJ_NEWT NOT IN NEW_T THEN
92
               FAILED ("INCORRECT RESULTS - 6");
93
          END IF;
94
          IF NEW_T'DELTA /= 0.125 THEN
95
               FAILED ("INCORRECT RESULTS - 7");
96
          END IF;
97
          OBJ_NEWT := NEW_T'SMALL + 1.0;
98
          OBJ_FIX := 1.0;
99
          OBJ_FIX := FIXED (OBJ_FIX * OBJ_FIX);
100
          IF OBJ_FIX /= 1.0 THEN
101
               FAILED ("INCORRECT RESULTS - 8");
102
          END IF;
103
          OBJ_FIX := 1.0;
104
          OBJ_FIX := SUB_T (OBJ_FIX / OBJ_FIX);
105
          IF OBJ_FIX /= 1.0 THEN
106
               FAILED ("INCORRECT RESULTS - 9");
107
          END IF;
108
          IF FIXED'SMALL /= NEW_T'SMALL THEN
109
               FAILED ("INCORRECT RESULTS - 10");
110
          END IF;
111
     END;
112
 
113
     RESULT;
114
END CC3223A;

powered by: WebSVN 2.1.0

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