Index: llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-compare-logical-elements.test =================================================================== --- llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-compare-logical-elements.test +++ llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-compare-logical-elements.test @@ -1,3 +1,5 @@ +; REQUIRES: x86-registered-target + ; Test case 1 - General options ; test.cpp Index: llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-print-basic-details.test =================================================================== --- llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-print-basic-details.test +++ llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-print-basic-details.test @@ -1,3 +1,5 @@ +; REQUIRES: x86-registered-target + ; Test case 1 - General options. ; test.cpp Index: llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-select-logical-elements.test =================================================================== --- llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-select-logical-elements.test +++ llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-select-logical-elements.test @@ -1,3 +1,5 @@ +; REQUIRES: x86-registered-target + ; Test case 1 - General options ; test.cpp Index: llvm/test/tools/llvm-debuginfo-analyzer/DWARF/02-dwarf-logical-lines.test =================================================================== --- llvm/test/tools/llvm-debuginfo-analyzer/DWARF/02-dwarf-logical-lines.test +++ llvm/test/tools/llvm-debuginfo-analyzer/DWARF/02-dwarf-logical-lines.test @@ -1,3 +1,5 @@ +; REQUIRES: x86-registered-target + ; Test case 2 - Assembler instructions. ; hello-world.cpp Index: llvm/test/tools/llvm-debuginfo-analyzer/DWARF/03-dwarf-incorrect-lexical-scope-typedef.test =================================================================== --- llvm/test/tools/llvm-debuginfo-analyzer/DWARF/03-dwarf-incorrect-lexical-scope-typedef.test +++ llvm/test/tools/llvm-debuginfo-analyzer/DWARF/03-dwarf-incorrect-lexical-scope-typedef.test @@ -1,3 +1,5 @@ +; REQUIRES: x86-registered-target + ; Test case 3 - Incorrect lexical scope for typedef. ; pr-44884.cpp Index: llvm/test/tools/llvm-debuginfo-analyzer/DWARF/04-dwarf-missing-nested-enumerators.test =================================================================== --- llvm/test/tools/llvm-debuginfo-analyzer/DWARF/04-dwarf-missing-nested-enumerators.test +++ llvm/test/tools/llvm-debuginfo-analyzer/DWARF/04-dwarf-missing-nested-enumerators.test @@ -1,3 +1,5 @@ +; REQUIRES: x86-registered-target + ; Test case 4 - Missing nested enumerations. ; pr-46466.cpp Index: llvm/test/tools/llvm-debuginfo-analyzer/DWARF/05-dwarf-incorrect-lexical-scope-variable.test =================================================================== --- llvm/test/tools/llvm-debuginfo-analyzer/DWARF/05-dwarf-incorrect-lexical-scope-variable.test +++ llvm/test/tools/llvm-debuginfo-analyzer/DWARF/05-dwarf-incorrect-lexical-scope-variable.test @@ -1,3 +1,5 @@ +; REQUIRES: x86-registered-target + ; Test case 5 - Incorrect lexical scope variable. ; pr-43860.cpp Index: llvm/test/tools/llvm-debuginfo-analyzer/DWARF/06-dwarf-full-logical-view.test =================================================================== --- llvm/test/tools/llvm-debuginfo-analyzer/DWARF/06-dwarf-full-logical-view.test +++ llvm/test/tools/llvm-debuginfo-analyzer/DWARF/06-dwarf-full-logical-view.test @@ -1,3 +1,5 @@ +; REQUIRES: x86-registered-target + ; Test case 6 - Full logical view ; test.cpp Index: llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-ignored-DW_FORM_implicit_const.test =================================================================== --- llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-ignored-DW_FORM_implicit_const.test +++ llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-ignored-DW_FORM_implicit_const.test @@ -1,3 +1,5 @@ +; REQUIRES: x86-registered-target + ; Ignored attributes with DW_FORM_implicit_const. ; https://github.com/llvm/llvm-project/issues/57040 Index: llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-incorrect-function-compare.test =================================================================== --- llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-incorrect-function-compare.test +++ llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-incorrect-function-compare.test @@ -1,3 +1,5 @@ +; REQUIRES: x86-registered-target + ; Incorrect function matching during comparison. ; https://github.com/llvm/llvm-project/issues/57040 Index: llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-incorrect-logical-instructions.test =================================================================== --- llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-incorrect-logical-instructions.test +++ llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-incorrect-logical-instructions.test @@ -1,3 +1,5 @@ +; REQUIRES: x86-registered-target + ; * Added incorrect logical instructions for: --print=lines,instructions ; 'bar' and 'foo' showing extra instruction from compiler generated functions: ; '_cxx_global_var_init' and '_GLOBAL_sub_l_suite_lexical_01.cpp' Index: llvm/unittests/DebugInfo/LogicalView/ELFReaderTest.cpp =================================================================== --- llvm/unittests/DebugInfo/LogicalView/ELFReaderTest.cpp +++ llvm/unittests/DebugInfo/LogicalView/ELFReaderTest.cpp @@ -12,6 +12,7 @@ #include "llvm/DebugInfo/LogicalView/Core/LVSymbol.h" #include "llvm/DebugInfo/LogicalView/Core/LVType.h" #include "llvm/DebugInfo/LogicalView/LVReaderHandler.h" +#include "llvm/MC/TargetRegistry.h" #include "llvm/Support/COM.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/ScopedPrinter.h" @@ -331,6 +332,16 @@ SmallString<128> InputsDir = unittest::getInputFileDirectory(TestMainArgv0); + // This test requires a x86-registered-target + Triple TT; + TT.setArch(Triple::x86_64); + TT.setVendor(Triple::UnknownVendor); + TT.setOS(Triple::UnknownOS); + + std::string TargetLookupError; + if (!TargetRegistry::lookupTarget(std::string(TT.str()), TargetLookupError)) + return; + // Logical elements general properties and selection. elementProperties(InputsDir); elementSelection(InputsDir);