https://gcc.gnu.org/g:c2ad32446c8e137c57cbb1c9c65a8b739712dd52

commit r16-8887-gc2ad32446c8e137c57cbb1c9c65a8b739712dd52
Author: Torbjörn SVENSSON <[email protected]>
Date:   Wed Apr 8 13:33:37 2026 +0200

    testsuite: munge absolute paths like compiler do on Windows
    
    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 <[email protected]>
    (cherry picked from commit 8e1592700071f00bb54f3d98538225b666a8a455)

Diff:
---
 gcc/testsuite/g++.dg/modules/modules.exp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.dg/modules/modules.exp 
b/gcc/testsuite/g++.dg/modules/modules.exp
index 2c7365db1cc5..aa351b73e0e6 100644
--- a/gcc/testsuite/g++.dg/modules/modules.exp
+++ b/gcc/testsuite/g++.dg/modules/modules.exp
@@ -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"

Reply via email to