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/] [c35508h.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
-- C35508H.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 FORMAL DISCRETE TYPE WHOSE ACTUAL PARAMETER IS A
28
--     BOOLEAN TYPE.
29
 
30
-- HISTORY:
31
--     RJW 03/24/86 CREATED ORIGINAL TEST.
32
--     DHH 10/19/87 SHORTENED LINES CONTAINING MORE THAN 72 CHARACTERS.
33
 
34
WITH REPORT; USE REPORT;
35
 
36
PROCEDURE C35508H IS
37
 
38
BEGIN
39
     TEST ("C35508H", "CHECK THAT 'PRED' AND 'SUCC' YIELD THE " &
40
                      "CORRECT RESULTS WHEN THE PREFIX IS A " &
41
                      "FORMAL DISCRETE TYPE WHOSE ACTUAL PARAMETER " &
42
                      "IS A BOOLEAN TYPE" );
43
 
44
     DECLARE
45
 
46
          TYPE NEWBOOL IS NEW BOOLEAN;
47
 
48
          GENERIC
49
               TYPE BOOL IS (<>);
50
               F, T : BOOL;
51
          PROCEDURE P (STR : STRING);
52
 
53
          PROCEDURE P (STR : STRING) IS
54
               SUBTYPE SBOOL IS BOOL RANGE T .. T;
55
          BEGIN
56
               BEGIN
57
                    IF BOOL'PRED (T) /= F THEN
58
                         FAILED ( "INCORRECT VALUE FOR " &
59
                                   STR & "'PRED OF T" );
60
                    END IF;
61
                    IF BOOL'SUCC (F) /= T THEN
62
                         FAILED ( "INCORRECT VALUE FOR " &
63
                                   STR & "'SUCC OF F" );
64
                    END IF;
65
               END;
66
 
67
               BEGIN
68
                    IF SBOOL'PRED (T) /= F THEN
69
                         FAILED ( "INCORRECT VALUE FOR SBOOL'PRED " &
70
                                  "OF T FOR " & STR);
71
                    END IF;
72
               END;
73
 
74
               BEGIN
75
                    IF SBOOL'PRED (SBOOL'BASE'FIRST) = T THEN
76
                         FAILED("'PRED('FIRST) WRAPPED AROUND " &
77
                                "TO TRUE FOR " & STR);
78
                    END IF;
79
                    FAILED ( "NO EXCEPTION RAISED FOR " &
80
                              STR & "'PRED (SBOOL'BASE'FIRST)" );
81
               EXCEPTION
82
                    WHEN CONSTRAINT_ERROR =>
83
                         NULL;
84
                    WHEN OTHERS =>
85
                         FAILED ( "WRONG EXCEPTION RAISED FOR " &
86
                                   STR & "'PRED (SBOOL'BASE'FIRST)" );
87
               END;
88
 
89
               BEGIN
90
                    IF SBOOL'SUCC (SBOOL'BASE'LAST) = F THEN
91
                         FAILED("'SUCC('LAST) WRAPPED AROUND TO " &
92
                                "FALSE FOR " & STR);
93
                    END IF;
94
                    FAILED ( "NO EXCEPTION RAISED FOR " & STR &
95
                             "'SUCC (SBOOL'BASE'LAST)" );
96
               EXCEPTION
97
                    WHEN CONSTRAINT_ERROR =>
98
                         NULL;
99
                    WHEN OTHERS =>
100
                         FAILED ( "WRONG EXCEPTION RAISED FOR " &
101
                                  STR & "'SUCC (SBOOL'BASE'LAST)" );
102
               END;
103
          END P;
104
 
105
          PROCEDURE NP1 IS NEW P
106
                         ( BOOL => BOOLEAN, F => FALSE, T => TRUE );
107
 
108
          PROCEDURE NP2 IS NEW P
109
                         ( BOOL => NEWBOOL, F => FALSE, T => TRUE );
110
     BEGIN
111
          NP1 ("BOOLEAN");
112
          NP2 ("NEWBOOL");
113
     END;
114
 
115
     RESULT;
116
END C35508H;

powered by: WebSVN 2.1.0

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