Reland "Add support to -Wa,--version in clang""

This relands commit 3cc3c0f8352ec33ca2f2636f94cb1d85fc57ac16 with fixed
test cases, which was reverted by commit
bf2479c347c8ca88fefdb144d8bae0a7a4231e2a.
This commit is contained in:
Jian Cai 2021-04-01 12:22:50 -07:00
parent 17095dc861
commit 76d9bc7278
2 changed files with 7 additions and 0 deletions

View File

@ -2552,6 +2552,8 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
// -fdebug-compilation-dir (without '=') here.
CmdArgs.push_back("-fdebug-compilation-dir");
CmdArgs.push_back(Value.data());
} else if (Value == "--version") {
D.PrintVersion(C, llvm::outs());
} else {
D.Diag(diag::err_drv_unsupported_option_argument)
<< A->getOption().getName() << Value;

View File

@ -0,0 +1,5 @@
// Test version information.
// RUN: %clang -Wa,--version -c -fintegrated-as %s -o /dev/null \
// RUN: | FileCheck --check-prefix=IAS %s
// IAS: clang version