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/] [c6/] [c64104b.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C64104B.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 UNDER APPROPRIATE CIRCUMSTANCES
26
--    WITH RESPECT TO PARAMETERS OF RECORD TYPES.  SUBTESTS INVOLVE 
27
--    ACTUAL RECORD PARAMETERS WHOSE CONSTRAINT VALUES ARE NOT EQUAL 
28
--    TO THE CONSTRAINTS ON THEIR CORRESPONDING FORMAL PARAMETERS:
29
--        (A) IN PARAMETER, STATIC AGGREGATE.
30
--        (B) IN PARAMETER, DYNAMIC AGGREGATE.
31
--        (C) IN PARAMETER, VARIABLE.
32
--        (D) IN OUT PARAMETER, EXCEPTION RAISED ON CALL.
33
--        (E) OUT PARAMETER, EXCEPTION RAISED ON CALL.
34
 
35
-- DAS 2/11/81
36
-- SPS 10/26/82
37
 
38
WITH REPORT;
39
PROCEDURE C64104B IS
40
 
41
     USE REPORT;
42
     SUBTYPE INT IS INTEGER RANGE 0..10;
43
     TYPE REC (N : INT := 0) IS
44
          RECORD
45
               A : STRING (1..N);
46
          END RECORD;
47
     SUBTYPE SREC IS REC(N=>3);
48
     PROCEDURE P1 (R : IN SREC) IS
49
     BEGIN
50
          FAILED ("EXCEPTION NOT RAISED ON CALL TO P1");
51
     EXCEPTION
52
          WHEN OTHERS =>
53
               FAILED ("EXCEPTION RAISED IN PROCEDURE P1");
54
     END P1;
55
 
56
     PROCEDURE P2 (R : IN OUT SREC) IS
57
     BEGIN
58
          FAILED ("EXCEPTION NOT RAISED ON CALL TO P2");
59
     EXCEPTION
60
          WHEN OTHERS =>
61
               FAILED ("EXCEPTION RAISED IN PROCEDURE P2");
62
     END P2;
63
 
64
     PROCEDURE P3 (R : OUT SREC) IS
65
     BEGIN
66
          FAILED ("EXCEPTION NOT RAISED ON CALL TO P3");
67
     EXCEPTION
68
          WHEN OTHERS =>
69
               FAILED ("EXCEPTION RAISED IN PROCEDURE P3");
70
     END P3;
71
 
72
BEGIN
73
 
74
     TEST ("C64104B", "CHECK RAISING OF CONSTRAINT_ERROR FOR " &
75
                      "PARAMETERS OF RECORD TYPES");
76
 
77
     BEGIN     -- (A)
78
          P1 ((2,"AA"));
79
          FAILED ("EXCEPTION NOT RAISED IN SUBTEST (A)");
80
     EXCEPTION
81
          WHEN CONSTRAINT_ERROR =>
82
               NULL;
83
          WHEN OTHERS =>
84
               FAILED ("WRONG EXCEPTION RAISED IN SUBTEST (A)");
85
     END; -- (A)
86
 
87
     BEGIN     -- (B)
88
          P1 ((IDENT_INT(2), "AA"));
89
          FAILED ("EXCEPTION NOT RAISED IN SUBTEST (B)");
90
     EXCEPTION
91
          WHEN CONSTRAINT_ERROR =>
92
               NULL;
93
          WHEN OTHERS =>
94
               FAILED ("WRONG EXCEPTION RAISED IN SUBTEST (B)");
95
     END; -- (B)
96
 
97
     DECLARE   -- (C)
98
          R : REC     := (IDENT_INT(2), "AA");
99
     BEGIN     -- (C)
100
          P1 (R);
101
          FAILED ("EXCEPTION NOT RAISED IN SUBTEST (C)");
102
     EXCEPTION
103
          WHEN CONSTRAINT_ERROR =>
104
               NULL;
105
          WHEN OTHERS =>
106
               FAILED ("WRONG EXCEPTION RAISED IN SUBTEST (C)");
107
     END; -- (C)
108
 
109
     DECLARE   -- (D)
110
          R : REC     := (IDENT_INT(2), "AA");
111
     BEGIN     -- (D)
112
          P2 (R);
113
          FAILED ("EXCEPTION NOT RAISED IN SUBTEST (D)");
114
     EXCEPTION
115
          WHEN CONSTRAINT_ERROR =>
116
               NULL;
117
          WHEN OTHERS =>
118
               FAILED ("WRONG EXCEPTION RAISED IN SUBTEST (D)");
119
     END; -- (D)
120
 
121
 
122
     DECLARE   -- (E)
123
          R  : REC;
124
     BEGIN     -- (E)
125
          P3 (R);
126
          FAILED ("EXCEPTION NOT RAISED IN SUBTEST (E)");
127
     EXCEPTION
128
          WHEN CONSTRAINT_ERROR =>
129
               NULL;
130
          WHEN OTHERS =>
131
                FAILED ("WRONG EXCEPTION RAISED IN SUBTEST (E)");
132
     END; -- (E)
133
 
134
     RESULT;
135
 
136
END C64104B;

powered by: WebSVN 2.1.0

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