From patchwork Sun Apr 21 07:13:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1088444 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-499516-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=gdcproject.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ArZfWi4P"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44n1DD2ygWz9s3l for ; Sun, 21 Apr 2019 17:14:12 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=Pc6j7CDINdXBtYHrv9MEuaHZLUjpng+FfyhzTcSzmDaMjG ec5g5jhNIPrSbddGj10+/ppb0Ihp+6gZvue8LcPgiiGoX3u0+nlnWhX+ncczqdqU NAn9rmbgDFiVUqf0pDbXesoaAiob9MCcQcTfAWjBK5pxh8B4Seh48YhyBDa3w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=2F39r2vkkrQa4sWxU3gfv+yEHiM=; b=ArZfWi4PkyMDHGHW9HuN XgEHGS6J9UIBSyHKPbHECGjaaJBsEmuGuI9CTi+WUxvwcx2qzxjWdHhpxDNI4iWI 8empRmsu0nKwM8uNSMyUTkh8CKek2CTAVvGmQtpCqInwTlzgPE5siKM92ICADbYO gyQ8LE00CqdC8hZfju0no1k= Received: (qmail 69115 invoked by alias); 21 Apr 2019 07:14:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 69102 invoked by uid 89); 21 Apr 2019 07:14:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Google-Smtp-Source:APXvYqz, HX-Received:Sun X-HELO: mail-qt1-f172.google.com Received: from mail-qt1-f172.google.com (HELO mail-qt1-f172.google.com) (209.85.160.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 21 Apr 2019 07:14:01 +0000 Received: by mail-qt1-f172.google.com with SMTP id i14so9270733qtr.10 for ; Sun, 21 Apr 2019 00:14:01 -0700 (PDT) MIME-Version: 1.0 From: Iain Buclaw Date: Sun, 21 Apr 2019 09:13:46 +0200 Message-ID: Subject: [PATCH, d] Committed ensure all unittests are registered against the original module. To: gcc-patches X-IsSubscribed: yes 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. 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;