[clang] [clang-cl][test] Use /Zs to avoid writing unnecessary output files (PR #204501)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 17 19:03:47 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Jordan Rupprecht (rupprecht)
<details>
<summary>Changes</summary>
#<!-- -->194779 adds a test clang/test/Preprocessor/init-datetime-macros.c which verifies some diagnostics. However, it does so with `/c`, which will unnecessarily generate an output, and when run on a build system that does not run tests in a writeable dir by default, will cause the test to fail.
Since we don't care about the resulting object file, use `/Zs` (equivalent of `-fsyntax-only`) to check the diagnostics but not produce any output files.
---
Full diff: https://github.com/llvm/llvm-project/pull/204501.diff
1 Files Affected:
- (modified) clang/test/Preprocessor/init-datetime-macros.c (+1-1)
``````````diff
diff --git a/clang/test/Preprocessor/init-datetime-macros.c b/clang/test/Preprocessor/init-datetime-macros.c
index 239bafd2b241e..685cbdd617314 100644
--- a/clang/test/Preprocessor/init-datetime-macros.c
+++ b/clang/test/Preprocessor/init-datetime-macros.c
@@ -27,7 +27,7 @@
// /d1nodatetime - undefines __DATE__, __TIME__ and __TIMESTAMP__
// /Brepro - sets __DATE__, __TIME__ and __TIMESTAMP__ to "1"
-// RUN: %clang_cl -Xclang -verify /d1nodatetime /DDATETIME_UNDEFINED /c -- %s
+// RUN: %clang_cl -Xclang -verify /d1nodatetime /DDATETIME_UNDEFINED /Zs -- %s
// RUN: %clang_cl -E /Brepro /DDATETIME_LITERALONE -- %s | FileCheck %s --check-prefix CHECK-INIT-DATETIME-LITERALONE
``````````
</details>
https://github.com/llvm/llvm-project/pull/204501
More information about the cfe-commits
mailing list