Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / unittests / Support / CMakeLists.txt
blobe1bf793536b686227c227518f2ca4f4f1e281fa6
1 set(LLVM_LINK_COMPONENTS
2   Support
3   TargetParser
4   )
6 add_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   ExtensibleRTTITest.cpp
42   FileCollectorTest.cpp
43   FileOutputBufferTest.cpp
44   FormatVariadicTest.cpp
45   FSUniqueIDTest.cpp
46   GlobPatternTest.cpp
47   HashBuilderTest.cpp
48   IndexedAccessorTest.cpp
49   InstructionCostTest.cpp
50   JSONTest.cpp
51   KnownBitsTest.cpp
52   LEB128Test.cpp
53   LineIteratorTest.cpp
54   LockFileManagerTest.cpp
55   MatchersTest.cpp
56   MD5Test.cpp
57   ManagedStatic.cpp
58   MathExtrasTest.cpp
59   MemoryBufferRefTest.cpp
60   MemoryBufferTest.cpp
61   MemoryTest.cpp
62   NativeFormatTests.cpp
63   OptimizedStructLayoutTest.cpp
64   ParallelTest.cpp
65   Path.cpp
66   PerThreadBumpPtrAllocatorTest.cpp
67   ProcessTest.cpp
68   ProgramTest.cpp
69   RegexTest.cpp
70   ReverseIterationTest.cpp
71   ReplaceFileTest.cpp
72   RISCVAttributeParserTest.cpp
73   RISCVISAInfoTest.cpp
74   ScaledNumberTest.cpp
75   ScopedPrinterTest.cpp
76   SHA256.cpp
77   SignalsTest.cpp
78   SourceMgrTest.cpp
79   SpecialCaseListTest.cpp
80   SuffixTreeTest.cpp
81   SwapByteOrderTest.cpp
82   TarWriterTest.cpp
83   ThreadPool.cpp
84   ThreadSafeAllocatorTest.cpp
85   Threading.cpp
86   TimerTest.cpp
87   TimeProfilerTest.cpp
88   ToolOutputFileTest.cpp
89   TypeNameTest.cpp
90   TypeSizeTest.cpp
91   TypeTraitsTest.cpp
92   TrailingObjectsTest.cpp
93   UnicodeTest.cpp
94   UTCTimeTest.cpp
95   VersionTupleTest.cpp
96   VirtualFileSystemTest.cpp
97   WithColorTest.cpp
98   YAMLIOTest.cpp
99   YAMLParserTest.cpp
100   buffer_ostream_test.cpp
101   formatted_raw_ostream_test.cpp
102   raw_fd_stream_test.cpp
103   raw_ostream_test.cpp
104   raw_pwrite_stream_test.cpp
105   raw_sha1_ostream_test.cpp
106   xxhashTest.cpp
108   DEPENDS
109   intrinsics_gen
110   )
112 target_link_libraries(SupportTests PRIVATE LLVMTestingSupport)
114 # Disable all warning for AlignOfTest.cpp,
115 # as it does things intentionally, and there is no reliable way of
116 # disabling all warnings for all the compilers by using pragmas.
117 # Don't disable on MSVC, because all incriminated warnings are already disabled
118 # in source; and because we would otherwise see this warning:
119 #   cl : Command line warning D9025: overriding '/W4' with '/w'
120 if(NOT MSVC)
121   set_source_files_properties(AlignOfTest.cpp PROPERTIES COMPILE_FLAGS -w)
122 endif()
123 if(MSVC)
124   if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.14 )
125     # Since VS2017 15.8, the following snippet: Failed<CustomSubError>()
126     # generates a warning:
127     # \svn\llvm\utils\unittest\googlemock\include\gmock\gmock-matchers.h(186):
128     #   warning C5046: 'testing::MatcherInterface<T>::~MatcherInterface': Symbol involving type with internal linkage not defined
129     set_source_files_properties(ErrorTest.cpp PROPERTIES COMPILE_FLAGS -wd5046)
130   endif()
131 endif()
133 # ManagedStatic.cpp uses <pthread>.
134 target_link_libraries(SupportTests PRIVATE LLVMTestingSupport ${LLVM_PTHREAD_LIB})
136 if(NOT LLVM_INTEGRATED_CRT_ALLOC)
137   # The test doesn't pass when using a custom allocator, PR47881.
138   add_subdirectory(DynamicLibrary)
139 endif()
141 add_subdirectory(CommandLineInit)