annotate gcc/testsuite/ada/acats/tests/c4/c43214a.ada @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 -- C43214A.ADA
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 -- Grant of Unlimited Rights
kono
parents:
diff changeset
4 --
kono
parents:
diff changeset
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
kono
parents:
diff changeset
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
kono
parents:
diff changeset
7 -- unlimited rights in the software and documentation contained herein.
kono
parents:
diff changeset
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
kono
parents:
diff changeset
9 -- this public release, the Government intends to confer upon all
kono
parents:
diff changeset
10 -- recipients unlimited rights equal to those held by the Government.
kono
parents:
diff changeset
11 -- These rights include rights to use, duplicate, release or disclose the
kono
parents:
diff changeset
12 -- released technical data and computer software in whole or in part, in
kono
parents:
diff changeset
13 -- any manner and for any purpose whatsoever, and to have or permit others
kono
parents:
diff changeset
14 -- to do so.
kono
parents:
diff changeset
15 --
kono
parents:
diff changeset
16 -- DISCLAIMER
kono
parents:
diff changeset
17 --
kono
parents:
diff changeset
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
kono
parents:
diff changeset
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
kono
parents:
diff changeset
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
kono
parents:
diff changeset
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
kono
parents:
diff changeset
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
kono
parents:
diff changeset
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
kono
parents:
diff changeset
24 --*
kono
parents:
diff changeset
25 -- FOR A MULTIDIMENSIONAL AGGREGATE OF THE FORM (F..G => ""), CHECK
kono
parents:
diff changeset
26 -- THAT CONSTRAINT_ERROR IS RAISED IF F..G IS NON-NULL AND
kono
parents:
diff changeset
27 -- F OR G DO NOT BELONG TO THE INDEX SUBTYPE.
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 -- EG 02/10/1984
kono
parents:
diff changeset
30 -- JBG 12/6/84
kono
parents:
diff changeset
31 -- EDS 07/15/98 AVOID OPTIMIZATION
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 WITH REPORT;
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 PROCEDURE C43214A IS
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 USE REPORT;
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 BEGIN
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 TEST("C43214A", "FOR A MULTIDIMENSIONAL AGGREGATE OF THE FORM " &
kono
parents:
diff changeset
42 "(F..G => """"), CHECK THAT CONSTRAINT ERROR " &
kono
parents:
diff changeset
43 "IS RAISED IF F..G IS NON-NULL AND NOT IN THE " &
kono
parents:
diff changeset
44 "INDEX SUBTYPE");
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 DECLARE
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 SUBTYPE STA IS INTEGER RANGE 4 .. 7;
kono
parents:
diff changeset
49 TYPE TA IS ARRAY(STA RANGE 5 .. 6,
kono
parents:
diff changeset
50 STA RANGE 6 .. IDENT_INT(4)) OF CHARACTER;
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 A : TA := (5 .. 6 => "");
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 BEGIN
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 CASE_A : BEGIN
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 IF (6 .. IDENT_INT(8) => "") = A THEN
kono
parents:
diff changeset
59 FAILED ("CASE A : CONSTRAINT_ERROR NOT RAISED");
kono
parents:
diff changeset
60 END IF;
kono
parents:
diff changeset
61 FAILED ("CASE A : CONSTRAINT_ERROR NOT RAISED - 2");
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 EXCEPTION
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 WHEN CONSTRAINT_ERROR =>
kono
parents:
diff changeset
66 NULL;
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 WHEN OTHERS =>
kono
parents:
diff changeset
69 FAILED ("CASE A : WRONG EXCEPTION RAISED");
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 END CASE_A;
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 CASE_B : BEGIN
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 A := (IDENT_INT(3) .. 4 => "");
kono
parents:
diff changeset
76 FAILED ("CASE B : CONSTRAINT_ERROR NOT RAISED");
kono
parents:
diff changeset
77 BEGIN
kono
parents:
diff changeset
78 FAILED("ATTEMPT TO USE A " &
kono
parents:
diff changeset
79 CHARACTER'VAL(IDENT_INT(CHARACTER'POS(
kono
parents:
diff changeset
80 A(A'FIRST(1), A'FIRST(2)) ))) );
kono
parents:
diff changeset
81 EXCEPTION
kono
parents:
diff changeset
82 WHEN OTHERS =>
kono
parents:
diff changeset
83 FAILED("CONSTRAINT_ERROR NOT RAISED AT PROPER PLACE");
kono
parents:
diff changeset
84 END;
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 EXCEPTION
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 WHEN CONSTRAINT_ERROR =>
kono
parents:
diff changeset
89 NULL;
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 WHEN OTHERS =>
kono
parents:
diff changeset
92 FAILED ("CASE B : WRONG EXCEPTION RAISED");
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 END CASE_B;
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 END;
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 RESULT;
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 END C43214A;