public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Colon is reserved on Windows
@ 2022-09-30  8:18 Torbjörn SVENSSON
  2022-09-30 11:12 ` Nathan Sidwell
  0 siblings, 1 reply; 2+ messages in thread
From: Torbjörn SVENSSON @ 2022-09-30  8:18 UTC (permalink / raw)
  To: gcc-patches; +Cc: nathan, jwakely, Torbjörn SVENSSON, Yvan ROUX

The ':' is reserved in filenames on Windows.
Can't find any specification for this, but when there is no filename
defined in the map file, GCC will replace the ':' with a '-' in the
generated filename for the module.

Without this patch, the test case failes with:
.../ben-1_a.C:4:8: error: failed to write compiled module: Invalid argument
.../ben-1_a.C:4:8: note: compiled module file is 'partitions/module:import.mod'

gcc/testsuite:

	* g++.dg/modules/ben-1.map: Replace the colon with dash.
	* g++.dg/modules/ben-1_a.C: Likewise

Co-Authored-By: Yvan ROUX  <yvan.roux@foss.st.com>
Signed-off-by: Torbjörn SVENSSON  <torbjorn.svensson@foss.st.com>
---
 gcc/testsuite/g++.dg/modules/ben-1.map | 2 +-
 gcc/testsuite/g++.dg/modules/ben-1_a.C | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/g++.dg/modules/ben-1.map b/gcc/testsuite/g++.dg/modules/ben-1.map
index 182183ad089..ad84c11397d 100644
--- a/gcc/testsuite/g++.dg/modules/ben-1.map
+++ b/gcc/testsuite/g++.dg/modules/ben-1.map
@@ -1,3 +1,3 @@
 $root .
-module:import partitions/module:import.mod
+module:import partitions/module-import.mod
 module module.mod
diff --git a/gcc/testsuite/g++.dg/modules/ben-1_a.C b/gcc/testsuite/g++.dg/modules/ben-1_a.C
index 7e9b5661026..f1562eb2c5a 100644
--- a/gcc/testsuite/g++.dg/modules/ben-1_a.C
+++ b/gcc/testsuite/g++.dg/modules/ben-1_a.C
@@ -2,7 +2,7 @@
 // { dg-additional-files ben-1.map }
 
 export module module:import;
-// { dg-module-cmi =partitions/module:import.mod }
+// { dg-module-cmi =partitions/module-import.mod }
 
 export int b() {
   return 0;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] testsuite: Colon is reserved on Windows
  2022-09-30  8:18 [PATCH] testsuite: Colon is reserved on Windows Torbjörn SVENSSON
@ 2022-09-30 11:12 ` Nathan Sidwell
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Sidwell @ 2022-09-30 11:12 UTC (permalink / raw)
  To: Torbjörn SVENSSON, gcc-patches; +Cc: jwakely, Yvan ROUX

On 9/30/22 04:18, Torbjörn SVENSSON wrote:
> The ':' is reserved in filenames on Windows.
> Can't find any specification for this, but when there is no filename
> defined in the map file, GCC will replace the ':' with a '-' in the
> generated filename for the module.

Correct (and the specification is in the source code, there's no 
requirement for any particular mapping, bu I was at least cognizant of 
windows' dislike of : :)

> 
> Without this patch, the test case failes with:
> .../ben-1_a.C:4:8: error: failed to write compiled module: Invalid argument
> .../ben-1_a.C:4:8: note: compiled module file is 'partitions/module:import.mod'
> 
> gcc/testsuite:
> 
> 	* g++.dg/modules/ben-1.map: Replace the colon with dash.
> 	* g++.dg/modules/ben-1_a.C: Likewise

ok, thanks

> 
> Co-Authored-By: Yvan ROUX  <yvan.roux@foss.st.com>
> Signed-off-by: Torbjörn SVENSSON  <torbjorn.svensson@foss.st.com>
> ---
>   gcc/testsuite/g++.dg/modules/ben-1.map | 2 +-
>   gcc/testsuite/g++.dg/modules/ben-1_a.C | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/testsuite/g++.dg/modules/ben-1.map b/gcc/testsuite/g++.dg/modules/ben-1.map
> index 182183ad089..ad84c11397d 100644
> --- a/gcc/testsuite/g++.dg/modules/ben-1.map
> +++ b/gcc/testsuite/g++.dg/modules/ben-1.map
> @@ -1,3 +1,3 @@
>   $root .
> -module:import partitions/module:import.mod
> +module:import partitions/module-import.mod
>   module module.mod
> diff --git a/gcc/testsuite/g++.dg/modules/ben-1_a.C b/gcc/testsuite/g++.dg/modules/ben-1_a.C
> index 7e9b5661026..f1562eb2c5a 100644
> --- a/gcc/testsuite/g++.dg/modules/ben-1_a.C
> +++ b/gcc/testsuite/g++.dg/modules/ben-1_a.C
> @@ -2,7 +2,7 @@
>   // { dg-additional-files ben-1.map }
>   
>   export module module:import;
> -// { dg-module-cmi =partitions/module:import.mod }
> +// { dg-module-cmi =partitions/module-import.mod }
>   
>   export int b() {
>     return 0;

-- 
Nathan Sidwell


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-30 11:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-30  8:18 [PATCH] testsuite: Colon is reserved on Windows Torbjörn SVENSSON
2022-09-30 11:12 ` Nathan Sidwell

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).