Skip to content

Commit 3cc3c0f

Browse files
committed
Add support to -Wa,--version in clang
Clang currently only supports -Wa,--version when -no-integrated-as is used. This adds support to -Wa,--version with -integrated-as. Link: ClangBuiltLinux/linux#1320 Reviewed By: nickdesaulniers, MaskRay Differential Revision: https://reviews.llvm.org/D99556
1 parent 115a42a commit 3cc3c0f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,6 +2549,8 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
25492549
// -fdebug-compilation-dir (without '=') here.
25502550
CmdArgs.push_back("-fdebug-compilation-dir");
25512551
CmdArgs.push_back(Value.data());
2552+
} else if (Value == "--version") {
2553+
D.PrintVersion(C, llvm::outs());
25522554
} else {
25532555
D.Diag(diag::err_drv_unsupported_option_argument)
25542556
<< A->getOption().getName() << Value;

clang/test/Driver/as-version.s

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Test version information.
2+
3+
// RUN: %clang -Wa,--version -c -fintegrated-as %s -o /dev/null \
4+
// RUN: | FileCheck --check-prefix=IAS %s
5+
// IAS: clang version
6+
7+
// RUN: %clang -Wa,--version -c -fno-integrated-as %s -o /dev/null \
8+
// RUN: | FileCheck --check-prefix=GAS %s
9+
// GAS-NOT: clang

0 commit comments

Comments
 (0)