[Ada] Fix binding of ghost units with finalizer
authorYannick Moy <moy@adacore.com>
Tue, 23 Jul 2019 08:13:01 +0000 (08:13 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 23 Jul 2019 08:13:01 +0000 (08:13 +0000)
commit39c20502ef7398766a8c9520c4210c2df9769d15
tree0df1c95911c37142af392c2da93d5aac8422b887
parent58b8c5a87b0bac61bb88e802fc742fdc0d3e6699
[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  <moy@adacore.com>

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/ada/ChangeLog
gcc/ada/exp_ch7.adb
gcc/ada/exp_dbug.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/ghost6.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/ghost6_pkg.ads [new file with mode: 0644]