OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [cc/] [cc3222a.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- CC3222A.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 FLOATING POINT FORMAL TYPE DENOTES ITS ACTUAL
27
--     PARAMETER, AND OPERATIONS OF THE FORMAL TYPE ARE IDENTIFIED WITH
28
--     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 CC3222A IS
36
 
37
     TYPE FLOAT IS DIGITS 5 RANGE 0.0 .. 10.0;
38
 
39
     GENERIC
40
          TYPE T IS DIGITS <>;
41
     PACKAGE P IS
42
          SUBTYPE SUB_T IS T;
43
          PAC_VAR : T;
44
     END P;
45
 
46
     FUNCTION IDENT_FLO (X : FLOAT) RETURN FLOAT IS
47
     BEGIN
48
          IF EQUAL (3, 3) THEN
49
               RETURN X;
50
          ELSE
51
               RETURN (0.0);
52
          END IF;
53
     END IDENT_FLO;
54
 
55
BEGIN
56
     TEST ("CC3222A", "CHECK THAT A FLOATING POINT FORMAL TYPE " &
57
                      "DENOTES ITS ACTUAL PARAMETER, AND OPERATIONS " &
58
                      "OF THE FORMAL TYPE ARE IDENTIFIED WITH " &
59
                      "CORRESPONDING OPERATIONS OF THE ACTUAL TYPE");
60
 
61
     DECLARE
62
          OBJ_INT : INTEGER := 1;
63
          OBJ_FLO : FLOAT := 1.0;
64
 
65
          PACKAGE P1 IS NEW P (FLOAT);
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_FLO THEN
73
               FAILED ("INCORRECT RESULTS - 1");
74
          END IF;
75
          OBJ_FLO := IDENT_FLO (PAC_VAR) + IDENT_FLO (OBJ_FLO);
76
          IF OBJ_FLO <= PAC_VAR THEN
77
               FAILED ("INCORRECT RESULTS - 2");
78
          END IF;
79
          PAC_VAR := PAC_VAR * OBJ_FLO;
80
          IF PAC_VAR NOT IN FLOAT THEN
81
               FAILED ("INCORRECT RESULTS - 3");
82
          END IF;
83
          IF OBJ_FLO NOT IN SUB_T THEN
84
               FAILED ("INCORRECT RESULTS - 4");
85
          END IF;
86
          PAC_VAR := 1.0;
87
          OBJ_FLO := 1.0;
88
          OBJ_FLO := PAC_VAR * OBJ_FLO;
89
          IF OBJ_FLO /= 1.0 THEN
90
               FAILED ("INCORRECT RESULTS - 5");
91
          END IF;
92
          OBJ_FLO := 1.0;
93
          OBJ_FLO := OBJ_FLO / OBJ_FLO;
94
          IF OBJ_FLO /= 1.0 THEN
95
               FAILED ("INCORRECT RESULTS - 6");
96
          END IF;
97
          PAC_VAR := 1.0;
98
          OBJ_FLO := PAC_VAR ** OBJ_INT;
99
          IF OBJ_FLO /= 1.0 THEN
100
               FAILED ("INCORRECT RESULTS - 7");
101
          END IF;
102
          IF SUB_T'DIGITS /= 5 THEN
103
               FAILED ("INCORRECT RESULTS - 8");
104
          END IF;
105
          OBJ_NEWT := 1.0;
106
          OBJ_NEWT := OBJ_NEWT - 1.0;
107
          IF OBJ_NEWT NOT IN NEW_T THEN
108
               FAILED ("INCORRECT RESULTS - 9");
109
          END IF;
110
          IF NEW_T'DIGITS /= 5 THEN
111
               FAILED ("INCORRECT RESULTS - 10");
112
          END IF;
113
     END;
114
 
115
     RESULT;
116
END CC3222A;

powered by: WebSVN 2.1.0

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