From 3d71592c49ea1901908757e63382961e14d07117 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 27 Oct 2022 08:47:12 -0400 Subject: [PATCH] [gn build] semi-automatically ort 4f06d46f465c (LogicalView input files) --- .../llvm/lib/DebugInfo/LogicalView/BUILD.gn | 3 +++ .../unittests/DebugInfo/LogicalView/BUILD.gn | 21 +++++++++++++++++++ .../llvm/unittests/DebugInfo/PDB/BUILD.gn | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/llvm/utils/gn/secondary/llvm/lib/DebugInfo/LogicalView/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/DebugInfo/LogicalView/BUILD.gn index f19b3660891b7..95853567b8b9f 100644 --- a/llvm/utils/gn/secondary/llvm/lib/DebugInfo/LogicalView/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/lib/DebugInfo/LogicalView/BUILD.gn @@ -24,5 +24,8 @@ static_library("LogicalView") { "Core/LVSupport.cpp", "Core/LVSymbol.cpp", "Core/LVType.cpp", + "LVReaderHandler.cpp", + "Readers/LVBinaryReader.cpp", + "Readers/LVELFReader.cpp", ] } diff --git a/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/LogicalView/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/LogicalView/BUILD.gn index c8111a81d211b..579e7c75c9196 100644 --- a/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/LogicalView/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/LogicalView/BUILD.gn @@ -3,15 +3,36 @@ import("//llvm/utils/unittest/unittest.gni") unittest("DebugInfoLogicalViewTests") { deps = [ "//llvm/lib/DebugInfo/LogicalView", + "//llvm/lib/MC/MCDisassembler", "//llvm/lib/Testing/Support", + "//llvm/lib/Target:AllTargetsDescs", + "//llvm/lib/Target:AllTargetsDisassemblers", + "//llvm/lib/Target:AllTargetsInfos", ] sources = [ "CommandLineOptionsTest.cpp", "CompareElementsTest.cpp", + "ELFReaderTest.cpp", "LocationRangesTest.cpp", "LogicalElementsTest.cpp", "SelectElementsTest.cpp", "StringPoolTest.cpp", "WarningInternalTest.cpp", ] + + # DebugInfoLogicalViewTests uses llvm::getInputFileDirectory(), which expects + # a file called llvm.srcdir.txt next to the test executable that contains + # the path of the source directory (which contains this file). + # lit doesn't change the cwd while running googletests, so the cwd isn't + # well-defined. This means this has to be an absolute path. + # FIXME: This doesn't work with swarming. This should really be a data + # dependency, and the cwd while tests requiring input files run should + # be required to be some fixed directory. + # FIXME: Also, the GN way is to write this file at build time. But since + # there's only two uses of this, and since this is a pattern that hopefully + # will disappear again, and since it doesn't have any measurable performance + # hit, write the file at GN time. + # Note: This line here implicitly depends on unittest() setting output_dir to + # target_out_dir. + write_file("$target_out_dir/llvm.srcdir.txt", rebase_path(".")) } diff --git a/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/PDB/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/PDB/BUILD.gn index 16a5461494d55..50979695e6f72 100644 --- a/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/PDB/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/PDB/BUILD.gn @@ -24,7 +24,7 @@ unittest("DebugInfoPDBTests") { # dependency, and the cwd while tests requiring input files run should # be required to be some fixed directory. # FIXME: Also, the GN way is to write this file at build time. But since - # there's only one use of this, and since this is a pattern that hopefully + # there's only two uses of this, and since this is a pattern that hopefully # will disappear again, and since it doesn't have any measurable performance # hit, write the file at GN time. # Note: This line here implicitly depends on unittest() setting output_dir to