]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: munge absolute paths like compiler do on Windows
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Wed, 8 Apr 2026 11:33:37 +0000 (13:33 +0200)
committerTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Fri, 8 May 2026 12:04:10 +0000 (14:04 +0200)
GCC munges absolute paths on Windows by replacing the colon with a dash.

gcc/testsuite/ChangeLog:

* g++.dg/modules/modules.exp: Replace colon with dash on
Windows.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
gcc/testsuite/g++.dg/modules/modules.exp

index 2c7365db1cc5749f7fc281fcda453856de0b37a7..aa351b73e0e61bbd72f7673df6f4abab5928a8f8 100644 (file)
@@ -83,7 +83,10 @@ proc host_header_path {hname} {
 
 # Return the pathname CMI munged like the compiler.
 proc munge_cmi {cmi} {
-    if { [string index $cmi 0] == "/" } {
+    if { [string index $cmi 1] == ":" && [info exists ::env(OS)] && [string match "Windows*" $::env(OS)] } {
+       # Windows paths like C:/some/path should be munged to C-/some/path
+       set cmi [string replace $cmi 1 1 "-"]
+    } elseif { [string index $cmi 0] == "/" } {
        set cmi [string range $cmi 1 end]
     } else {
        set cmi ",/$cmi"