[clang] [Clang][Driver] Warn about `-c/-S` with `-fsyntax-only` (PR #98607)

Dmitriy Chestnykh via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 14 23:37:17 PDT 2024


================
@@ -0,0 +1,9 @@
+// RUN: %clang -fsyntax-only -S %s 2>&1 | FileCheck %s --check-prefix=CHECK-ASM
+// RUN: %clang -fsyntax-only -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-OBJ
+// RUN: %clang -fsyntax-only -S -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-BOTH
+
+// CHECK-ASM: warning: argument unused during compilation: '-S' [-Wunused-command-line-argument]
+// CHECK-OBJ: warning: argument unused during compilation: '-c' [-Wunused-command-line-argument]
+
+// CHECK-BOTH: warning: argument unused during compilation: '-S' [-Wunused-command-line-argument]
+// CHECK-NEXT: warning: argument unused during compilation: '-c' [-Wunused-command-line-argument]
----------------
chestnykh wrote:

I've added `-fsyntax-only -E` case. `-c -S` i think is like duplication of `-c` and `-S` test cases

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


More information about the cfe-commits mailing list