diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2019-01-04 17:14:55 +0000 | 
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2019-01-04 17:14:55 +0000 | 
| commit | 2c497b51bcd14dc6de869a6acf58b71ce80a25df (patch) | |
| tree | f227ee2b30052c274c60be0c9aa72b50e8ab4591 /llvm/utils/gn/secondary | |
| parent | 421c17fe4585d14efbd218eac3f9b81c0a6031e8 (diff) | |
| download | bcm5719-llvm-2c497b51bcd14dc6de869a6acf58b71ce80a25df.tar.gz bcm5719-llvm-2c497b51bcd14dc6de869a6acf58b71ce80a25df.zip | |
[gn build] Start adding build files for LLVM unittests
Adds build files for //llvm/unittest/[A-D].
Also teach sync_source_lists_from_cmake.py to not complain about missing
BUILD.gn files for CMakeLists.txt files that just call add_subdirectory()
without calling add_.+_unittest, like e.g.
llvm/unittests/Target/CMakeLists.txt.
(Omits CodeGen/GlobalISel and DebugInfo/PDB because their build files are somewhat interesting, and this patch is already on the larger side.)
Differential Revision: https://reviews.llvm.org/D56212
llvm-svn: 350411
Diffstat (limited to 'llvm/utils/gn/secondary')
12 files changed, 309 insertions, 1 deletions
| diff --git a/llvm/utils/gn/secondary/llvm/test/BUILD.gn b/llvm/utils/gn/secondary/llvm/test/BUILD.gn index 48e6e3e2fb0..f282c7ffdbd 100644 --- a/llvm/utils/gn/secondary/llvm/test/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/test/BUILD.gn @@ -241,6 +241,7 @@ group("test") {      "//llvm/tools/sanstats",      "//llvm/tools/verify-uselistorder",      "//llvm/tools/yaml2obj", +    "//llvm/unittests",      "//llvm/utils/FileCheck",      "//llvm/utils/TableGen:llvm-tblgen",      "//llvm/utils/count", @@ -261,7 +262,6 @@ group("test") {      ]    } -  # FIXME: dep on "//llvm/unittests" once it exists    # FIXME: llvm_build_examples    testonly = true  } diff --git a/llvm/utils/gn/secondary/llvm/unittests/ADT/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/ADT/BUILD.gn new file mode 100644 index 00000000000..611df36fd0f --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/ADT/BUILD.gn @@ -0,0 +1,79 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("ADTTests") { +  # ADT is a headers-only library so there's no //llvm/lib/ADT to depend on. +  # Also see note in //llvm/lib/Support/BUILD.gn. +  deps = [ +    # Some tests include files from IR, but there's no library dependency. +    "//llvm/include/llvm/IR:public_tablegen", +    "//llvm/lib/Support", +  ] +  sources = [ +    "APFloatTest.cpp", +    "APIntTest.cpp", +    "APSIntTest.cpp", +    "AnyTest.cpp", +    "ArrayRefTest.cpp", +    "BitVectorTest.cpp", +    "BitmaskEnumTest.cpp", +    "BreadthFirstIteratorTest.cpp", +    "BumpPtrListTest.cpp", +    "DAGDeltaAlgorithmTest.cpp", +    "DeltaAlgorithmTest.cpp", +    "DenseMapTest.cpp", +    "DenseSetTest.cpp", +    "DepthFirstIteratorTest.cpp", +    "EquivalenceClassesTest.cpp", +    "FoldingSet.cpp", +    "FunctionExtrasTest.cpp", +    "FunctionRefTest.cpp", +    "HashingTest.cpp", +    "IListBaseTest.cpp", +    "IListIteratorTest.cpp", +    "IListNodeBaseTest.cpp", +    "IListNodeTest.cpp", +    "IListSentinelTest.cpp", +    "IListTest.cpp", +    "ImmutableListTest.cpp", +    "ImmutableMapTest.cpp", +    "ImmutableSetTest.cpp", +    "IntEqClassesTest.cpp", +    "IntervalMapTest.cpp", +    "IntrusiveRefCntPtrTest.cpp", +    "IteratorTest.cpp", +    "MakeUniqueTest.cpp", +    "MapVectorTest.cpp", +    "MappedIteratorTest.cpp", +    "OptionalTest.cpp", +    "PackedVectorTest.cpp", +    "PointerEmbeddedIntTest.cpp", +    "PointerIntPairTest.cpp", +    "PointerSumTypeTest.cpp", +    "PointerUnionTest.cpp", +    "PostOrderIteratorTest.cpp", +    "PriorityWorklistTest.cpp", +    "RangeAdapterTest.cpp", +    "SCCIteratorTest.cpp", +    "STLExtrasTest.cpp", +    "ScopeExitTest.cpp", +    "SequenceTest.cpp", +    "SetVectorTest.cpp", +    "SimpleIListTest.cpp", +    "SmallPtrSetTest.cpp", +    "SmallSetTest.cpp", +    "SmallStringTest.cpp", +    "SmallVectorTest.cpp", +    "SparseBitVectorTest.cpp", +    "SparseMultiSetTest.cpp", +    "SparseSetTest.cpp", +    "StatisticTest.cpp", +    "StringExtrasTest.cpp", +    "StringMapTest.cpp", +    "StringRefTest.cpp", +    "StringSwitchTest.cpp", +    "TinyPtrVectorTest.cpp", +    "TripleTest.cpp", +    "TwineTest.cpp", +    "VariadicFunctionTest.cpp", +  ] +} diff --git a/llvm/utils/gn/secondary/llvm/unittests/Analysis/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/Analysis/BUILD.gn new file mode 100644 index 00000000000..2b9b38d2ef2 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/Analysis/BUILD.gn @@ -0,0 +1,37 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("AnalysisTests") { +  deps = [ +    "//llvm/lib/Analysis", +    "//llvm/lib/AsmParser", +    "//llvm/lib/IR", +    "//llvm/lib/Support", +  ] +  sources = [ +    "AliasAnalysisTest.cpp", +    "AliasSetTrackerTest.cpp", +    "BasicAliasAnalysisTest.cpp", +    "BlockFrequencyInfoTest.cpp", +    "BranchProbabilityInfoTest.cpp", +    "CFGTest.cpp", +    "CGSCCPassManagerTest.cpp", +    "CallGraphTest.cpp", +    "DivergenceAnalysisTest.cpp", +    "GlobalsModRefTest.cpp", +    "LazyCallGraphTest.cpp", +    "LoopInfoTest.cpp", +    "MemoryBuiltinsTest.cpp", +    "MemorySSATest.cpp", +    "OrderedBasicBlockTest.cpp", +    "OrderedInstructionsTest.cpp", +    "PhiValuesTest.cpp", +    "ProfileSummaryInfoTest.cpp", +    "ScalarEvolutionTest.cpp", +    "SparsePropagation.cpp", +    "TBAATest.cpp", +    "TargetLibraryInfoTest.cpp", +    "UnrollAnalyzerTest.cpp", +    "ValueLatticeTest.cpp", +    "ValueTrackingTest.cpp", +  ] +} diff --git a/llvm/utils/gn/secondary/llvm/unittests/AsmParser/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/AsmParser/BUILD.gn new file mode 100644 index 00000000000..7cc4a546ca1 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/AsmParser/BUILD.gn @@ -0,0 +1,12 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("AsmParserTests") { +  deps = [ +    "//llvm/lib/AsmParser", +    "//llvm/lib/IR", +    "//llvm/lib/Support", +  ] +  sources = [ +    "AsmParserTest.cpp", +  ] +} diff --git a/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn new file mode 100644 index 00000000000..38147d24574 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn @@ -0,0 +1,66 @@ +import("//llvm/lib/Target/targets.gni") + +group("unittests") { +  deps = [ +    "ADT:ADTTests", +    "Analysis:AnalysisTests", +    "AsmParser:AsmParserTests", +    "BinaryFormat:BinaryFormatTests", +    "Bitcode:BitcodeTests", +    "CodeGen:CodeGenTests", + +    # FIXME: Add. +    #"CodeGen/GlobalISel:GlobalISelTests", +    "DebugInfo/CodeView:DebugInfoCodeViewTests", +    "DebugInfo/DWARF:DebugInfoDWARFTests", +    "DebugInfo/MSF:DebugInfoMSFTests", + +    # FIXME: Add. +    #"DebugInfo/PDB:DebugInfoPDBTests", +    "Demangle:DemangleTests", + +    # FIXME: Add more: +    #"ExecutionEngine:ExecutionEngineTests", +    #"ExecutionEngine/MCJIT:MCJITTests", +    #"ExecutionEngine/Orc:OrcJITTests", +    #"FuzzMutate:FuzzMutateTests", +    #"IR:IRTests", +    #"LineEditor:LineEditorTests", +    #"MC:MCTests", +    #"MI:MITests", +    #"Object:ObjectTests", +    #"ObjectYAML:ObjectYAMLTests", +    #"Option:OptionTests", +    #"Passes:PluginsTests", +    #"ProfileData:ProfileDataTests", +    #"Support:SupportTests", +    #"Support/DynamicLibrary:DynamicLibraryTests", +    #"Transforms/IPO:IPOTests", +    #"Transforms/Scalar:ScalarTests", +    #"Transforms/Utils:UtilsTests", +    #"XRay:XRayTests", +    #"tools/llvm-cfi-verify:CFIVerifyTests", +    #"tools/llvm-exegesis:LLVMExegesisTests", +  ] + +  # Target-dependend unit tests. +  # FIXME: This matches how they are set up in the cmake build, +  # but if we disable an arch after building with it on, this +  # setup leaves behind stale executables. +  # FIXME: Add AArch64, ARM these once the Targets exist. +  #if (llvm_build_AArch64) { +  #deps += [ +  #"Target/AArch64:AArch64Tests", +  #"tools/llvm-exegesis/AArch64:LLVMExegesisAArch64Tests", +  #] +  #} +  #if (llvm_build_ARM) { +  #deps += [ "tools/llvm-exegesis/ARM:LLVMExegesisARMTests" ] +  #} +  if (llvm_build_X86) { +    # FIXME: Add: +    #deps += [ "tools/llvm-exegesis/X86:LLVMExegesisX86Tests" ] +  } + +  testonly = true +} diff --git a/llvm/utils/gn/secondary/llvm/unittests/BinaryFormat/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/BinaryFormat/BUILD.gn new file mode 100644 index 00000000000..7b2b78e4390 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/BinaryFormat/BUILD.gn @@ -0,0 +1,15 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("BinaryFormatTests") { +  deps = [ +    "//llvm/lib/BinaryFormat", +  ] +  sources = [ +    "DwarfTest.cpp", +    "MachOTest.cpp", +    "MsgPackReaderTest.cpp", +    "MsgPackTypesTest.cpp", +    "MsgPackWriterTest.cpp", +    "TestFileMagic.cpp", +  ] +} diff --git a/llvm/utils/gn/secondary/llvm/unittests/Bitcode/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/Bitcode/BUILD.gn new file mode 100644 index 00000000000..9cb78946e82 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/Bitcode/BUILD.gn @@ -0,0 +1,16 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("BitcodeTests") { +  deps = [ +    "//llvm/lib/AsmParser", +    "//llvm/lib/Bitcode/Reader", +    "//llvm/lib/Bitcode/Writer", +    "//llvm/lib/IR", +    "//llvm/lib/Support", +  ] +  sources = [ +    "BitReaderTest.cpp", +    "BitstreamReaderTest.cpp", +    "BitstreamWriterTest.cpp", +  ] +} diff --git a/llvm/utils/gn/secondary/llvm/unittests/CodeGen/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/CodeGen/BUILD.gn new file mode 100644 index 00000000000..b67631b4642 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/CodeGen/BUILD.gn @@ -0,0 +1,25 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("CodeGenTests") { +  deps = [ +    "//llvm/lib/Analysis", +    "//llvm/lib/AsmParser", +    "//llvm/lib/CodeGen", +    "//llvm/lib/CodeGen/AsmPrinter", +    "//llvm/lib/CodeGen/SelectionDAG", +    "//llvm/lib/IR", +    "//llvm/lib/MC", +    "//llvm/lib/Support", +    "//llvm/lib/Target", +    "//llvm/lib/Target:TargetsToBuild", +  ] +  sources = [ +    "AArch64SelectionDAGTest.cpp", +    "DIEHashTest.cpp", +    "LowLevelTypeTest.cpp", +    "MachineInstrBundleIteratorTest.cpp", +    "MachineInstrTest.cpp", +    "MachineOperandTest.cpp", +    "ScalableVectorMVTsTest.cpp", +  ] +} diff --git a/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/CodeView/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/CodeView/BUILD.gn new file mode 100644 index 00000000000..913de50c7e6 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/CodeView/BUILD.gn @@ -0,0 +1,13 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("DebugInfoCodeViewTests") { +  deps = [ +    "//llvm/lib/DebugInfo/CodeView", +    "//llvm/lib/Testing/Support", +  ] +  sources = [ +    "RandomAccessVisitorTest.cpp", +    "TypeHashingTest.cpp", +    "TypeIndexDiscoveryTest.cpp", +  ] +} diff --git a/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/DWARF/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/DWARF/BUILD.gn new file mode 100644 index 00000000000..1c22a4ba1dd --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/DWARF/BUILD.gn @@ -0,0 +1,21 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("DebugInfoDWARFTests") { +  deps = [ +    "//llvm/lib/CodeGen/AsmPrinter", +    "//llvm/lib/DebugInfo/DWARF", +    "//llvm/lib/MC", +    "//llvm/lib/Object", +    "//llvm/lib/ObjectYAML", +    "//llvm/lib/Support", +    "//llvm/lib/Target:TargetsToBuild", +    "//llvm/lib/Testing/Support", +  ] +  sources = [ +    "DWARFDebugInfoTest.cpp", +    "DWARFDebugLineTest.cpp", +    "DWARFFormValueTest.cpp", +    "DwarfGenerator.cpp", +    "DwarfUtils.cpp", +  ] +} diff --git a/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/MSF/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/MSF/BUILD.gn new file mode 100644 index 00000000000..6c9bc06ab4c --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/MSF/BUILD.gn @@ -0,0 +1,13 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("DebugInfoMSFTests") { +  deps = [ +    "//llvm/lib/DebugInfo/MSF", +    "//llvm/lib/Testing/Support", +  ] +  sources = [ +    "MSFBuilderTest.cpp", +    "MSFCommonTest.cpp", +    "MappedBlockStreamTest.cpp", +  ] +} diff --git a/llvm/utils/gn/secondary/llvm/unittests/Demangle/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/Demangle/BUILD.gn new file mode 100644 index 00000000000..c7eedfbe715 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/Demangle/BUILD.gn @@ -0,0 +1,11 @@ +import("//llvm/utils/unittest/unittest.gni") + +unittest("DemangleTests") { +  deps = [ +    "//llvm/lib/Demangle", +  ] +  sources = [ +    "ItaniumDemangleTest.cpp", +    "PartialDemangleTest.cpp", +  ] +} | 

