blob: 00fd79687cddec13e5c075644e0ece440bda5b8e [file] [log] [blame]
Oscar Fuentesda975632010-10-28 14:38:35 +00001add_custom_target(UnitTests)
Oscar Fuentes0b85d072011-02-20 22:06:10 +00002set_target_properties(UnitTests PROPERTIES FOLDER "Tests")
Oscar Fuentesda975632010-10-28 14:38:35 +00003
Chandler Carruthb60182e2012-06-21 05:16:58 +00004function(add_llvm_unittest test_dirname)
5 add_unittest(UnitTests ${test_dirname} ${ARGN})
6endfunction()
Frits van Bommel729b2942010-12-07 10:22:07 +00007
Michael J. Spenceree6944f2010-09-24 09:01:13 +00008set(LLVM_LINK_COMPONENTS
9 jit
10 interpreter
11 nativecodegen
12 BitWriter
13 BitReader
14 AsmParser
15 Core
Michael J. Spenceree6944f2010-09-24 09:01:13 +000016 Support
17 )
18
Chandler Carruthb1081af2012-06-21 02:02:48 +000019add_llvm_unittest(ADTTests
Michael J. Spenceree6944f2010-09-24 09:01:13 +000020 ADT/APFloatTest.cpp
21 ADT/APIntTest.cpp
22 ADT/BitVectorTest.cpp
23 ADT/DAGDeltaAlgorithmTest.cpp
24 ADT/DeltaAlgorithmTest.cpp
25 ADT/DenseMapTest.cpp
26 ADT/DenseSetTest.cpp
Dale Johannesena197cba2010-11-19 23:23:22 +000027 ADT/FoldingSet.cpp
Talin1a4b19e2012-02-18 21:00:49 +000028 ADT/HashingTest.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +000029 ADT/ilistTest.cpp
30 ADT/ImmutableSetTest.cpp
Jakob Stoklund Olesen2a6899c2010-12-21 00:04:46 +000031 ADT/IntEqClassesTest.cpp
Jakob Stoklund Olesen8dc92672010-11-19 04:47:19 +000032 ADT/IntervalMapTest.cpp
Manuel Klimek41aa1082012-01-31 19:58:34 +000033 ADT/IntrusiveRefCntPtrTest.cpp
Argyrios Kyrtzidis0f5b6872011-06-15 19:19:09 +000034 ADT/PackedVectorTest.cpp
Benjamin Kramer044de9c2012-06-17 14:42:49 +000035 ADT/SCCIteratorTest.cpp
36 ADT/SmallPtrSetTest.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +000037 ADT/SmallStringTest.cpp
38 ADT/SmallVectorTest.cpp
39 ADT/SparseBitVectorTest.cpp
Jakob Stoklund Olesen62588622012-02-22 00:56:08 +000040 ADT/SparseSetTest.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +000041 ADT/StringMapTest.cpp
42 ADT/StringRefTest.cpp
43 ADT/TripleTest.cpp
44 ADT/TwineTest.cpp
Chandler Carruthd916ce32011-12-16 08:58:59 +000045 ADT/VariadicFunctionTest.cpp
Douglas Gregorc576d3d2010-09-27 16:40:43 +000046 )
Michael J. Spenceree6944f2010-09-24 09:01:13 +000047
Chandler Carruthb1081af2012-06-21 02:02:48 +000048add_llvm_unittest(AnalysisTests
Michael J. Spenceree6944f2010-09-24 09:01:13 +000049 Analysis/ScalarEvolutionTest.cpp
50 )
51
Chandler Carruthb1081af2012-06-21 02:02:48 +000052add_llvm_unittest(ExecutionEngineTests
Eli Benderskyf963cd32012-03-15 06:49:31 +000053 ExecutionEngine/ExecutionEngineTest.cpp
54 )
55
Eli Bendersky61b18512012-03-13 08:33:15 +000056if( LLVM_USE_INTEL_JITEVENTS )
57 include_directories( ${LLVM_INTEL_JITEVENTS_INCDIR} )
58 link_directories( ${LLVM_INTEL_JITEVENTS_LIBDIR} )
59 set(ProfileTestSources
Eli Benderskyf963cd32012-03-15 06:49:31 +000060 ExecutionEngine/JIT/IntelJITEventListenerTest.cpp
Eli Bendersky61b18512012-03-13 08:33:15 +000061 )
62 set(LLVM_LINK_COMPONENTS
63 ${LLVM_LINK_COMPONENTS}
64 IntelJITEvents
65 )
66endif( LLVM_USE_INTEL_JITEVENTS )
67
68if( LLVM_USE_OPROFILE )
69 set(ProfileTestSources
70 ${ProfileTestSources}
Eli Benderskyf963cd32012-03-15 06:49:31 +000071 ExecutionEngine/JIT/OProfileJITEventListenerTest.cpp
Eli Bendersky61b18512012-03-13 08:33:15 +000072 )
73 set(LLVM_LINK_COMPONENTS
74 ${LLVM_LINK_COMPONENTS}
75 OProfileJIT
76 )
77endif( LLVM_USE_OPROFILE )
78
NAKAMURA Takumi0f60ddc2010-11-19 03:19:42 +000079set(JITTestsSources
Eli Benderskyf963cd32012-03-15 06:49:31 +000080 ExecutionEngine/JIT/JITEventListenerTest.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +000081 ExecutionEngine/JIT/JITMemoryManagerTest.cpp
82 ExecutionEngine/JIT/JITTest.cpp
83 ExecutionEngine/JIT/MultiJITTest.cpp
Eli Benderskyf963cd32012-03-15 06:49:31 +000084 ${ProfileTestSources}
Michael J. Spenceree6944f2010-09-24 09:01:13 +000085 )
86
NAKAMURA Takumi0f60ddc2010-11-19 03:19:42 +000087if(MSVC)
88 list(APPEND JITTestsSources ExecutionEngine/JIT/JITTests.def)
89endif()
90
Chandler Carruthb1081af2012-06-21 02:02:48 +000091add_llvm_unittest(ExecutionEngine/JITTests
92 ${JITTestsSources}
93 )
NAKAMURA Takumi0f60ddc2010-11-19 03:19:42 +000094
NAKAMURA Takumide0cfe82011-12-16 06:21:08 +000095if(MINGW OR CYGWIN)
NAKAMURA Takumib9dec1f2010-11-26 09:32:02 +000096 set_property(TARGET JITTests PROPERTY LINK_FLAGS -Wl,--export-all-symbols)
97endif()
98
Chandler Carruthb1081af2012-06-21 02:02:48 +000099add_llvm_unittest(Transforms/UtilsTests
Michael J. Spencer12647eb2010-10-11 21:22:34 +0000100 Transforms/Utils/Cloning.cpp
101 )
102
NAKAMURA Takumi130a2dd2010-11-19 03:19:32 +0000103set(VMCoreSources
Michael J. Spencer12647eb2010-10-11 21:22:34 +0000104 VMCore/ConstantsTest.cpp
Benjamin Kramer044de9c2012-06-17 14:42:49 +0000105 VMCore/DominatorTreeTest.cpp
Michael J. Spencer12647eb2010-10-11 21:22:34 +0000106 VMCore/InstructionsTest.cpp
107 VMCore/MetadataTest.cpp
108 VMCore/PassManagerTest.cpp
NAKAMURA Takumib08ca272010-11-14 12:37:51 +0000109 VMCore/ValueMapTest.cpp
Michael J. Spencer12647eb2010-10-11 21:22:34 +0000110 VMCore/VerifierTest.cpp
111 )
112
NAKAMURA Takumi130a2dd2010-11-19 03:19:32 +0000113# MSVC9 and 8 cannot compile ValueMapTest.cpp due to their bug.
114# See issue#331418 in Visual Studio.
115if(MSVC AND MSVC_VERSION LESS 1600)
116 list(REMOVE_ITEM VMCoreSources VMCore/ValueMapTest.cpp)
117endif()
118
Chandler Carruthb1081af2012-06-21 02:02:48 +0000119add_llvm_unittest(VMCoreTests
120 ${VMCoreSources}
121 )
NAKAMURA Takumi130a2dd2010-11-19 03:19:32 +0000122
Chandler Carruthb1081af2012-06-21 02:02:48 +0000123add_llvm_unittest(BitcodeTests
Chandler Carruth972cc0d2012-01-02 09:19:48 +0000124 Bitcode/BitReaderTest.cpp
125 )
126
Michael J. Spencer12647eb2010-10-11 21:22:34 +0000127set(LLVM_LINK_COMPONENTS
Michael J. Spencer12647eb2010-10-11 21:22:34 +0000128 Support
129 Core
130 )
131
Chandler Carruthb1081af2012-06-21 02:02:48 +0000132add_llvm_unittest(SupportTests
Chandler Carruth585de7a2012-06-16 08:52:57 +0000133 Support/AlignOfTest.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +0000134 Support/AllocatorTest.cpp
Benjamin Kramer044de9c2012-06-17 14:42:49 +0000135 Support/BlockFrequencyTest.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +0000136 Support/Casting.cpp
137 Support/CommandLineTest.cpp
138 Support/ConstantRangeTest.cpp
Benjamin Kramer044de9c2012-06-17 14:42:49 +0000139 Support/DataExtractorTest.cpp
Michael J. Spencer5e0b2bf2010-10-21 20:28:21 +0000140 Support/EndianTest.cpp
Benjamin Kramer044de9c2012-06-17 14:42:49 +0000141 Support/IntegersSubsetTest.cpp
142 Support/IRBuilderTest.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +0000143 Support/LeakDetectorTest.cpp
Benjamin Kramer044de9c2012-06-17 14:42:49 +0000144 Support/ManagedStatic.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +0000145 Support/MathExtrasTest.cpp
Benjamin Kramer044de9c2012-06-17 14:42:49 +0000146 Support/MDBuilderTest.cpp
Michael J. Spencer013d15a2010-11-29 22:29:04 +0000147 Support/Path.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +0000148 Support/raw_ostream_test.cpp
149 Support/RegexTest.cpp
Michael J. Spencer4c099b82010-10-11 21:56:16 +0000150 Support/SwapByteOrderTest.cpp
Michael J. Spencer013d15a2010-11-29 22:29:04 +0000151 Support/TimeValue.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +0000152 Support/TypeBuilderTest.cpp
153 Support/ValueHandleTest.cpp
Michael J. Spencer93210e82012-04-03 23:09:22 +0000154 Support/YAMLParserTest.cpp
Michael J. Spenceree6944f2010-09-24 09:01:13 +0000155 )