From 3cf1e9419482d605e53c479a26a8408343b791d4 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Tue, 18 May 2021 09:33:50 -0700 Subject: [PATCH] [test] Speculative fix for bots Bot has error "Failed to create target from default triple: Unable to find target for this triple (no targets are registered)", likely because we only initialized the native target, not the registered target if it's different. https://lab.llvm.org/buildbot/#/builders/86/builds/13664 --- unittests/Passes/PassBuilderBindingsTest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unittests/Passes/PassBuilderBindingsTest.cpp b/unittests/Passes/PassBuilderBindingsTest.cpp index 39c1b89f90e..c55c882e608 100644 --- a/unittests/Passes/PassBuilderBindingsTest.cpp +++ b/unittests/Passes/PassBuilderBindingsTest.cpp @@ -15,12 +15,13 @@ using namespace llvm; class PassBuilderCTest : public testing::Test { void SetUp() override { - LLVMInitializeNativeTarget(); + LLVMInitializeAllTargetInfos(); char *Triple = LLVMGetDefaultTargetTriple(); char *Err; LLVMTargetRef Target; if (LLVMGetTargetFromTriple(Triple, &Target, &Err)) { - FAIL() << "Failed to create target from default triple: " << Err; + FAIL() << "Failed to create target from default triple (" << Triple + << "): " << Err; } TM = LLVMCreateTargetMachine(Target, Triple, "generic", "", LLVMCodeGenLevelDefault, LLVMRelocDefault,