Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
13 changed files
with
317 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
15 changes: 15 additions & 0 deletions
15
llvm/utils/gn/secondary/llvm/unittests/BinaryFormat/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
llvm/utils/gn/secondary/llvm/unittests/DebugInfo/CodeView/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] | ||
} |
21 changes: 21 additions & 0 deletions
21
llvm/utils/gn/secondary/llvm/unittests/DebugInfo/DWARF/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
llvm/utils/gn/secondary/llvm/unittests/DebugInfo/MSF/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import("//llvm/utils/unittest/unittest.gni") | ||
|
||
unittest("DemangleTests") { | ||
deps = [ | ||
"//llvm/lib/Demangle", | ||
] | ||
sources = [ | ||
"ItaniumDemangleTest.cpp", | ||
"PartialDemangleTest.cpp", | ||
] | ||
} |