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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c4/] [c45303a.ada] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 jeremybenn
-- C45303A.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 ADDITION AND SUBTRACTION YIELD RESULTS BELONGING TO THE
26
-- BASE TYPE.
27
 
28
-- JBG 2/24/84
29
-- JRL 03/30/93 REMOVED NUMERIC_ERROR FROM TEST.
30
-- JRL 10/13/96 Fixed static expressions which contained values outside
31
--              the base range.
32
 
33
WITH REPORT; USE REPORT;
34
PROCEDURE C45303A IS
35
 
36
     TYPE INT IS RANGE 1..10;
37
 
38
     X, Y : INT := INT(IDENT_INT(9));
39
 
40
BEGIN
41
 
42
     TEST ("C45303A", "CHECK SUBTYPE OF INTEGER ADDITION/SUBTRACTION");
43
 
44
     BEGIN
45
 
46
          IF X + Y - 10 /= INT(IDENT_INT(8)) THEN
47
               FAILED ("INCORRECT RESULT - ADDITION");
48
          END IF;
49
 
50
     EXCEPTION
51
 
52
          WHEN CONSTRAINT_ERROR =>
53
               IF INT'POS(INT'BASE'LAST) >= 18 THEN
54
                    FAILED ("ADDITION DOES NOT YIELD RESULT " &
55
                            "BELONGING TO THE BASE TYPE");
56
               ELSE
57
                    COMMENT ("BASE TYPE HAS RANGE LESS THAN 18 - ADD");
58
               END IF;
59
     END;
60
 
61
     BEGIN
62
 
63
          IF 2 - X - INT(IDENT_INT(1)) /= INT'VAL(IDENT_INT(-8)) THEN
64
               FAILED ("INCORRECT RESULT - SUBTRACTION");
65
          END IF;
66
 
67
     EXCEPTION
68
 
69
          WHEN CONSTRAINT_ERROR =>
70
               IF INT'POS(INT'BASE'FIRST) <= -8 THEN
71
                    FAILED ("SUBTRACTION DOES NOT YIELD RESULT " &
72
                            "BELONGING TO THE BASE TYPE");
73
               ELSE
74
                    COMMENT ("BASE TYPE HAS RANGE GREATER THAN -8 - SUB");
75
               END IF;
76
     END;
77
 
78
     RESULT;
79
 
80
END C45303A;

powered by: WebSVN 2.1.0

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