xref: /llvm-project/llvm/unittests/Analysis/CMakeLists.txt (revision cacbe71af7b1075f8ad1f84e002d1fcc83e85713)
1set(LLVM_LINK_COMPONENTS
2  Analysis
3  AsmParser
4  CodeGen
5  Core
6  Instrumentation
7  Passes
8  Support
9  TargetParser
10  TransformUtils
11  IPO
12  )
13
14set(ANALYSIS_TEST_SOURCES
15  AliasAnalysisTest.cpp
16  AliasSetTrackerTest.cpp
17  AssumeBundleQueriesTest.cpp
18  BasicAliasAnalysisTest.cpp
19  BlockFrequencyInfoTest.cpp
20  BranchProbabilityInfoTest.cpp
21  CallGraphTest.cpp
22  CaptureTrackingTest.cpp
23  CFGTest.cpp
24  CGSCCPassManagerTest.cpp
25  ConstraintSystemTest.cpp
26  CtxProfAnalysisTest.cpp
27  DDGTest.cpp
28  DomTreeUpdaterTest.cpp
29  DXILResourceTest.cpp
30  GraphWriterTest.cpp
31  GlobalsModRefTest.cpp
32  FunctionPropertiesAnalysisTest.cpp
33  InlineCostTest.cpp
34  IRSimilarityIdentifierTest.cpp
35  IVDescriptorsTest.cpp
36  LastRunTrackingAnalysisTest.cpp
37  LazyCallGraphTest.cpp
38  LoadsTest.cpp
39  LoopInfoTest.cpp
40  LoopNestTest.cpp
41  MemoryBuiltinsTest.cpp
42  MemoryProfileInfoTest.cpp
43  MemorySSATest.cpp
44  MLModelRunnerTest.cpp
45  PhiValuesTest.cpp
46  PluginInlineAdvisorAnalysisTest.cpp
47  PluginInlineOrderAnalysisTest.cpp
48  ProfileSummaryInfoTest.cpp
49  ReplaceWithVecLibTest.cpp
50  ScalarEvolutionTest.cpp
51  SparsePropagation.cpp
52  TargetLibraryInfoTest.cpp
53  TensorSpecTest.cpp
54  TBAATest.cpp
55  UnrollAnalyzerTest.cpp
56  ValueLatticeTest.cpp
57  ValueTrackingTest.cpp
58  VectorUtilsTest.cpp
59  )
60
61set(MLGO_TESTS TFUtilsTest.cpp)
62
63if (LLVM_HAVE_TFLITE)
64  LIST(APPEND ANALYSIS_TEST_SOURCES ${MLGO_TESTS})
65else()
66  LIST(APPEND LLVM_OPTIONAL_SOURCES ${MLGO_TESTS})
67endif()
68
69add_llvm_unittest_with_input_files(AnalysisTests
70  ${ANALYSIS_TEST_SOURCES}
71
72  EXPORT_SYMBOLS
73  )
74
75add_dependencies(AnalysisTests intrinsics_gen)
76
77target_link_libraries(AnalysisTests PRIVATE LLVMTestingSupport)
78
79# On AIX, enable run-time linking to allow symbols from the plugins shared
80# objects to be properly bound.
81if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
82  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-brtl")
83endif()
84
85add_subdirectory(InlineAdvisorPlugin)
86add_subdirectory(InlineOrderPlugin)
87