From 39c20502ef7398766a8c9520c4210c2df9769d15 Mon Sep 17 00:00:00 2001 From: Yannick Moy Date: Tue, 23 Jul 2019 08:13:01 +0000 Subject: [Ada] Fix binding of ghost units with finalizer Linking of an enabled ghost unit which requires a finalizer lead to an error, as the name generated by the binder for calling the finalizer was not the same as the name chosen by the compiler. Now fixed. 2019-07-23 Yannick Moy gcc/ada/ * exp_ch7.adb (Create_Finalizer): Force finalizer not to be Ghost enabled. * exp_dbug.adb (Get_External_Name): Explain special case of Ghost finalizer. gcc/testsuite/ * gnat.dg/ghost6.adb, gnat.dg/ghost6_pkg.ads: New testcase. From-SVN: r273720 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gnat.dg/ghost6.adb | 10 ++++++++++ gcc/testsuite/gnat.dg/ghost6_pkg.ads | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/gnat.dg/ghost6.adb create mode 100644 gcc/testsuite/gnat.dg/ghost6_pkg.ads (limited to 'gcc/testsuite') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2b3e477..0ef05dd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-07-23 Yannick Moy + + * gnat.dg/ghost6.adb, gnat.dg/ghost6_pkg.ads: New testcase. + 2019-07-22 Sylvia Taylor * gcc.target/aarch64/simd/ssra.c: New test. diff --git a/gcc/testsuite/gnat.dg/ghost6.adb b/gcc/testsuite/gnat.dg/ghost6.adb new file mode 100644 index 0000000..01a2417 --- /dev/null +++ b/gcc/testsuite/gnat.dg/ghost6.adb @@ -0,0 +1,10 @@ +-- { dg-do link } +-- { dg-options "-gnata -g" } + +with Ghost6_Pkg; + +procedure Ghost6 is + X : Ghost6_Pkg.T with Ghost; +begin + null; +end Ghost6; diff --git a/gcc/testsuite/gnat.dg/ghost6_pkg.ads b/gcc/testsuite/gnat.dg/ghost6_pkg.ads new file mode 100644 index 0000000..7fbd942 --- /dev/null +++ b/gcc/testsuite/gnat.dg/ghost6_pkg.ads @@ -0,0 +1,7 @@ +with Ada.Finalization; + +package Ghost6_Pkg with + Ghost +is + type T is new Ada.Finalization.Controlled with null record; +end Ghost6_Pkg; -- cgit v1.1