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/] [c45614a.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
-- C45614A.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 CONSTRAINT_ERROR IS RAISED IF THE EXPONENT VALUE IN 
26
-- AN INTEGER EXPONENTIATION IS NEGATIVE.
27
-- CHECK BOTH STATIC AND NONSTATIC EXPONENT VALUES.
28
 
29
-- AH  9/29/86
30
-- EDS 7/15/98    AVOID OPTIMIZATION
31
 
32
WITH REPORT; USE REPORT;
33
PROCEDURE C45614A IS
34
     INT : INTEGER :=1;
35
     RES : INTEGER :=0;
36
BEGIN
37
     TEST ("C45614A", "CONSTRAINT_ERROR IS RAISED FOR INTEGERS " &
38
                      "HAVING A NEGATIVE EXPONENT");
39
 
40
     DECLARE
41
          E1 : CONSTANT INTEGER := -5;
42
     BEGIN
43
          RES := INT ** E1;
44
          FAILED ("CONSTRAINT_ERROR NOT RAISED - E1A " &
45
                   INTEGER'IMAGE(RES));
46
 
47
     EXCEPTION
48
          WHEN CONSTRAINT_ERROR =>
49
               NULL;
50
          WHEN OTHERS =>
51
               FAILED ("CONSTRAINT_ERROR NOT RAISED - E1B");
52
     END;
53
 
54
     DECLARE
55
          E2 : INTEGER := 5;
56
     BEGIN
57
          RES := INT ** (-E2);
58
          FAILED ("CONSTRAINT_ERROR NOT RAISED - E2A " &
59
                  INTEGER'IMAGE(RES));
60
 
61
     EXCEPTION
62
          WHEN CONSTRAINT_ERROR =>
63
               NULL;
64
          WHEN OTHERS =>
65
               FAILED ("CONSTRAINT_ERROR NOT RAISED - E2B");
66
     END;
67
 
68
     DECLARE
69
          E3 : INTEGER;
70
     BEGIN
71
          E3 := IDENT_INT(-5);
72
          RES := INT ** E3;
73
          FAILED ("CONSTRAINT_ERROR NOT RAISED - E3A " &
74
                  INTEGER'IMAGE(RES));
75
 
76
     EXCEPTION
77
          WHEN CONSTRAINT_ERROR =>
78
               NULL;
79
          WHEN OTHERS =>
80
               FAILED ("CONSTRAINT_ERROR NOT RAISED - E3B");
81
     END;
82
 
83
     DECLARE
84
     BEGIN
85
          RES := INT ** IDENT_INT(-5);
86
          FAILED ("CONSTRAINT_ERROR NOT RAISED - E4A " &
87
                  INTEGER'IMAGE(RES));
88
 
89
     EXCEPTION
90
          WHEN CONSTRAINT_ERROR =>
91
               NULL;
92
          WHEN OTHERS =>
93
               FAILED ("CONSTRAINT_ERROR NOT RAISED - E4B");
94
     END;
95
 
96
     RES := IDENT_INT(2);
97
     RES := IDENT_INT(RES);
98
     RESULT;
99
END C45614A;

powered by: WebSVN 2.1.0

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