[clang] [clang][Driver] Don't let -save-temps overwrite the input file (PR #235413)
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Sun Oct 25 10:48:19 PDT 2026
================
@@ -0,0 +1,26 @@
+// Check that -save-temps doesn't name an intermediate file after the input
+// file, which would overwrite it. On Darwin, a .s file is preprocessed, and
+// the preprocessed output's name ends in .s.
+
+// RUN: rm -rf %t && mkdir -p %t/sub %t/obj
+// RUN: touch %t/t.s %t/sub/t.s
+
+// The output would be the input in the current directory.
+// RUN: cd %t && %clang --target=x86_64-apple-darwin -c -save-temps t.s -### 2>&1 \
----------------
MaskRay wrote:
If `cd %t &&` is dropped, no need to wrap the line. Agents really like to wrap test files where we don't enforce the 80-column rule.
https://github.com/llvm/llvm-project/pull/235413
More information about the cfe-commits
mailing list