[clang] [Clang-CL][DXC] Expose -fdiagnostic-color= to clang-cl and clang-dxc (PR #120644)
Mészáros Gergely via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 20 03:05:26 PST 2024
================
@@ -664,6 +664,15 @@
// RUN: not %clang_cl /guard:foo -### -- %s 2>&1 | FileCheck -check-prefix=CFGUARDINVALID %s
// CFGUARDINVALID: invalid value 'foo' in '/guard:'
+// The test doesn't run in a PTY, so "auto" defaults to off.
+// RUN: %clang_cl -fdiagnostics-color=auto -### -- %s 2>&1 | FileCheck -check-prefix=NO_COLOR %s
+
+// RUN: %clang_cl -fdiagnostics-color -### -- %s 2>&1 | FileCheck -check-prefix=COLOR %s
+// RUN: %clang_cl -fdiagnostics-color=always -### -- %s 2>&1 | FileCheck -check-prefix=COLOR %s
+// RUN: %clang_cl -fdiagnostics-color=never -### -- %s 2>&1 | FileCheck -check-prefix=NO_COLOR %s
+// COLOR: "-fcolor-diagnostics"
----------------
Maetveis wrote:
I think you should instead add `-fcolor-diagnostics=auto` to the list below, no need to check the functionality again in clang-cl, it is already sufficiently tested IMO by [clang/test/Driver/color-diagnostics.c](https://github.com/llvm/llvm-project/blob/2405c5fb3ed49b928bb2816ace7b67c8979cd9d7/clang/test/Driver/color-diagnostics.c)
```diff
// RUN: -fno-coverage-mapping \
// RUN: -fdiagnostics-color \
+// RUN: -fdiagnostics-color=auto \
// RUN: -fno-diagnostics-color \
// RUN: -fdebug-compilation-dir . \
// RUN: -fdebug-compilation-dir=. \
// RUN: -ffile-compilation-dir=. \
```
https://github.com/llvm/llvm-project/pull/120644
More information about the cfe-commits
mailing list