]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite/C++: suppress filename canonicalization in module tests
authorJan Beulich <jbeulich@suse.com>
Fri, 28 Apr 2023 06:53:00 +0000 (08:53 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 28 Apr 2023 06:53:00 +0000 (08:53 +0200)
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.

gcc/testsuite/

* g++.dg/modules/alias-1_b.C: Add -fno-canonical-system-headers.
* g++.dg/modules/alias-1_d.C: Likewise.
* g++.dg/modules/alias-1_e.C: Likewise.
* g++.dg/modules/alias-1_f.C: Likewise.
* g++.dg/modules/cpp-6_c.C: Likewise.
* g++.dg/modules/dir-only-2_b.C: Likewise.

gcc/testsuite/g++.dg/modules/alias-1_b.C
gcc/testsuite/g++.dg/modules/alias-1_d.C
gcc/testsuite/g++.dg/modules/alias-1_e.C
gcc/testsuite/g++.dg/modules/alias-1_f.C
gcc/testsuite/g++.dg/modules/cpp-6_c.C
gcc/testsuite/g++.dg/modules/dir-only-2_b.C

index b3d7c2df3537c37e1961c98495e45c90c5b1d366..1a5c6aa85e6aa024ba8b17884e7b182f75582ca6 100644 (file)
@@ -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";
index 9b481e5b1852bea33c879ee8217a0e8e5cd1bea9..3ed74ee900619abb6ee8f142d5dfea485792ca2b 100644 (file)
@@ -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;
index 862ae32882f7ae3783a956d97a00c8e1220c850e..2abcb9b914256ace0b87fad8e88d8ff43c94219e 100644 (file)
@@ -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;
index 4c694d1a903d1ec9e81a87d362753623900a79ce..ac30a6b24e73adc7881a16c936e9714431c533fb 100644 (file)
@@ -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;
index f9b1e2d68b796c5858ef3cde5a0523d1391319e5..2a34bb87ee4be32e0954e9e07f55bf3adabd9e0a 100644 (file)
@@ -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
index 0691f76ae36f7fde7f74abd1ab152e0cc6fc820e..1009ae5b3a263b2038ec0004f282af2e8bf4c3a3 100644 (file)
@@ -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