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/] [c35503g.ada] - Blame information for rev 309

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

Line No. Rev Author Line
1 294 jeremybenn
-- C35503G.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 'PRED' AND 'SUCC' YIELD THE CORRECT RESULT WHEN THE
27
--     PREFIX IS AN INTEGER TYPE.
28
 
29
-- HISTORY:
30
--     RJW 03/17/86 CREATED ORIGINAL TEST.
31
--     DHH 10/19/87 SHORTENED LINES CONTAINING MORE THAN 72 CHARACTERS.
32
 
33
WITH REPORT; USE REPORT;
34
 
35
PROCEDURE C35503G IS
36
 
37
BEGIN
38
     TEST ("C35503G", "CHECK THAT 'PRED' AND 'SUCC' YIELD THE " &
39
                      "CORRECT RESULT WHEN THE PREFIX IS AN " &
40
                      "INTEGER TYPE" );
41
 
42
     DECLARE
43
          TYPE INT IS RANGE -6 .. 6;
44
          SUBTYPE SINT IS INT RANGE -4 .. 4;
45
 
46
     BEGIN
47
 
48
          FOR I IN INT'FIRST + 1 .. INT'LAST LOOP
49
               BEGIN
50
                    IF SINT'PRED (I) /= I - 1 THEN
51
                         FAILED ( "WRONG SINT'PRED FOR " &
52
                                  INT'IMAGE (I));
53
                    END IF;
54
               EXCEPTION
55
                    WHEN OTHERS =>
56
                         FAILED ( "EXCEPTION RAISED FOR " &
57
                                  "SINT'PRED OF " &
58
                                  INT'IMAGE (I));
59
               END;
60
          END LOOP;
61
 
62
          FOR I IN INT'FIRST .. INT'LAST - 1 LOOP
63
               BEGIN
64
                    IF SINT'SUCC (I) /= I + 1 THEN
65
                         FAILED ( "WRONG SINT'SUCC FOR " &
66
                                  INT'IMAGE (I));
67
                         END IF;
68
               EXCEPTION
69
                    WHEN OTHERS =>
70
                         FAILED ( "EXCEPTION RAISED FOR " &
71
                                  "SINT'SUCC OF " &
72
                                  INT'IMAGE (I));
73
               END;
74
          END LOOP;
75
 
76
     END;
77
 
78
     DECLARE
79
          SUBTYPE INTRANGE IS INTEGER RANGE IDENT_INT(-6) ..
80
                                                          IDENT_INT(6);
81
          SUBTYPE SINTEGER IS INTEGER RANGE IDENT_INT(-4) ..
82
                                                          IDENT_INT(4);
83
 
84
     BEGIN
85
          FOR I IN INTRANGE LOOP
86
               BEGIN
87
                    IF SINTEGER'PRED (I) /= I - IDENT_INT(1) THEN
88
                         FAILED ( "WRONG SINTEGER'PRED FOR " &
89
                                  INTEGER'IMAGE (I));
90
                    END IF;
91
               EXCEPTION
92
                    WHEN OTHERS =>
93
                         FAILED ( "EXCEPTION RAISED FOR " &
94
                                  "SINTEGER'PRED OF " &
95
                                  INTEGER'IMAGE (I));
96
               END;
97
               BEGIN
98
                    IF SINTEGER'SUCC (I) /= I + IDENT_INT(1) THEN
99
                         FAILED ( "WRONG SINTEGER'SUCC FOR " &
100
                                  INTEGER'IMAGE (I));
101
                    END IF;
102
               EXCEPTION
103
                    WHEN OTHERS =>
104
                         FAILED ( "EXCEPTION RAISED FOR " &
105
                                  "SINTEGER'SUCC OF " &
106
                                  INTEGER'IMAGE (I));
107
               END;
108
          END LOOP;
109
 
110
     END;
111
 
112
     RESULT;
113
END C35503G;

powered by: WebSVN 2.1.0

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