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/] [c47003a.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
-- C47003A.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
-- WHEN THE TYPE MARK IN A QUALIFIED EXPRESSION DENOTES AN 
26
-- ENUMERATION TYPE, CHECK THAT CONSTRAINT_ERROR IS RAISED WHEN THE 
27
-- VALUE OF THE OPERAND DOES NOT LIE WITHIN THE RANGE OF THE TYPE MARK.
28
 
29
-- RJW 7/23/86
30
 
31
WITH REPORT; USE REPORT;
32
PROCEDURE C47003A IS
33
 
34
BEGIN
35
 
36
     TEST( "C47003A", "WHEN THE TYPE MARK IN A QUALIFIED " &
37
                      "EXPRESSION DENOTES AN ENUMERATION " &
38
                      "TYPE, CHECK THAT CONSTRAINT_ERROR IS RAISED " &
39
                      "WHEN THE VALUE OF THE OPERAND DOES NOT LIE " &
40
                      "WITHIN THE RANGE OF THE TYPE MARK" );
41
 
42
     DECLARE
43
 
44
          TYPE WEEK IS (SUN, MON, TUE, WED, THU, FRI, SAT);
45
          SUBTYPE MIDWEEK IS WEEK RANGE TUE .. THU;
46
 
47
          FUNCTION IDENT (W : WEEK) RETURN WEEK IS
48
          BEGIN
49
               RETURN WEEK'VAL (IDENT_INT (WEEK'POS (W)));
50
          END IDENT;
51
 
52
     BEGIN
53
          IF MIDWEEK'(IDENT (SUN)) = TUE THEN
54
               FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
55
                        "SUBTYPE MIDWEEK - 1");
56
          ELSE
57
               FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
58
                        "SUBTYPE MIDWEEK - 2");
59
          END IF;
60
     EXCEPTION
61
          WHEN CONSTRAINT_ERROR =>
62
               NULL;
63
          WHEN OTHERS =>
64
               FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " &
65
                        "OF SUBTYPE MIDWEEK" );
66
     END;
67
 
68
     DECLARE
69
 
70
          SUBTYPE CHAR IS CHARACTER RANGE 'C' .. 'R';
71
 
72
     BEGIN
73
          IF CHAR'(IDENT_CHAR ('A')) = 'C' THEN
74
               FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
75
                        "SUBTYPE CHAR - 1");
76
          ELSE
77
               FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
78
                        "SUBTYPE CHAR - 2");
79
          END IF;
80
     EXCEPTION
81
          WHEN CONSTRAINT_ERROR =>
82
               NULL;
83
          WHEN OTHERS =>
84
               FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " &
85
                        "OF SUBTYPE CHAR" );
86
     END;
87
 
88
     DECLARE
89
 
90
          TYPE NBOOL IS NEW BOOLEAN;
91
          SUBTYPE NFALSE IS NBOOL RANGE FALSE .. FALSE;
92
 
93
          FUNCTION IDENT (B : NBOOL) RETURN NBOOL IS
94
          BEGIN
95
               RETURN NBOOL (IDENT_BOOL (BOOLEAN (B)));
96
          END IDENT;
97
 
98
     BEGIN
99
          IF NFALSE'(IDENT (TRUE)) = FALSE THEN
100
               FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
101
                        "SUBTYPE NFALSE - 1");
102
          ELSE
103
               FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " &
104
                        "SUBTYPE NFALSE - 2");
105
          END IF;
106
     EXCEPTION
107
          WHEN CONSTRAINT_ERROR =>
108
               NULL;
109
          WHEN OTHERS =>
110
               FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " &
111
                        "OF SUBTYPE NFALSE" );
112
     END;
113
 
114
     RESULT;
115
END C47003A;

powered by: WebSVN 2.1.0

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