1414#include " clang/FrontendTool/Utils.h"
1515#include " clang/Lex/PreprocessorOptions.h"
1616#include " llvm/Support/VirtualFileSystem.h"
17+ #include " llvm/Support/TargetSelect.h"
1718#include " gtest/gtest.h"
1819
1920using namespace llvm ;
@@ -23,6 +24,7 @@ using namespace clang::frontend;
2324namespace {
2425
2526TEST (FrontendOutputTests, TestOutputStream) {
27+ llvm::InitializeAllTargetMCs ();
2628 auto Invocation = std::make_shared<CompilerInvocation>();
2729 Invocation->getPreprocessorOpts ().addRemappedFile (
2830 " test.cc" , MemoryBuffer::getMemBuffer (" " ).release ());
@@ -47,6 +49,7 @@ TEST(FrontendOutputTests, TestOutputStream) {
4749}
4850
4951TEST (FrontendOutputTests, TestVerboseOutputStreamShared) {
52+ llvm::InitializeAllTargetMCs ();
5053 auto Invocation = std::make_shared<CompilerInvocation>();
5154 Invocation->getPreprocessorOpts ().addRemappedFile (
5255 " test.cc" , MemoryBuffer::getMemBuffer (" invalid" ).release ());
@@ -77,6 +80,7 @@ TEST(FrontendOutputTests, TestVerboseOutputStreamOwned) {
7780 std::string VerboseBuffer;
7881 bool Success;
7982 {
83+ llvm::InitializeAllTargetMCs ();
8084 auto Invocation = std::make_shared<CompilerInvocation>();
8185 Invocation->getPreprocessorOpts ().addRemappedFile (
8286 " test.cc" , MemoryBuffer::getMemBuffer (" invalid" ).release ());
0 commit comments