d: Ensure all unittests are registered against the original module.
authorIain Buclaw <ibuclaw@gdcproject.org>
Sun, 21 Apr 2019 07:03:22 +0000 (07:03 +0000)
committerIain Buclaw <ibuclaw@gcc.gnu.org>
Sun, 21 Apr 2019 07:03:22 +0000 (07:03 +0000)
As any unittest functions registered against the testing module when
compiling with -fbuilding-libphobos-tests are ignored during the
generation of the ModuleInfo data.

gcc/d/ChangeLog:

2019-04-21  Iain Buclaw  <ibuclaw@gdcproject.org>

* modules.cc (register_module_decl): Don't register unittests against
the ModuleInfo symbol for -fbuilding-libphobos-tests.

From-SVN: r270477

gcc/d/ChangeLog
gcc/d/modules.cc

index 5a622af34a2c9aa27b03b40512aa1c6e9e43c636..48fc9c69b4f352f855eb9fcffc1ba30380577b76 100644 (file)
@@ -1,3 +1,8 @@
+2019-04-21  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       * modules.cc (register_module_decl): Don't register unittests against
+       the ModuleInfo symbol for -fbuilding-libphobos-tests.
+
 2019-04-17  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        * d-system.h (POSIX): Define unix as POSIX.
index 315f5d82356a3818cb77c8e891b96d449f99f23f..35050c8e17a1a91cc347d2d473c4bc8304fc6026 100644 (file)
@@ -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;