diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-compare-logical-elements.test b/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-compare-logical-elements.test index 532d11054a8a30..a076887140c284 100644 --- a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-compare-logical-elements.test +++ b/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 diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-print-basic-details.test b/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-print-basic-details.test index 9b38a527e8a5c1..54dbd7466e4f6b 100644 --- a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-print-basic-details.test +++ b/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 diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-select-logical-elements.test b/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-select-logical-elements.test index 55584b89fec413..cb98176d818583 100644 --- a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/01-dwarf-select-logical-elements.test +++ b/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 diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/02-dwarf-logical-lines.test b/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/02-dwarf-logical-lines.test index e925ad7c4b07e3..62eaf593a16c27 100644 --- a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/02-dwarf-logical-lines.test +++ b/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 diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/03-dwarf-incorrect-lexical-scope-typedef.test b/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/03-dwarf-incorrect-lexical-scope-typedef.test index 0abacc0ccae27f..f252a9a046f030 100644 --- a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/03-dwarf-incorrect-lexical-scope-typedef.test +++ b/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 diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/04-dwarf-missing-nested-enumerators.test b/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/04-dwarf-missing-nested-enumerators.test index e86035c9e771e9..dca1ff3326cc70 100644 --- a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/04-dwarf-missing-nested-enumerators.test +++ b/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 diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/05-dwarf-incorrect-lexical-scope-variable.test b/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/05-dwarf-incorrect-lexical-scope-variable.test index 372a8ac8de8b78..5453a46fb542dd 100644 --- a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/05-dwarf-incorrect-lexical-scope-variable.test +++ b/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 diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/06-dwarf-full-logical-view.test b/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/06-dwarf-full-logical-view.test index 089726fab02fd6..e83592afd2ffaa 100644 --- a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/06-dwarf-full-logical-view.test +++ b/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 diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-ignored-DW_FORM_implicit_const.test b/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-ignored-DW_FORM_implicit_const.test index 78e9670241a34e..7ee9f3118d0aa9 100644 --- a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-ignored-DW_FORM_implicit_const.test +++ b/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 diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-incorrect-function-compare.test b/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-incorrect-function-compare.test index 4d7aba1d005534..46fbc703f7dee7 100644 --- a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-incorrect-function-compare.test +++ b/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 diff --git a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-incorrect-logical-instructions.test b/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-incorrect-logical-instructions.test index 083068be784bb7..a99eae2aa2933a 100644 --- a/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-incorrect-logical-instructions.test +++ b/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' diff --git a/llvm/unittests/DebugInfo/LogicalView/ELFReaderTest.cpp b/llvm/unittests/DebugInfo/LogicalView/ELFReaderTest.cpp index e494e03cf2ed5f..1c973659033bb9 100644 --- a/llvm/unittests/DebugInfo/LogicalView/ELFReaderTest.cpp +++ b/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 @@ TEST(LogicalViewTest, ELFReader) { 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);