From e94a83856fa29fc559ab6bfe013ea6cf16f401fa Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 26 May 2008 13:46:21 +0000 Subject: [PATCH] * gnat.dg/pak.ad[sb]: New test. From-SVN: r135926 --- gcc/testsuite/ChangeLog | 1 + gcc/testsuite/gnat.dg/pak.adb | 15 +++++++++++++++ gcc/testsuite/gnat.dg/pak.ads | 7 +++++++ 3 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/gnat.dg/pak.adb create mode 100644 gcc/testsuite/gnat.dg/pak.ads diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 156ea63a396..5f0d17b26ab 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -12,6 +12,7 @@ * gnat.dg/set_in_pproc.adb: New test. * gnat.dg/modular2.adb: New test. + * gnat.dg/pak.ad[sb]: New test. 2008-05-25 Eric Botcazou diff --git a/gcc/testsuite/gnat.dg/pak.adb b/gcc/testsuite/gnat.dg/pak.adb new file mode 100644 index 00000000000..0430482f358 --- /dev/null +++ b/gcc/testsuite/gnat.dg/pak.adb @@ -0,0 +1,15 @@ +-- { dg-do compile } +package body Pak is + pragma Suppress (Discriminant_Check); + -- Suppress discriminant check to prevent the assignment from using + -- the predefined primitive _assign. + + procedure Initialize (X : in out T) is begin null; end Initialize; + procedure Finalize (X : in out T) is begin null; end Finalize; + + procedure Assign (X : out T'Class) is + Y : T; + begin + T (X) := Y; + end Assign; +end Pak; diff --git a/gcc/testsuite/gnat.dg/pak.ads b/gcc/testsuite/gnat.dg/pak.ads new file mode 100644 index 00000000000..e1e2d0d4d63 --- /dev/null +++ b/gcc/testsuite/gnat.dg/pak.ads @@ -0,0 +1,7 @@ +with Ada.Finalization; +package Pak is + type T is new Ada.Finalization.Controlled with null record; + procedure Initialize (X : in out T); + procedure Finalize (X : in out T); + procedure Assign (X : out T'Class); +end Pak; -- 2.30.2