File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ add_llvm_unittest(CodeGenTests
4747 TargetOptionsTest.cpp
4848 TestAsmPrinter.cpp
4949 MLRegAllocDevelopmentFeatures.cpp
50+ X86MCInstLowerTest.cpp
5051 )
5152
5253add_subdirectory (GlobalISel)
Original file line number Diff line number Diff line change @@ -29,8 +29,14 @@ namespace llvm {
2929class X86MCInstLowerTest : public testing ::Test {
3030protected:
3131 static void SetUpTestCase () {
32- LLVMInitializeX86TargetMC ();
33- LLVMInitializeX86Target ();
32+ // LLVMInitializeX86TargetInfo();
33+ // LLVMInitializeX86TargetMC();
34+ // LLVMInitializeX86Target();
35+ // LLVMInitializeX86AsmPrinter();
36+ InitializeAllTargetMCs ();
37+ InitializeAllTargetInfos ();
38+ InitializeAllTargets ();
39+ InitializeAllAsmPrinters ();
3440 }
3541
3642 // Function to setup codegen pipeline and returns the AsmPrinter.
@@ -96,6 +102,7 @@ class X86MCInstLowerTest : public testing::Test {
96102 Triple TargetTriple (" x86_64--" );
97103 std::string Error;
98104 const Target *T = TargetRegistry::lookupTarget (" " , TargetTriple, Error);
105+ // Skip the test if target is not built.
99106 if (!T)
100107 GTEST_SKIP ();
101108
@@ -109,8 +116,6 @@ class X86MCInstLowerTest : public testing::Test {
109116 if (!TM)
110117 GTEST_SKIP ();
111118
112- LLVMInitializeX86AsmPrinter ();
113-
114119 SMDiagnostic SMError;
115120
116121 // Parse the module.
You can’t perform that action at this time.
0 commit comments