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/] [c5/] [c52005f.ada] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
-- C52005F.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 THE CONSTRAINT_ERROR EXCEPTION IS RAISED
26
--    WHEN A DYNAMIC EXPRESSION VALUE IS OUTSIDE THE STATIC RANGE
27
--    OF FIXED POINT ASSIGNMENTS.
28
 
29
-- JRK 7/21/80
30
-- SPS 3/21/83
31
 
32
WITH REPORT;
33
PROCEDURE C52005F IS
34
 
35
     USE REPORT;
36
 
37
BEGIN
38
     TEST ("C52005F", "CHECK THAT CONSTRAINT_ERROR EXCEPTION IS RAISED"
39
         & " ON DYNAMIC OUT OF RANGE FIXED POINT ASSIGNMENTS");
40
 
41
-----------------------
42
 
43
     DECLARE
44
          TYPE REAL IS DELTA 0.01 RANGE 0.00 .. 9.99;
45
          FX : REAL := 4.50;
46
          FX1 : REAL RANGE 0.00 .. 7.00 := 4.50;
47
 
48
     BEGIN
49
          IF EQUAL(3,3) THEN
50
               FX := 7.01;
51
          END IF;
52
          FX1 := FX;
53
 
54
          FAILED ("EXCEPTION NOT RAISED FOR OUT OF RANGE FIXED ASSNMT");
55
 
56
     EXCEPTION
57
     WHEN CONSTRAINT_ERROR =>
58
          IF FX1 /= 4.50 THEN
59
               FAILED ("VALUE ALTERED BEFORE FIXED PT RANGE EXCEPTION");
60
          END IF;
61
 
62
     END;
63
 
64
-------------------------
65
 
66
     DECLARE
67
          TYPE REAL IS DELTA 0.01 RANGE 0.00 .. 9.99;
68
          FX : REAL := 4.50;
69
          FX2 : REAL RANGE 0.00 .. 7.00 := 4.50;
70
 
71
     BEGIN
72
          IF EQUAL(3,3) THEN
73
               FX := 7.00;
74
          END IF;
75
          FX2 := FX;
76
 
77
     EXCEPTION
78
     WHEN CONSTRAINT_ERROR =>
79
          FAILED ("EXCEPTION RAISED ON LEGAL FIXED PT ASSNMT");
80
 
81
     END;
82
 
83
-------------------------
84
 
85
     RESULT;
86
END C52005F;

powered by: WebSVN 2.1.0

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