1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

Fix build for LLVM unittests

llvm-svn: 313397
This commit is contained in:
Reid Kleckner 2017-09-15 21:12:13 +00:00
parent 91f177ea59
commit 3570b141dc

View File

@ -98,7 +98,7 @@ TEST_F(LinkModuleTest, BlockAddress) {
Builder.CreateRet(ConstantPointerNull::get(Type::getInt8PtrTy(Ctx))); Builder.CreateRet(ConstantPointerNull::get(Type::getInt8PtrTy(Ctx)));
Module *LinkedModule = new Module("MyModuleLinked", Ctx); Module *LinkedModule = new Module("MyModuleLinked", Ctx);
Ctx.setDiagnosticHandler(expectNoDiags); Ctx.setDiagnosticHandlerCallBack(expectNoDiags);
Linker::linkModules(*LinkedModule, std::move(M)); Linker::linkModules(*LinkedModule, std::move(M));
// Check that the global "@switch.bas" is well-formed. // Check that the global "@switch.bas" is well-formed.
@ -172,14 +172,14 @@ static Module *getInternal(LLVMContext &Ctx) {
TEST_F(LinkModuleTest, EmptyModule) { TEST_F(LinkModuleTest, EmptyModule) {
std::unique_ptr<Module> InternalM(getInternal(Ctx)); std::unique_ptr<Module> InternalM(getInternal(Ctx));
std::unique_ptr<Module> EmptyM(new Module("EmptyModule1", Ctx)); std::unique_ptr<Module> EmptyM(new Module("EmptyModule1", Ctx));
Ctx.setDiagnosticHandler(expectNoDiags); Ctx.setDiagnosticHandlerCallBack(expectNoDiags);
Linker::linkModules(*EmptyM, std::move(InternalM)); Linker::linkModules(*EmptyM, std::move(InternalM));
} }
TEST_F(LinkModuleTest, EmptyModule2) { TEST_F(LinkModuleTest, EmptyModule2) {
std::unique_ptr<Module> InternalM(getInternal(Ctx)); std::unique_ptr<Module> InternalM(getInternal(Ctx));
std::unique_ptr<Module> EmptyM(new Module("EmptyModule1", Ctx)); std::unique_ptr<Module> EmptyM(new Module("EmptyModule1", Ctx));
Ctx.setDiagnosticHandler(expectNoDiags); Ctx.setDiagnosticHandlerCallBack(expectNoDiags);
Linker::linkModules(*InternalM, std::move(EmptyM)); Linker::linkModules(*InternalM, std::move(EmptyM));
} }
@ -195,7 +195,7 @@ TEST_F(LinkModuleTest, TypeMerge) {
"@t2 = weak global %t zeroinitializer\n"; "@t2 = weak global %t zeroinitializer\n";
std::unique_ptr<Module> M2 = parseAssemblyString(M2Str, Err, C); std::unique_ptr<Module> M2 = parseAssemblyString(M2Str, Err, C);
Ctx.setDiagnosticHandler(expectNoDiags); Ctx.setDiagnosticHandlerCallBack(expectNoDiags);
Linker::linkModules(*M1, std::move(M2)); Linker::linkModules(*M1, std::move(M2));
EXPECT_EQ(M1->getNamedGlobal("t1")->getType(), EXPECT_EQ(M1->getNamedGlobal("t1")->getType(),
@ -280,7 +280,7 @@ TEST_F(LinkModuleTest, MoveDistinctMDs) {
// Link into destination module. // Link into destination module.
auto Dst = llvm::make_unique<Module>("Linked", C); auto Dst = llvm::make_unique<Module>("Linked", C);
ASSERT_TRUE(Dst.get()); ASSERT_TRUE(Dst.get());
Ctx.setDiagnosticHandler(expectNoDiags); Ctx.setDiagnosticHandlerCallBack(expectNoDiags);
Linker::linkModules(*Dst, std::move(Src)); Linker::linkModules(*Dst, std::move(Src));
// Check that distinct metadata was moved, not cloned. Even !4, the uniqued // Check that distinct metadata was moved, not cloned. Even !4, the uniqued
@ -349,7 +349,7 @@ TEST_F(LinkModuleTest, RemangleIntrinsics) {
// Link two modules together. // Link two modules together.
auto Dst = llvm::make_unique<Module>("Linked", C); auto Dst = llvm::make_unique<Module>("Linked", C);
ASSERT_TRUE(Dst.get()); ASSERT_TRUE(Dst.get());
Ctx.setDiagnosticHandler(expectNoDiags); Ctx.setDiagnosticHandlerCallBack(expectNoDiags);
bool Failed = Linker::linkModules(*Foo, std::move(Bar)); bool Failed = Linker::linkModules(*Foo, std::move(Bar));
ASSERT_FALSE(Failed); ASSERT_FALSE(Failed);