annotate gcc/testsuite/ada/acats/tests/c3/c380002.a @ 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 -- C380002.A
kono
parents:
diff changeset
2 --
kono
parents:
diff changeset
3 -- Grant of Unlimited Rights
kono
parents:
diff changeset
4 --
kono
parents:
diff changeset
5 -- The Ada Conformity Assessment Authority (ACAA) holds unlimited
kono
parents:
diff changeset
6 -- rights in the software and documentation contained herein. Unlimited
kono
parents:
diff changeset
7 -- rights are the same as those granted by the U.S. Government for older
kono
parents:
diff changeset
8 -- parts of the Ada Conformity Assessment Test Suite, and are defined
kono
parents:
diff changeset
9 -- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
kono
parents:
diff changeset
10 -- intends to confer upon all recipients unlimited rights equal to those
kono
parents:
diff changeset
11 -- held by the ACAA. These rights include rights to use, duplicate,
kono
parents:
diff changeset
12 -- release or disclose the released technical data and computer software
kono
parents:
diff changeset
13 -- in whole or in part, in any manner and for any purpose whatsoever, and
kono
parents:
diff changeset
14 -- to have or permit others 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 ACAA 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 --
kono
parents:
diff changeset
26 -- OBJECTIVE:
kono
parents:
diff changeset
27 -- Check that an expression in a per-object discriminant constraint which is
kono
parents:
diff changeset
28 -- part of a named association is evaluated once for each association.
kono
parents:
diff changeset
29 -- (Defect Report 8652/0002, as reflected in Technical Corrigendum 1,
kono
parents:
diff changeset
30 -- RM95 3.8(18.1/1)).
kono
parents:
diff changeset
31 --
kono
parents:
diff changeset
32 -- CHANGE HISTORY:
kono
parents:
diff changeset
33 -- 9 FEB 2001 PHL Initial version.
kono
parents:
diff changeset
34 -- 29 JUN 2002 RLB Readied for release.
kono
parents:
diff changeset
35 --
kono
parents:
diff changeset
36 --!
kono
parents:
diff changeset
37 with Ada.Exceptions;
kono
parents:
diff changeset
38 use Ada.Exceptions;
kono
parents:
diff changeset
39 with Report;
kono
parents:
diff changeset
40 use Report;
kono
parents:
diff changeset
41 procedure C380002 is
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 F_Val : Integer := Ident_Int (0);
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 function F return Integer is
kono
parents:
diff changeset
46 begin
kono
parents:
diff changeset
47 F_Val := F_Val + Ident_Int (1);
kono
parents:
diff changeset
48 return F_Val;
kono
parents:
diff changeset
49 end F;
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 type R1;
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 type R2 (D0 : Integer; D1 : access R1; D2 : Integer; D3 : Integer) is
kono
parents:
diff changeset
54 limited null record;
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 type R1 is limited
kono
parents:
diff changeset
57 record
kono
parents:
diff changeset
58 C : R2 (D1 => R1'Access, D0 | D2 | D3 => F);
kono
parents:
diff changeset
59 end record;
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 begin
kono
parents:
diff changeset
62 Test ("C380002", "Check that an expression in a per-object discriminant " &
kono
parents:
diff changeset
63 "constraint which is part of a named association is " &
kono
parents:
diff changeset
64 "evaluated once for each association");
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 if not Equal (F_Val, 3) then
kono
parents:
diff changeset
67 Failed ("Expression not evaluated the proper number of times");
kono
parents:
diff changeset
68 end if;
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 Result;
kono
parents:
diff changeset
71 end C380002;
kono
parents:
diff changeset
72