[clang] [clang] Make test Driver/dragonfly.c pass when running with temp dir containing "crt" (PR #77861)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 11 17:40:38 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-driver

Author: None (dyung)

<details>
<summary>Changes</summary>

Previous commit 67aea3b fixed the test for paths with '/', expand it to include '\' to fix the same problem on Windows.

Our internal Windows builder hit the same issue that was previously fixed on linux, but on Windows since the temporary path that had generated contained 'crt':

```
"ld" "--eh-frame-hdr" "--hash-style=gnu" "--enable-new-dtags" "-o" "a.out" "-r" "-LC:\\j\\w\\779ddbee\\build\\bin/../lib" "-L/usr/lib" "-L/usr/lib/gcc80" "c:\\j\\w\\779ddbee\\temp\\lit-tmp-8crtk3__\\dragonfly-1efec1.o" "-r"
```

This change adds the Windows patch separator '\' to the list of disallowed characters to prevent the problem on Windows.

---
Full diff: https://github.com/llvm/llvm-project/pull/77861.diff


1 Files Affected:

- (modified) clang/test/Driver/dragonfly.c (+1-1) 


``````````diff
diff --git a/clang/test/Driver/dragonfly.c b/clang/test/Driver/dragonfly.c
index 931f23f6f57b5f..fb250fd8432526 100644
--- a/clang/test/Driver/dragonfly.c
+++ b/clang/test/Driver/dragonfly.c
@@ -25,7 +25,7 @@
 // RELOCATABLE:     "-r"
 // RELOCATABLE-NOT: "-dynamic-linker"
 // RELOCATABLE-NOT: "-l
-// RELOCATABLE-NOT: {{.*}}crt{{[^./]+}}.o
+// RELOCATABLE-NOT: {{.*}}crt{{[^./\\]+}}.o
 
 // Check that the new linker flags are passed to DragonFly
 // RUN: %clang --target=x86_64-unknown-dragonfly -s -t -### %s 2>&1 \

``````````

</details>


https://github.com/llvm/llvm-project/pull/77861


More information about the cfe-commits mailing list