xref: /llvm-project/llvm/unittests/Support/CMakeLists.txt (revision bc51a2e3940a12617bc3391f8577ef2d6fa349e8)
1set(LLVM_LINK_COMPONENTS
2  Support
3  TargetParser
4  )
5
6add_llvm_unittest(SupportTests
7  AddressRangeTest.cpp
8  AlignmentTest.cpp
9  AlignOfTest.cpp
10  AllocatorTest.cpp
11  ARMAttributeParser.cpp
12  ArrayRecyclerTest.cpp
13  Base64Test.cpp
14  BinaryStreamTest.cpp
15  BLAKE3Test.cpp
16  BlockFrequencyTest.cpp
17  BalancedPartitioningTest.cpp
18  BranchProbabilityTest.cpp
19  CachePruningTest.cpp
20  CrashRecoveryTest.cpp
21  Casting.cpp
22  CheckedArithmeticTest.cpp
23  Chrono.cpp
24  CommandLineTest.cpp
25  CompressionTest.cpp
26  ConvertEBCDICTest.cpp
27  ConvertUTFTest.cpp
28  CRCTest.cpp
29  CSKYAttributeParserTest.cpp
30  DataExtractorTest.cpp
31  DebugCounterTest.cpp
32  DebugTest.cpp
33  DivisionByConstantTest.cpp
34  DJBTest.cpp
35  EndianStreamTest.cpp
36  EndianTest.cpp
37  ELFAttributeParserTest.cpp
38  ErrnoTest.cpp
39  ErrorOrTest.cpp
40  ErrorTest.cpp
41  ExponentialBackoffTest.cpp
42  ExtensibleRTTITest.cpp
43  FileCollectorTest.cpp
44  FileOutputBufferTest.cpp
45  FormatVariadicTest.cpp
46  FSUniqueIDTest.cpp
47  GenericDomTreeTest.cpp
48  GlobPatternTest.cpp
49  HashBuilderTest.cpp
50  IndexedAccessorTest.cpp
51  InstructionCostTest.cpp
52  JSONTest.cpp
53  KnownBitsTest.cpp
54  LEB128Test.cpp
55  LineIteratorTest.cpp
56  LockFileManagerTest.cpp
57  MatchersTest.cpp
58  MD5Test.cpp
59  ManagedStatic.cpp
60  MathExtrasTest.cpp
61  MemoryBufferRefTest.cpp
62  MemoryBufferTest.cpp
63  MemoryTest.cpp
64  ModRefTest.cpp
65  NativeFormatTests.cpp
66  OptimizedStructLayoutTest.cpp
67  ParallelTest.cpp
68  Path.cpp
69  PerThreadBumpPtrAllocatorTest.cpp
70  ProcessTest.cpp
71  ProgramTest.cpp
72  RecyclerTest.cpp
73  RegexTest.cpp
74  ReverseIterationTest.cpp
75  ReplaceFileTest.cpp
76  RISCVAttributeParserTest.cpp
77  ScaledNumberTest.cpp
78  ScopedPrinterTest.cpp
79  SHA256.cpp
80  SignalsTest.cpp
81  SipHashTest.cpp
82  SourceMgrTest.cpp
83  SpecialCaseListTest.cpp
84  SuffixTreeTest.cpp
85  SwapByteOrderTest.cpp
86  TarWriterTest.cpp
87  ThreadPool.cpp
88  ThreadSafeAllocatorTest.cpp
89  Threading.cpp
90  TimerTest.cpp
91  TimeProfilerTest.cpp
92  ToolOutputFileTest.cpp
93  TypeNameTest.cpp
94  TypeSizeTest.cpp
95  TypeTraitsTest.cpp
96  TrailingObjectsTest.cpp
97  UnicodeTest.cpp
98  UTCTimeTest.cpp
99  VersionTupleTest.cpp
100  VirtualFileSystemTest.cpp
101  WithColorTest.cpp
102  YAMLIOTest.cpp
103  YAMLParserTest.cpp
104  buffer_ostream_test.cpp
105  formatted_raw_ostream_test.cpp
106  raw_fd_stream_test.cpp
107  raw_ostream_test.cpp
108  raw_pwrite_stream_test.cpp
109  raw_sha1_ostream_test.cpp
110  raw_socket_stream_test.cpp
111  xxhashTest.cpp
112
113  DEPENDS
114  intrinsics_gen
115  )
116
117target_link_libraries(SupportTests PRIVATE LLVMTestingSupport)
118
119# Disable all warning for AlignOfTest.cpp,
120# as it does things intentionally, and there is no reliable way of
121# disabling all warnings for all the compilers by using pragmas.
122# Don't disable on MSVC, because all incriminated warnings are already disabled
123# in source; and because we would otherwise see this warning:
124#   cl : Command line warning D9025: overriding '/W4' with '/w'
125if(NOT MSVC)
126  set_source_files_properties(AlignOfTest.cpp PROPERTIES COMPILE_FLAGS -w)
127endif()
128if(MSVC)
129  if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.14 )
130    # Since VS2017 15.8, the following snippet: Failed<CustomSubError>()
131    # generates a warning:
132    # \svn\llvm\utils\unittest\googlemock\include\gmock\gmock-matchers.h(186):
133    #   warning C5046: 'testing::MatcherInterface<T>::~MatcherInterface': Symbol involving type with internal linkage not defined
134    set_source_files_properties(ErrorTest.cpp PROPERTIES COMPILE_FLAGS -wd5046)
135  endif()
136endif()
137
138# ManagedStatic.cpp uses <pthread>.
139target_link_libraries(SupportTests PRIVATE LLVMTestingSupport ${LLVM_PTHREAD_LIB})
140
141if(NOT LLVM_INTEGRATED_CRT_ALLOC)
142  # The test doesn't pass when using a custom allocator, PR47881.
143  add_subdirectory(DynamicLibrary)
144endif()
145
146add_subdirectory(CommandLineInit)
147