OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c3/] [c35508g.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C35508G.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 RESULTS WHEN THE
27
--     PREFIX IS A BOOLEAN TYPE.
28
 
29
-- HISTORY:
30
--     RJW 03/19/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 C35508G IS
36
 
37
BEGIN
38
     TEST ("C35508G", "CHECK THAT 'PRED' AND 'SUCC' YIELD THE " &
39
                      "CORRECT RESULTS WHEN THE PREFIX IS A " &
40
                      "BOOLEAN TYPE" );
41
 
42
     BEGIN
43
          IF BOOLEAN'PRED (IDENT_BOOL(TRUE)) /= FALSE THEN
44
               FAILED ( "INCORRECT VALUE FOR PRED OF TRUE" );
45
          END IF;
46
          IF BOOLEAN'SUCC (IDENT_BOOL(FALSE)) /= TRUE THEN
47
               FAILED ( "INCORRECT VALUE FOR SUCC OF FALSE" );
48
          END IF;
49
     END;
50
 
51
     DECLARE
52
          TYPE NEWBOOL IS NEW BOOLEAN;
53
     BEGIN
54
          IF NEWBOOL'PRED (TRUE) /= FALSE THEN
55
               FAILED ( "INCORRECT VALUE FOR NEWBOOL'PRED OF TRUE" );
56
          END IF;
57
          IF NEWBOOL'SUCC (FALSE) /= TRUE THEN
58
               FAILED ( "INCORRECT VALUE FOR NEWBOOL'SUCC OF FALSE" );
59
          END IF;
60
     END;
61
 
62
     DECLARE
63
 
64
          SUBTYPE SBOOL IS BOOLEAN RANGE IDENT_BOOL(TRUE) ..
65
                                                      IDENT_BOOL(TRUE);
66
 
67
     BEGIN
68
          BEGIN
69
               IF SBOOL'PRED (IDENT_BOOL(TRUE)) /= FALSE THEN
70
                    FAILED ( "INCORRECT VALUE FOR SBOOL'PRED " &
71
                             "OF TRUE" );
72
               END IF;
73
          END;
74
 
75
          BEGIN
76
               IF SBOOL'PRED (IDENT_BOOL(SBOOL'BASE'FIRST)) = TRUE THEN
77
                    FAILED("'PRED('FIRST) WRAPPED AROUNT TO TRUE");
78
               END IF;
79
               FAILED ( "NO EXCEPTION RAISED FOR " &
80
                        "'PRED (SBOOL'BASE'FIRST)" );
81
          EXCEPTION
82
               WHEN CONSTRAINT_ERROR =>
83
                    NULL;
84
               WHEN OTHERS =>
85
                    FAILED ( "WRONG EXCEPTION RAISED FOR " &
86
                             "'PRED (SBOOL'BASE'FIRST)" );
87
          END;
88
 
89
          BEGIN
90
               IF SBOOL'SUCC (IDENT_BOOL(SBOOL'BASE'LAST)) = FALSE THEN
91
                    FAILED("'SUCC('LAST) WRAPPED AROUNT TO FALSE");
92
               END IF;
93
               FAILED ( "NO EXCEPTION RAISED FOR " &
94
                        "'SUCC (SBOOL'BASE'LAST)" );
95
          EXCEPTION
96
               WHEN CONSTRAINT_ERROR =>
97
                    NULL;
98
               WHEN OTHERS =>
99
                    FAILED ( "WRONG EXCEPTION RAISED FOR " &
100
                             "'SUCC (SBOOL'BASE'LAST)" );
101
          END;
102
     END;
103
 
104
     RESULT;
105
END C35508G;

powered by: WebSVN 2.1.0

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