1 function(add_llvm_unittest test_name)
3 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
4 ${LLVM_BINARY_DIR}/unittests/${test_name}/${CMAKE_BUILD_TYPE})
6 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
7 ${LLVM_BINARY_DIR}/unittests/${test_name})
9 if( NOT LLVM_BUILD_TESTS )
10 set(EXCLUDE_FROM_ALL ON)
12 add_llvm_executable(${test_name}Tests ${ARGN})
13 add_dependencies(UnitTests ${test_name}Tests)
16 add_custom_target(UnitTests)
18 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
19 add_definitions(-DGTEST_HAS_RTTI=0)
21 set(LLVM_LINK_COMPONENTS
42 ADT/DAGDeltaAlgorithmTest.cpp
43 ADT/DeltaAlgorithmTest.cpp
47 ADT/ImmutableSetTest.cpp
48 ADT/IntervalMapTest.cpp
49 ADT/SmallBitVectorTest.cpp
50 ADT/SmallStringTest.cpp
51 ADT/SmallVectorTest.cpp
52 ADT/SparseBitVectorTest.cpp
59 add_llvm_unittest(Analysis
60 Analysis/ScalarEvolutionTest.cpp
63 add_llvm_unittest(ExecutionEngine
64 ExecutionEngine/ExecutionEngineTest.cpp
68 ExecutionEngine/JIT/JITEventListenerTest.cpp
69 ExecutionEngine/JIT/JITMemoryManagerTest.cpp
70 ExecutionEngine/JIT/JITTest.cpp
71 ExecutionEngine/JIT/MultiJITTest.cpp
75 list(APPEND JITTestsSources ExecutionEngine/JIT/JITTests.def)
78 add_llvm_unittest(JIT ${JITTestsSources})
80 add_llvm_unittest(Transforms
81 Transforms/Utils/Cloning.cpp
85 VMCore/ConstantsTest.cpp
86 VMCore/DerivedTypesTest.cpp
87 VMCore/InstructionsTest.cpp
88 VMCore/MetadataTest.cpp
89 VMCore/PassManagerTest.cpp
90 VMCore/ValueMapTest.cpp
91 VMCore/VerifierTest.cpp
94 # MSVC9 and 8 cannot compile ValueMapTest.cpp due to their bug.
95 # See issue#331418 in Visual Studio.
96 if(MSVC AND MSVC_VERSION LESS 1600)
97 list(REMOVE_ITEM VMCoreSources VMCore/ValueMapTest.cpp)
100 add_llvm_unittest(VMCore ${VMCoreSources})
102 set(LLVM_LINK_COMPONENTS
108 add_llvm_unittest(Support
109 Support/AllocatorTest.cpp
111 Support/CommandLineTest.cpp
112 Support/ConstantRangeTest.cpp
113 Support/EndianTest.cpp
114 Support/LeakDetectorTest.cpp
115 Support/MathExtrasTest.cpp
116 Support/raw_ostream_test.cpp
117 Support/RegexTest.cpp
118 Support/SwapByteOrderTest.cpp
120 Support/TypeBuilderTest.cpp
121 Support/ValueHandleTest.cpp