public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nathan Sidwell <nathan@acm.org>
To: Jan Beulich <jbeulich@suse.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Jason Merrill <jason@redhat.com>,
	Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>,
	Mike Stump <mikestump@comcast.net>
Subject: Re: Ping: [PATCH] testsuite/C++: suppress filename canonicalization in module tests
Date: Thu, 27 Apr 2023 18:24:39 -0400	[thread overview]
Message-ID: <6a65e21d-b382-01bd-27ef-5d267f6b7ce5@acm.org> (raw)
In-Reply-To: <a94bf4be-99f8-2743-e224-1108219b1879@suse.com>

On 4/25/23 11:04, Jan Beulich wrote:
> On 28.06.2022 16:06, Jan Beulich wrote:
>> The pathname underneath gcm.cache/ is determined from the effective name
>> used for the main input file of a particular module. When modules are
>> built, no canonicalization occurs for the main input file. Hence the
>> module file wouldn't be found if a different (the canonicalized) file
>> name was used when importing that same module. (This is an effect of
>> importing happening in the preprocessor, just like #include handling.)
>>
>> Since it doesn't look easy to make module generation use libcpp's
>> maybe_shorter_path() (in fact I'd consider this a layering violation,
>> while cloning the logic would - at least in principle - be prone to both
>> going out of sync), simply suppress system header path canonicalization
>> for the respective tests.
> 
> Ping: This still looks to apply as is.

ok -- I was unaware of this.  might be sensible to file a defect about this?

> 
> Thanks, Jan
> 
>> ---
>> Strictly speaking it could be necessary to also suppress
>> canonicalization when generating the modules, but for now they're self-
>> contained, i.e. don't include any "real" system headers. IOW at the
>> moment the tests aren't susceptible to the issue at generation time.
>>
>> --- a/gcc/testsuite/g++.dg/modules/alias-1_b.C
>> +++ b/gcc/testsuite/g++.dg/modules/alias-1_b.C
>> @@ -1,4 +1,4 @@
>> -// { dg-additional-options "-fmodules-ts -fdump-lang-module -isystem [srcdir]" }
>> +// { dg-additional-options "-fmodules-ts -fdump-lang-module -isystem [srcdir] -fno-canonical-system-headers" }
>>   
>>   // Alias at the header file.  We have one CMI file
>>   import "alias-1_a.H";
>> --- a/gcc/testsuite/g++.dg/modules/alias-1_d.C
>> +++ b/gcc/testsuite/g++.dg/modules/alias-1_d.C
>> @@ -1,4 +1,4 @@
>> -// { dg-additional-options "-fmodules-ts -isystem [srcdir]" }
>> +// { dg-additional-options "-fmodules-ts -isystem [srcdir] -fno-canonical-system-headers" }
>>   // { dg-module-cmi kevin }
>>   
>>   export module kevin;
>> --- a/gcc/testsuite/g++.dg/modules/alias-1_e.C
>> +++ b/gcc/testsuite/g++.dg/modules/alias-1_e.C
>> @@ -1,4 +1,4 @@
>> -// { dg-additional-options "-fmodules-ts -isystem [srcdir]" }
>> +// { dg-additional-options "-fmodules-ts -isystem [srcdir] -fno-canonical-system-headers" }
>>   
>>   import bob;
>>   import kevin;
>> --- a/gcc/testsuite/g++.dg/modules/alias-1_f.C
>> +++ b/gcc/testsuite/g++.dg/modules/alias-1_f.C
>> @@ -1,4 +1,4 @@
>> -// { dg-additional-options "-fmodules-ts -fdump-lang-module -isystem [srcdir]" }
>> +// { dg-additional-options "-fmodules-ts -fdump-lang-module -isystem [srcdir] -fno-canonical-system-headers" }
>>   
>>   import kevin;
>>   import bob;
>> --- a/gcc/testsuite/g++.dg/modules/cpp-6_c.C
>> +++ b/gcc/testsuite/g++.dg/modules/cpp-6_c.C
>> @@ -1,5 +1,5 @@
>>   // { dg-do preprocess }
>> -// { dg-additional-options "-fmodules-ts -isystem [srcdir]" }
>> +// { dg-additional-options "-fmodules-ts -isystem [srcdir] -fno-canonical-system-headers" }
>>   
>>   #define empty
>>   #define nop(X) X
>> --- a/gcc/testsuite/g++.dg/modules/dir-only-2_b.C
>> +++ b/gcc/testsuite/g++.dg/modules/dir-only-2_b.C
>> @@ -1,5 +1,5 @@
>>   // { dg-do preprocess }
>> -// { dg-additional-options "-fmodules-ts -fdirectives-only -isystem [srcdir]" }
>> +// { dg-additional-options "-fmodules-ts -fdirectives-only -isystem [srcdir] -fno-canonical-system-headers" }
>>   // a comment
>>   module; // line
>>   frob
> 

-- 
Nathan Sidwell


  reply	other threads:[~2023-04-27 22:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 14:06 Jan Beulich
2023-04-25 15:04 ` Ping: " Jan Beulich
2023-04-27 22:24   ` Nathan Sidwell [this message]
2023-04-28  6:59     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a65e21d-b382-01bd-27ef-5d267f6b7ce5@acm.org \
    --to=nathan@acm.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=jbeulich@suse.com \
    --cc=mikestump@comcast.net \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).