Skip to content

[clang] Merge gtest binaries into AllClangUnitTests #134196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Initialize MCs so target machine construction works when targets are …
…present
  • Loading branch information
rnk committed Apr 10, 2025
commit 12069f83dbf9cd853d65b4a7c319f6fcdbcff936
4 changes: 4 additions & 0 deletions clang/unittests/Frontend/OutputStreamTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "clang/FrontendTool/Utils.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/TargetSelect.h"
#include "gtest/gtest.h"

using namespace llvm;
Expand All @@ -23,6 +24,7 @@ using namespace clang::frontend;
namespace {

TEST(FrontendOutputTests, TestOutputStream) {
llvm::InitializeAllTargetMCs();
auto Invocation = std::make_shared<CompilerInvocation>();
Invocation->getPreprocessorOpts().addRemappedFile(
"test.cc", MemoryBuffer::getMemBuffer("").release());
Expand All @@ -47,6 +49,7 @@ TEST(FrontendOutputTests, TestOutputStream) {
}

TEST(FrontendOutputTests, TestVerboseOutputStreamShared) {
llvm::InitializeAllTargetMCs();
auto Invocation = std::make_shared<CompilerInvocation>();
Invocation->getPreprocessorOpts().addRemappedFile(
"test.cc", MemoryBuffer::getMemBuffer("invalid").release());
Expand Down Expand Up @@ -77,6 +80,7 @@ TEST(FrontendOutputTests, TestVerboseOutputStreamOwned) {
std::string VerboseBuffer;
bool Success;
{
llvm::InitializeAllTargetMCs();
auto Invocation = std::make_shared<CompilerInvocation>();
Invocation->getPreprocessorOpts().addRemappedFile(
"test.cc", MemoryBuffer::getMemBuffer("invalid").release());
Expand Down
Loading