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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C45304B.DEP
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 CONSTRAINT_ERROR IS RAISED BY
27
--     "+" AND "-" FOR PREDEFINED SHORT_INTEGER WHEN THE RESULT IS
28
--     OUTSIDE THE RANGE OF THE BASE TYPE.
29
 
30
-- APPLICABILITY CRITERIA:
31
--     THIS TEST IS APPLICABLE IF THE IMPLEMENTATION HAS A
32
--     PREDEFINED TYPE SHORT_INTEGER.
33
 
34
--     IF SHORT_INTEGER IS NOT SUPPORTED, THEN THE DECLARATION OF
35
--     "TEST_VAR" MUST BE REJECTED.
36
 
37
-- *** NOTE: This test has been modified since ACVC version 1.11 to    -- 9X
38
-- ***       remove incompatibilities associated with the transition   -- 9X
39
-- ***       to Ada 9X.                                                -- 9X
40
 
41
-- HISTORY:
42
--     TBN 10/07/86  CREATED ORIGINAL TEST.
43
--     JET 12/30/87  ADDED CODE TO PREVENT OPTIMIZATION.
44
--     JRL 03/30/93 REMOVED NUMERIC_ERROR FROM TEST.
45
 
46
WITH REPORT; USE REPORT;
47
PROCEDURE C45304B IS
48
 
49
     TEST_VAR : SHORT_INTEGER;                 -- N/A => ERROR.
50
 
51
     -- THESE FUNCTIONS ARE TO PREVENT OPTIMIZATION.
52
 
53
     FUNCTION IDENT_SHORT (X : SHORT_INTEGER) RETURN SHORT_INTEGER IS
54
     BEGIN
55
          IF EQUAL (3, 3) THEN
56
               RETURN X;
57
          ELSE
58
               RETURN (0);
59
          END IF;
60
     END IDENT_SHORT;
61
 
62
     FUNCTION SHORT_OK (X : SHORT_INTEGER) RETURN BOOLEAN IS
63
     BEGIN
64
          RETURN EQUAL (INTEGER(X),INTEGER(X));
65
     END SHORT_OK;
66
 
67
BEGIN
68
     TEST ("C45304B", "CHECK THAT CONSTRAINT_ERROR " &
69
                      "IS RAISED BY ""+"" AND ""-"" FOR PREDEFINED " &
70
                      "SHORT_INTEGER WHEN THE RESULT IS OUTSIDE THE " &
71
                      "RANGE OF THE BASE TYPE");
72
 
73
     DECLARE
74
          B : SHORT_INTEGER := SHORT_INTEGER'LAST;
75
     BEGIN
76
          IF SHORT_OK (B + IDENT_SHORT(1)) THEN
77
               FAILED ("NO EXCEPTION RAISED FOR ADDITION - " &
78
                       "SHORT_OK RETURNS TRUE");
79
          ELSE
80
               FAILED ("NO EXCEPTION RAISED FOR ADDITION - " &
81
                       "SHORT_OK RETURNS FALSE");
82
          END IF;
83
 
84
     EXCEPTION
85
          WHEN CONSTRAINT_ERROR =>
86
               NULL;
87
          WHEN OTHERS =>
88
               FAILED ("UNEXPECTED EXCEPTION RAISED - 1");
89
     END;
90
 
91
     DECLARE
92
          B : SHORT_INTEGER := SHORT_INTEGER'FIRST;
93
     BEGIN
94
 
95
          IF SHORT_OK (B - IDENT_SHORT(1)) THEN
96
               FAILED ("NO EXCEPTION RAISED FOR SUBTRACTION- " &
97
                       "SHORT_OK RETURNS TRUE");
98
          ELSE
99
               FAILED ("NO EXCEPTION RAISED FOR SUBTRACTION - " &
100
                       "SHORT_OK RETURNS FALSE");
101
          END IF;
102
 
103
     EXCEPTION
104
          WHEN CONSTRAINT_ERROR =>
105
               NULL;
106
          WHEN OTHERS =>
107
               FAILED ("UNEXPECTED EXCEPTION RAISED - 2");
108
     END;
109
 
110
     RESULT;
111
END C45304B;

powered by: WebSVN 2.1.0

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