summaryrefslogtreecommitdiff
path: root/gcc/testsuite/ada/acats/tests/c4/c452001.a
blob: ec78cd2a5a0becdd33de86f4be015c0712a70646 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
-- C452001.A
--
--                             Grant of Unlimited Rights
--
--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained 
--     unlimited rights in the software and documentation contained herein.
--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making 
--     this public release, the Government intends to confer upon all 
--     recipients unlimited rights  equal to those held by the Government.  
--     These rights include rights to use, duplicate, release or disclose the 
--     released technical data and computer software in whole or in part, in 
--     any manner and for any purpose whatsoever, and to have or permit others 
--     to do so.
--
--                                    DISCLAIMER
--
--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED 
--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE 
--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--     PARTICULAR PURPOSE OF SAID MATERIAL.
--*
--
-- OBJECTIVE:
--      For a type extension, check that predefined equality is defined in
--      terms of the primitive equals operator of the parent type and any
--      tagged components of the extension part.
--
--      For other composite types, check that the primitive equality operator
--      of any matching tagged components is used to determine equality of the
--      enclosing type.
--
--      For private types, check that predefined equality is defined in
--      terms of the user-defined (primitive) operator of the full type if
--      the full type is tagged. The partial view of the type may be
--      tagged or untagged. Check that predefined equality for a private
--      type whose full view is untagged is defined in terms of the
--      predefined equality operator of its full type.
--
-- TEST DESCRIPTION:
--      Tagged types are declared and used as components in several
--      differing composite type declarations, both tagged and untagged.
--      To differentiate between predefined and primitive equality
--      operations, user-defined equality operators are declared for
--      each component type that is to contribute to the equality
--      operator of the composite type that houses it. All user-defined
--      equality operations are designed to yield the opposite result
--      from the predefined operator, given the same component values.
--
--      For cases where primitive equality is to be incorporated into
--      equality for the enclosing composite type, values are assigned
--      to the component type so that user-defined equality will return
--      True. If predefined equality is to be used instead, then the
--      same strategy results in the equality operator returning False.
--
--      When equality for a type incorporates the user-defined equality
--      operator of one of its component types, the resulting operator
--      is considered to be the predefined operator of the composite type.
--      This case is confirmed by defining an tagged component of an
--      untagged composite type, then using the resulting untagged type
--      as a component of another composite type. The user-defined operator
--      for the lowest level should still be called.
--
--      Three cases are set up to test private types:
--
--                        Case 1        Case 2      Case 3
--         partial view:  tagged       untagged    untagged
--         full view:     tagged        tagged     untagged
--
--      Types are declared for each of the above cases and user-defined
--      (primitive) operators are declared following the full type
--      declaration of each type (i.e., in the private part).
--
--      Values are assigned into objects of these types using the same
--      strategy outlined above. Cases 1 and 2 should execute the
--      user-defined operator. Case 3 should ignore the user-defined
--      operator and user predefined equality for the type.
--
--
-- CHANGE HISTORY:
--      06 Dec 94   SAIC    ACVC 2.0
--      19 Dec 94   SAIC    Removed RM references from objective text.
--      15 Nov 95   SAIC    Fixed for 2.0.1
--      04 NOV 96   SAIC    Typographical revision
--
--!

package c452001_0 is

   type Point is
      record
         X : Integer := 0;
         Y : Integer := 0;
      end record;

   type Circle is tagged
      record
         Center : Point;
         Radius : Integer;
      end record;

   function "=" (L, R : Circle) return Boolean;

   type Colors is (Red, Orange, Yellow, Green, Blue, Purple, Black, White);

   type Colored_Circle is new Circle
      with record
         Color : Colors := White;
      end record;

   function "=" (L, R : Colored_Circle) return Boolean;
   -- Override predefined equality for this tagged type. Predefined
   -- equality should incorporate user-defined (primitive) equality
   -- from type Circle. See C340001 for a test of that feature.

   -- Equality is overridden to ensure that predefined equality 
   -- incorporates this user-defined function for
   -- any composite type with Colored_Circle as a component type.
   -- (i.e., the type extension is recognized as a tagged type for
   -- the purpose of defining predefined equality for the composite type).

end C452001_0;

package body c452001_0 is

   function "=" (L, R : Circle) return Boolean is
   begin
      return L.Radius = R.Radius; -- circles are same size
   end "=";

   function "=" (L, R : Colored_Circle) return Boolean is
   begin
      return Circle(L) = Circle(R);
   end "=";

end C452001_0;

with C452001_0;
package C452001_1 is

   type Planet is tagged record
      Name : String (1..15);
      Representation : C452001_0.Colored_Circle;
   end record;

   -- Type Planet will be used to check that predefined equality
   -- for a tagged type with a tagged component incorporates
   -- user-defined equality for the component type.

   type TC_Planet is new Planet with null record;

   -- A "copy" of Planet. Used to create a type extension. An "="
   -- operator will be defined for this type that should be
   -- incorporated by the type extension.

   function "=" (Arg1, Arg2 : in TC_Planet) return Boolean;

   type Craters is array (1..3) of C452001_0.Colored_Circle;

   -- An array type (untagged) with tagged components

   type Moon is new TC_Planet
     with record
        Crater : Craters;
     end record;
     
   -- A tagged record type. Extended component type is untagged,
   -- but its predefined equality operator should incorporate
   -- the user-defined operator of its tagged component type.

end C452001_1;

package body C452001_1 is

   function "=" (Arg1, Arg2 : in TC_Planet) return Boolean is
   begin
      return Arg1.Name = Arg2.Name;
   end "=";

end C452001_1;

package C452001_2 is

   -- Untagged record types
   -- Equality should not be incorporated

   type Spacecraft_Design is (Mariner, Pioneer, Viking, Voyager);
   type Spacecraft is record
     Design      : Spacecraft_Design;
     Operational : Boolean;
   end record;

   function "=" (L : in Spacecraft; R : in Spacecraft) return Boolean;

   type Mission is record
      Craft       : Spacecraft;
      Launch_Date : Natural;
   end record;

   type Inventory is array (Positive range <>) of Spacecraft;

end C452001_2;

package body C452001_2 is

   function "=" (L : in Spacecraft; R : in Spacecraft) return Boolean is
   begin
      return L.Design = R.Design;
   end "=";

end C452001_2;

package C452001_3 is

   type Tagged_Partial_Tagged_Full is tagged private;
   procedure Change (Object : in out Tagged_Partial_Tagged_Full;
                    Value  : in Boolean);

   type Untagged_Partial_Tagged_Full is private;
   procedure Change (Object : in out Untagged_Partial_Tagged_Full;
                    Value  : in Integer);

   type Untagged_Partial_Untagged_Full is private;
   procedure Change (Object : in out Untagged_Partial_Untagged_Full;
                    Value  : in Duration);

private

   type Tagged_Partial_Tagged_Full is
      tagged record
         B : Boolean := True;
         C : Character := ' ';
      end record;
   -- predefined equality checks that all components are equal

   function "=" (L, R : in Tagged_Partial_Tagged_Full) return Boolean;
   -- primitive equality checks that records equate in component C only

   type Untagged_Partial_Tagged_Full is
      tagged record
         I : Integer := 0;
         P : Positive := 1;
      end record;
   -- predefined equality checks that all components are equal

   function "=" (L, R : in Untagged_Partial_Tagged_Full) return Boolean;
   -- primitive equality checks that records equate in component P only

   type Untagged_Partial_Untagged_Full is
      record
         D : Duration := 0.0;
         S : String (1..12) := "Ada 9X rules";
      end record;
   -- predefined equality checks that all components are equal

   function "=" (L, R : in Untagged_Partial_Untagged_Full) return Boolean;
   -- primitive equality checks that records equate in component S only

end C452001_3;
   
with Report;
package body C452001_3 is

   procedure Change (Object : in out Tagged_Partial_Tagged_Full;
                    Value  : in Boolean) is
   begin
      Object := (Report.Ident_Bool(Value), Object.C);
   end Change;

   procedure Change (Object : in out Untagged_Partial_Tagged_Full;
                    Value  : in Integer) is
   begin
      Object := (Report.Ident_Int(Value), Object.P);
   end Change;

   procedure Change (Object : in out Untagged_Partial_Untagged_Full;
                    Value  : in Duration) is
   begin
      Object := (Value, Report.Ident_Str(Object.S));
   end Change;

   function "=" (L, R : in Tagged_Partial_Tagged_Full) return Boolean is
   begin
      return L.C = R.C;
   end "=";

   function "=" (L, R : in Untagged_Partial_Tagged_Full) return Boolean is
   begin
      return L.P = R.P;
   end "=";

   function "=" (L, R : in Untagged_Partial_Untagged_Full) return Boolean is
   begin
      return R.S = L.S;
   end "=";

end C452001_3;


with C452001_0;
with C452001_1;
with C452001_2;
with C452001_3;
with Report;
procedure C452001 is

   Mars_Aphelion : C452001_1.Planet :=
      (Name           => "Mars           ",
       Representation => (Center => (Report.Ident_Int(20),
                                     Report.Ident_Int(0)),
                          Radius => Report.Ident_Int(4),
                          Color  => C452001_0.Red));

   Mars_Perihelion : C452001_1.Planet :=
      (Name           => "Mars           ",
       Representation => (Center => (Report.Ident_Int(-20),
                                     Report.Ident_Int(0)),
                          Radius => Report.Ident_Int(4),
                          Color  => C452001_0.Red));

   -- Mars_Perihelion = Mars_Aphelion if user-defined equality from
   -- the tagged type Colored_Circle was incorporated into
   -- predefined equality for the tagged type Planet. User-defined
   -- equality for Colored_Circle checks only that the Radii are equal.

   Blue_Mars : C452001_1.Planet :=
      (Name           => "Mars           ",
       Representation => (Center => (Report.Ident_Int(10),
                                     Report.Ident_Int(10)),
                          Radius => Report.Ident_Int(4),
                          Color  => C452001_0.Blue));

   -- Blue_Mars should equal Mars_Perihelion, because Names and
   -- Radii are equal (all other components are not).

   Green_Mars : C452001_1.Planet :=
      (Name           => "Mars           ",
       Representation => (Center => (Report.Ident_Int(10),
                                     Report.Ident_Int(10)),
                          Radius => Report.Ident_Int(4),
                          Color  => C452001_0.Green));

   -- Blue_Mars should equal Green_Mars. They differ only in the
   -- Color component. All user-defined equality operations return
   -- True, but records are not equal by predefined equality.

   -- Blue_Mars should equal Mars_Perihelion, because Names and
   -- Radii are equal (all other components are not).

   Moon_Craters : C452001_1.Craters :=
      ((Center => (Report.Ident_Int(9), Report.Ident_Int(11)),
        Radius => Report.Ident_Int(1),
        Color  => C452001_0.Black),
       (Center => (Report.Ident_Int(10), Report.Ident_Int(10)),
        Radius => Report.Ident_Int(1),
        Color  => C452001_0.Black),
       (Center => (Report.Ident_Int(11), Report.Ident_Int(9)),
        Radius => Report.Ident_Int(1),
        Color  => C452001_0.Black));

   Alternate_Moon_Craters : C452001_1.Craters :=
      ((Center => (Report.Ident_Int(9), Report.Ident_Int(9)),
        Radius => Report.Ident_Int(1),
        Color  => C452001_0.Yellow),
       (Center => (Report.Ident_Int(10), Report.Ident_Int(10)),
        Radius => Report.Ident_Int(1),
        Color  => C452001_0.Purple),
       (Center => (Report.Ident_Int(11), Report.Ident_Int(11)),
        Radius => Report.Ident_Int(1),
        Color  => C452001_0.Purple));

   -- Moon_Craters = Alternate_Moon_Craters if user-defined equality from
   -- the tagged type Colored_Circle was incorporated into
   -- predefined equality for the untagged type Craters. User-defined
   -- equality checks only that the Radii are equal.

   New_Moon : C452001_1.Moon := 
      (Name           => "Moon           ",
       Representation => (Center => (Report.Ident_Int(10),
                                     Report.Ident_Int(8)),
                          Radius => Report.Ident_Int(3),
                          Color  => C452001_0.Black),
       Crater         => Moon_Craters);

   Full_Moon : C452001_1.Moon := 
      (Name           => "Moon           ",
       Representation => (Center => (Report.Ident_Int(10),
                                     Report.Ident_Int(8)),
                          Radius => Report.Ident_Int(3),
                          Color  => C452001_0.Black),
       Crater         => Alternate_Moon_Craters);

   -- New_Moon = Full_Moon if user-defined equality from
   -- the tagged type Colored_Circle was incorporated into
   -- predefined equality for the untagged type Craters. This
   -- equality test should call user-defined equality for type
   -- TC_Planet (checks that Names are equal), then predefined
   -- equality for Craters (ultimately calls user-defined equality
   -- for type Circle, checking that Radii of craters are equal).

   Mars_Moon : C452001_1.Moon := 
      (Name           => "Phobos         ",
       Representation => (Center => (Report.Ident_Int(10),
                                     Report.Ident_Int(8)),
                          Radius => Report.Ident_Int(3),
                          Color  => C452001_0.Black),
       Crater         => Alternate_Moon_Craters);

   -- Mars_Moon /= Full_Moon since the Names differ.

   Alternate_Moon_Craters_2 : C452001_1.Craters :=
      ((Center => (Report.Ident_Int(10), Report.Ident_Int(10)),
        Radius => Report.Ident_Int(1),
        Color  => C452001_0.Red),
       (Center => (Report.Ident_Int(9), Report.Ident_Int(9)),
        Radius => Report.Ident_Int(1),
        Color  => C452001_0.Red),
       (Center => (Report.Ident_Int(10), Report.Ident_Int(9)),
        Radius => Report.Ident_Int(1),
        Color  => C452001_0.Red));

   Harvest_Moon : C452001_1.Moon := 
      (Name           => "Moon           ",
       Representation => (Center => (Report.Ident_Int(11),
                                     Report.Ident_Int(7)),
                          Radius => Report.Ident_Int(4),
                          Color  => C452001_0.Orange),
       Crater         => Alternate_Moon_Craters_2);

   -- Only the fields that are employed by the user-defined equality
   -- operators are the same. Everything else differs. Equality should
   -- still return True.

   Viking_1_Orbiter : C452001_2.Mission :=
      (Craft => (Design      => C452001_2.Viking,
                 Operational => Report.Ident_Bool(False)),
       Launch_Date => 1975);

   Viking_1_Lander : C452001_2.Mission :=
      (Craft => (Design      => C452001_2.Viking,
                 Operational => Report.Ident_Bool(True)),
       Launch_Date => 1975);

   -- Viking_1_Orbiter /= Viking_1_Lander if predefined equality
   -- from the untagged type Spacecraft is used for equality
   -- of matching components in type Mission. If user-defined
   -- equality for type Spacecraft is incorporated, which it
   -- should not be by 4.5.2(21), then Viking_1_Orbiter = Viking_1_Lander.
   
   Voyagers : C452001_2.Inventory (1..2):=
    ((C452001_2.Voyager, Operational => Report.Ident_Bool(True)),
     (C452001_2.Voyager, Operational => Report.Ident_Bool(False)));

   Jupiter_Craft : C452001_2.Inventory (1..2):=
    ((C452001_2.Voyager, Operational => Report.Ident_Bool(True)),
     (C452001_2.Voyager, Operational => Report.Ident_Bool(True)));
   
   -- Voyagers /= Jupiter_Craft if predefined equality
   -- from the untagged type Spacecraft is used for equality
   -- of matching components in type Inventory. If user-defined
   -- equality for type Spacecraft is incorporated, which it
   -- should not be by 4.5.2(21), then Voyagers = Jupiter_Craft.

   TPTF_1 : C452001_3.Tagged_Partial_Tagged_Full;
   TPTF_2 : C452001_3.Tagged_Partial_Tagged_Full;
   
   -- With differing values for Boolean component, user-defined
   -- (primitive) equality returns True, predefined equality
   -- returns False. Since full type is tagged, primitive equality
   -- should be used.

   UPTF_1 : C452001_3.Untagged_Partial_Tagged_Full;
   UPTF_2 : C452001_3.Untagged_Partial_Tagged_Full;

   -- With differing values for Boolean component, user-defined
   -- (primitive) equality returns True, predefined equality
   -- returns False. Since full type is tagged, primitive equality
   -- should be used.

   UPUF_1 : C452001_3.Untagged_Partial_Untagged_Full;
   UPUF_2 : C452001_3.Untagged_Partial_Untagged_Full;

   -- With differing values for Duration component, user-defined
   -- (primitive) equality returns True, predefined equality
   -- returns False. Since full type is untagged, predefined equality
   -- should be used.

   -- Use type clauses make "=" and "/=" operators directly visible
   use type C452001_1.Planet;
   use type C452001_1.Craters;
   use type C452001_1.Moon;
   use type C452001_2.Mission;
   use type C452001_2.Inventory;
   use type C452001_3.Tagged_Partial_Tagged_Full;
   use type C452001_3.Untagged_Partial_Tagged_Full;
   use type C452001_3.Untagged_Partial_Untagged_Full;

begin

   Report.Test ("C452001", "Equality of private types and " &
                           "composite types with tagged components");

   -------------------------------------------------------------------
   -- Tagged type with tagged component.
   -------------------------------------------------------------------

   if not (Mars_Aphelion = Mars_Perihelion) then
      Report.Failed ("User-defined equality for tagged component " &
                     "was not incorporated into predefined equality " &
                     "for enclosing tagged record type");
   end if;

   if Mars_Aphelion /= Mars_Perihelion then
      Report.Failed ("User-defined equality for tagged component " &
                     "was not incorporated into predefined inequality " &
                     "for enclosing tagged record type");
   end if;

   if not (Blue_Mars = Mars_Perihelion) then
      Report.Failed ("Equality test for tagged record type " &
                     "incorporates record components " &
                     "other than those used by user-defined equality");
   end if;

   if Blue_Mars /= Mars_Perihelion then
      Report.Failed ("Inequality test for tagged record type " &
                     "incorporates record components " &
                     "other than those used by user-defined equality");
   end if;

   if Blue_Mars /= Green_Mars then
      Report.Failed ("Records are unequal even though they only differ " &
                     "in a component not used by user-defined equality");
   end if;

   if not (Blue_Mars = Green_Mars) then
      Report.Failed ("Records are not equal even though they only differ " &
                     "in a component not used by user-defined equality");
   end if;

   -------------------------------------------------------------------
   -- Untagged (array) type with tagged component.
   -------------------------------------------------------------------

   if not (Moon_Craters = Alternate_Moon_Craters) then
      Report.Failed ("User-defined equality for tagged component " &
                     "was not incorporated into predefined equality " &
                     "for enclosing array type");
   end if;

   if Moon_Craters /= Alternate_Moon_Craters then
      Report.Failed ("User-defined equality for tagged component " &
                     "was not incorporated into predefined inequality " &
                     "for enclosing array type");
   end if;

   -------------------------------------------------------------------
   -- Tagged type with untagged composite component. Untagged
   -- component itself has tagged components.
   -------------------------------------------------------------------
   if not (New_Moon = Full_Moon) then
      Report.Failed ("User-defined equality for tagged component " &
                     "was not incorporated into predefined equality " &
                     "for array component of tagged record type");
   end if;

   if New_Moon /= Full_Moon then
      Report.Failed ("User-defined equality for tagged component " &
                     "was not incorporated into predefined inequality " &
                     "for array component of tagged record type");
   end if;

   if Mars_Moon = Full_Moon then
      Report.Failed ("User-defined equality for tagged component " &
                     "was not incorporated into predefined equality " &
                     "for array component of tagged record type");
   end if;

   if not (Mars_Moon /= Full_Moon) then
      Report.Failed ("User-defined equality for tagged component " &
                     "was not incorporated into predefined inequality " &
                     "for array component of tagged record type");
   end if;

   if not (Harvest_Moon = Full_Moon) then
      Report.Failed ("Equality test for record with array of tagged " &
                     "components incorporates record components " &
                     "other than those used by user-defined equality");
   end if;

   if Harvest_Moon /= Full_Moon then
      Report.Failed ("Inequality test for record with array of tagged " &
                     "components incorporates record components " &
                     "other than those used by user-defined equality");
   end if;

   -------------------------------------------------------------------
   -- Untagged types with no tagged components.
   -------------------------------------------------------------------

   -- Record type

   if Viking_1_Orbiter = Viking_1_Lander then
      Report.Failed ("User-defined equality for untagged composite " &
                     "component was incorporated into predefined " &
                     "equality for " &
                     "untagged record type");
   end if;

   if not (Viking_1_Orbiter /= Viking_1_Lander) then
      Report.Failed ("User-defined equality for untagged composite " &
                     "component was incorporated into predefined " &
                     "inequality for " &
                     "untagged record type");
   end if;

   -- Array type
   
   if Voyagers = Jupiter_Craft then
      Report.Failed ("User-defined equality for untagged composite " &
                     "component was incorporated into predefined " &
                     "equality for " &
                     "array type");
   end if;

   if not (Voyagers /= Jupiter_Craft) then
      Report.Failed ("User-defined equality for untagged composite " &
                     "component was incorporated into predefined " &
                     "inequality for " &
                     "array type");
   end if;

   -------------------------------------------------------------------
   -- Private types tests.
   -------------------------------------------------------------------

   -- Make objects differ from one another

   C452001_3.Change (TPTF_1, False);
   C452001_3.Change (UPTF_1, 999);
   C452001_3.Change (UPUF_1, 40.0);

   -------------------------------------------------------------------
   -- Partial type and full type are tagged. (Full type must be tagged
   -- if partial type is tagged)
   -------------------------------------------------------------------

   if not (TPTF_1 = TPTF_2) then
      Report.Failed ("Predefined equality for full type " &
                     "was used to determine equality of " &
                     "tagged private type " &
                     "instead of user-defined (primitive) equality");
   end if;

   if TPTF_1 /= TPTF_2 then
      Report.Failed ("Predefined equality for full type " &
                     "was used to determine inequality of " &
                     "tagged private type " &
                     "instead of user-defined (primitive) equality");
   end if;

   -------------------------------------------------------------------
   -- Partial type untagged, full type tagged.
   -------------------------------------------------------------------

   if not (UPTF_1 = UPTF_2) then
      Report.Failed ("Predefined equality for full type " &
                     "was used to determine equality of " &
                     "private type (untagged partial view, " &
                     "tagged full view) " &
                     "instead of user-defined (primitive) equality");
   end if;

   if UPTF_1 /= UPTF_2 then
      Report.Failed ("Predefined equality for full type " &
                     "was used to determine inequality of " &
                     "private type (untagged partial view, " &
                     "tagged full view) " &
                     "instead of user-defined (primitive) equality");
   end if;

   -------------------------------------------------------------------
   -- Partial type and full type are both untagged.
   -------------------------------------------------------------------

   if UPUF_1 = UPUF_2 then
      Report.Failed ("User-defined (primitive) equality for full type " &
                     "was used to determine equality of " &
                     "private type (untagged partial view, " &
                     "untagged full view) " &
                     "instead of predefined equality");
   end if;

   if not (UPUF_1 /= UPUF_2) then
      Report.Failed ("User-defined (primitive) equality for full type " &
                     "was used to determine inequality of " &
                     "private type (untagged partial view, " &
                     "untagged full view) " &
                     "instead of predefined equality");
   end if;

   -------------------------------------------------------------------
   Report.Result;

end C452001;