[flang-commits] [clang] [flang] [flang][Driver] Support -Qunused-arguments (PR #107462)
via flang-commits
flang-commits at lists.llvm.org
Thu Sep 5 13:36:59 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-driver
@llvm/pr-subscribers-clang
Author: Tarun Prabhu (tarunprabhu)
<details>
<summary>Changes</summary>
This partially addresses: https://github.com/llvm/llvm-project/issues/89888
---
Full diff: https://github.com/llvm/llvm-project/pull/107462.diff
2 Files Affected:
- (modified) clang/include/clang/Driver/Options.td (+1-1)
- (added) flang/test/Driver/q-unused-arguments.f90 (+5)
``````````diff
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 1b9b3f2c6600a3..e3a98bab2a5020 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -949,7 +949,7 @@ def : Flag<["-"], "fident">, Group<f_Group>, Alias<Qy>,
def : Flag<["-"], "fno-ident">, Group<f_Group>, Alias<Qn>,
Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>;
def Qunused_arguments : Flag<["-"], "Qunused-arguments">,
- Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
HelpText<"Don't emit warning for unused driver arguments">;
def Q : Flag<["-"], "Q">, IgnoredGCCCompat;
def S : Flag<["-"], "S">, Flags<[NoXarchOption]>,
diff --git a/flang/test/Driver/q-unused-arguments.f90 b/flang/test/Driver/q-unused-arguments.f90
new file mode 100644
index 00000000000000..95210da888fc55
--- /dev/null
+++ b/flang/test/Driver/q-unused-arguments.f90
@@ -0,0 +1,5 @@
+! RUN: %flang -Qunused-arguments -c -o /dev/null %s -L. 2>&1 | FileCheck %s --allow-empty
+
+! CHECK-NOT: argument unused during compilation
+
+end program
``````````
</details>
https://github.com/llvm/llvm-project/pull/107462
More information about the flang-commits
mailing list