[clang] [Clang][Driver] Fix inverted diagnostic condition (PR #225640)

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 23 23:50:27 PDT 2026


================
@@ -0,0 +1,15 @@
+// Regression test for a condition inversion bug that caused
+// warn_drv_preprocessed_input_file_unused to never mention which option
+// determined the final compilation phase.
+
+// RUN: %clang -E %S/Inputs/preprocessed-input-file-unused.i -o /dev/null 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-E %s
+// CHECK-E: warning: {{.*}}preprocessed-input-file-unused.i: previously preprocessed input unused when 'E' is present [-Wunused-command-line-argument]
+
+// RUN: %clang -M %S/Inputs/preprocessed-input-file-unused.i -o /dev/null 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-M %s
+// CHECK-M: warning: {{.*}}preprocessed-input-file-unused.i: previously preprocessed input unused when 'M' is present [-Wunused-command-line-argument]
+
+// RUN: %clang -MM %S/Inputs/preprocessed-input-file-unused.i -o /dev/null 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-MM %s
+// CHECK-MM: warning: {{.*}}preprocessed-input-file-unused.i: previously preprocessed input unused when 'MM' is present [-Wunused-command-line-argument]
----------------
nico wrote:

Do we have test coverage for when `!FinalPhase`?

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


More information about the cfe-commits mailing list