Skip to content

Commit 76d9bc7

Browse files
committed
Reland "Add support to -Wa,--version in clang""
This relands commit 3cc3c0f with fixed test cases, which was reverted by commit bf2479c.
1 parent 17095dc commit 76d9bc7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2552,6 +2552,8 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
25522552
// -fdebug-compilation-dir (without '=') here.
25532553
CmdArgs.push_back("-fdebug-compilation-dir");
25542554
CmdArgs.push_back(Value.data());
2555+
} else if (Value == "--version") {
2556+
D.PrintVersion(C, llvm::outs());
25552557
} else {
25562558
D.Diag(diag::err_drv_unsupported_option_argument)
25572559
<< A->getOption().getName() << Value;

clang/test/Driver/as-version.s

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
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

0 commit comments

Comments
 (0)