Hi,
This patch is a follow-up fix for PR d/89255, as any unittest
functions registered against the testing module when compiling with
-fbuilding-libphobos-tests are ignored during the generation of the
ModuleInfo data.
Regression tested on x86_64-linux-gnu.
Committed to trunk as r270477.
--
Iain
---
gcc/d/ChangeLog:
2019-04-21 Iain Buclaw <[email protected]>
* modules.cc (register_module_decl): Don't register unittests against
the ModuleInfo symbol for -fbuilding-libphobos-tests.
---
diff --git a/gcc/d/modules.cc b/gcc/d/modules.cc
index 315f5d82356..35050c8e17a 100644
--- a/gcc/d/modules.cc
+++ b/gcc/d/modules.cc
@@ -836,7 +836,8 @@ register_module_decl (Declaration *d)
compiling in unittests are kept track of separately so they are
not omitted when compiling with -fbuilding-libphobos-tests. */
module_info *minfo;
- if (flag_building_libphobos_tests && DECL_IN_UNITTEST_CONDITION_P (decl))
+ if (flag_building_libphobos_tests && !fd->isUnitTestDeclaration ()
+ && DECL_IN_UNITTEST_CONDITION_P (decl))
minfo = current_testing_module;
else
minfo = current_moduleinfo;