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/] [c3/] [c35904a.ada] - Blame information for rev 316

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

Line No. Rev Author Line
1 294 jeremybenn
-- C35904A.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 INCOMPATIBLE FIXED POINT CONSTRAINTS RAISE
27
--     APPROPRIATE EXCEPTIONS.
28
 
29
 
30
-- HISTORY:
31
--     RJK 05/17/83  CREATED ORIGINAL TEST.
32
--     PWB 02/03/86  CORRECTED TEST ERROR:
33
--                   ADDED POSSIBLITY OF NUMERIC_ERROR
34
--                   IN DECLARATIONS OF SFX3 AND SFX4.
35
--     BCB 10/21/87  CHANGED HEADER TO STANDARD FORMAT.  CHANGED RANGE
36
--                   CONSTRAINTS OF SUBTYPE SFX1.  CHANGED UPPER BOUND
37
--                   OF THE CONSTRAINT OF SFX4.  CHANGED RANGE
38
--                   CONSTRAINTS OF FIX.
39
--     JRL 03/30/93  REMOVED NUMERIC_ERROR FROM TEST.
40
--     PWN 10/27/95  REMOVED OUT OF RANGE STATIC VALUE CHECKS.
41
--     EDS 07/16/98  AVOID OPTIMIZATION
42
 
43
WITH REPORT; USE REPORT;
44
PROCEDURE C35904A IS
45
 
46
     TYPE FIX IS DELTA 0.5 RANGE -3.0 .. 3.0;
47
 
48
BEGIN
49
 
50
     TEST ("C35904A", "CHECK THAT INCOMPATIBLE FIXED POINT " &
51
                      "CONSTRAINTS RAISE APPROPRIATE EXCEPTION");
52
 
53
-- TEST FOR CORRECT SUBTYPE DEFINITION FOR COMPATIBILITY BETWEEN TYPE
54
-- AND SUBTYPE CONSTRAINTS.
55
 
56
     BEGIN
57
 
58
          DECLARE
59
 
60
               SUBTYPE SFX1 IS FIX DELTA 1.0 RANGE 0.0 .. 2.0;   -- OK.
61
               SFX1_VAR : SFX1;
62
 
63
          BEGIN
64
               SFX1_VAR := 1.0;
65
          END;
66
 
67
     EXCEPTION
68
          WHEN CONSTRAINT_ERROR =>
69
                FAILED ("FIXED POINT CONSTRAINTS ARE NOT IN ERROR");
70
          WHEN OTHERS =>
71
                FAILED ("EXCEPTION SHOULD NOT BE RAISED WHILE " &
72
                        "CHECKING DELTA CONSTRAINT");
73
     END;
74
 
75
-- TEST FOR INCORRECT SUBTYPE DEFINITION ON ACCURACY BETWEEN TYPE AND
76
-- SUBTYPE DEFINITIONS.
77
 
78
     BEGIN
79
 
80
          DECLARE
81
 
82
               SUBTYPE SFX IS FIX DELTA 0.1;  -- DELTA IS SMALLER FOR
83
                                              -- SUBTYPE THAN FOR TYPE.
84
               -- DEFINE AN OBJECT OF SUBTYPE SFX AND USE IT TO AVOID 
85
               -- OPTIMIZATION OF SUBTYPE
86
               SFX_VAR : SFX := FIX(IDENT_INT(1));
87
 
88
          BEGIN
89
               FAILED ("NO EXCEPTION RAISED FOR INCOMPATABLE DELTA " &
90
                       FIX'IMAGE(SFX_VAR) );  --USE SFX_VAR
91
          END;
92
 
93
     EXCEPTION
94
          WHEN CONSTRAINT_ERROR =>
95
               NULL;
96
          WHEN OTHERS =>
97
               FAILED ("INCORRECT EXCEPTION RAISED WHILE CHECKING " &
98
                       "DELTA CONSTRAINT");
99
     END;
100
 
101
     RESULT;
102
 
103
END C35904A;

powered by: WebSVN 2.1.0

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