annotate gcc/testsuite/ada/acats/tests/c7/c760013.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 -- C760013.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 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 --
kono
parents:
diff changeset
26 -- OBJECTIVE:
kono
parents:
diff changeset
27 -- Check that Initialize is not called for default-initialized subcomponents
kono
parents:
diff changeset
28 -- of the ancestor type of an extension aggregate. (Defect Report
kono
parents:
diff changeset
29 -- 8652/0021, Technical Corrigendum 7.6(11/1)).
kono
parents:
diff changeset
30 --
kono
parents:
diff changeset
31 -- CHANGE HISTORY:
kono
parents:
diff changeset
32 -- 25 JAN 2001 PHL Initial version.
kono
parents:
diff changeset
33 -- 29 JUN 2001 RLB Reformatted for ACATS.
kono
parents:
diff changeset
34 --
kono
parents:
diff changeset
35 --!
kono
parents:
diff changeset
36 with Ada.Finalization;
kono
parents:
diff changeset
37 use Ada.Finalization;
kono
parents:
diff changeset
38 package C760013_0 is
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 type Ctrl1 is new Controlled with
kono
parents:
diff changeset
41 record
kono
parents:
diff changeset
42 C : Integer := 0;
kono
parents:
diff changeset
43 end record;
kono
parents:
diff changeset
44 type Ctrl2 is new Controlled with
kono
parents:
diff changeset
45 record
kono
parents:
diff changeset
46 C : Integer := 0;
kono
parents:
diff changeset
47 end record;
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 procedure Initialize (Obj1 : in out Ctrl1);
kono
parents:
diff changeset
50 procedure Initialize (Obj2 : in out Ctrl2);
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 end C760013_0;
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 with Report;
kono
parents:
diff changeset
55 use Report;
kono
parents:
diff changeset
56 package body C760013_0 is
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 procedure Initialize (Obj1 : in out Ctrl1) is
kono
parents:
diff changeset
59 begin
kono
parents:
diff changeset
60 Obj1.C := Ident_Int (47);
kono
parents:
diff changeset
61 end Initialize;
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 procedure Initialize (Obj2 : in out Ctrl2) is
kono
parents:
diff changeset
64 begin
kono
parents:
diff changeset
65 Failed ("Initialize called for type Ctrl2");
kono
parents:
diff changeset
66 end Initialize;
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 end C760013_0;
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 with Ada.Finalization;
kono
parents:
diff changeset
71 with C760013_0;
kono
parents:
diff changeset
72 use C760013_0;
kono
parents:
diff changeset
73 with Report;
kono
parents:
diff changeset
74 use Report;
kono
parents:
diff changeset
75 procedure C760013 is
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 type T is tagged
kono
parents:
diff changeset
78 record
kono
parents:
diff changeset
79 C1 : Ctrl1;
kono
parents:
diff changeset
80 C2 : Ctrl2 := (Ada.Finalization.Controlled with
kono
parents:
diff changeset
81 C => Ident_Int (23));
kono
parents:
diff changeset
82 end record;
kono
parents:
diff changeset
83
kono
parents:
diff changeset
84 type Nt is new T with
kono
parents:
diff changeset
85 record
kono
parents:
diff changeset
86 C3 : Float;
kono
parents:
diff changeset
87 end record;
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 X : Nt;
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 begin
kono
parents:
diff changeset
92 Test ("C760013",
kono
parents:
diff changeset
93 "Check that Initialize is not called for " &
kono
parents:
diff changeset
94 "default-initialized subcomponents of the ancestor type of an " &
kono
parents:
diff changeset
95 "extension aggregate");
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97 X := (T with C3 => 5.0);
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 if X.C1.C /= Ident_Int (47) then
kono
parents:
diff changeset
100 Failed ("Initialize not called for type Ctrl1");
kono
parents:
diff changeset
101 end if;
kono
parents:
diff changeset
102 if X.C2.C /= Ident_Int (23) then
kono
parents:
diff changeset
103 Failed ("Initial value not assigned for type Ctrl2");
kono
parents:
diff changeset
104 end if;
kono
parents:
diff changeset
105
kono
parents:
diff changeset
106 Result;
kono
parents:
diff changeset
107 end C760013;
kono
parents:
diff changeset
108