Fix test failures introduced by PR #113697 (#116941)
[llvm-project.git] / llvm / unittests / CMakeLists.txt
blob8892f3e75729ab3d92de7a17f1630afdcf38dea2
1 add_custom_target(UnitTests)
2 set_target_properties(UnitTests PROPERTIES FOLDER "LLVM/Tests")
4 function(add_llvm_unittest test_dirname)
5   add_unittest(UnitTests ${test_dirname} ${ARGN})
6 endfunction()
7 function(add_llvm_unittest_with_input_files test_dirname)
8   add_unittest_with_input_files(UnitTests ${test_dirname} ${ARGN})
9 endfunction()
11 # The target unittests may test APIs that aren't exported in libLLVM.so, so
12 # we need to always link against the static libraries.
13 function(add_llvm_target_unittest test_dir_name)
14   add_llvm_unittest(${test_dir_name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
15 endfunction()
17 # gtest macros like EXPECT_TRUE are expanded to a single line
18 # multi-statement code with if/else. eg:
19 #   if (...)
20 #     EXPECT_TURE(...)
21 # will be expanded into something like:
22 #   if(...)
23 #     switch (0) case 0: default: if (...) ; else return;;
24 # GCC may emit false positive dangling-else warnings for such code.
25 # However, such warnings are actually against LLVM's style guide.
26 # disable the warning for GCC so that one can enbable Werror.
27 if (CMAKE_COMPILER_IS_GNUCXX)
28   list(APPEND LLVM_COMPILE_FLAGS "-Wno-dangling-else")
29 endif ()
31 add_subdirectory(ADT)
32 add_subdirectory(Analysis)
33 add_subdirectory(AsmParser)
34 add_subdirectory(BinaryFormat)
35 add_subdirectory(Bitcode)
36 add_subdirectory(Bitstream)
37 add_subdirectory(CGData)
38 add_subdirectory(CodeGen)
39 add_subdirectory(DebugInfo)
40 add_subdirectory(Debuginfod)
41 add_subdirectory(Demangle)
42 add_subdirectory(DWARFLinkerParallel)
43 add_subdirectory(ExecutionEngine)
44 add_subdirectory(FileCheck)
45 add_subdirectory(Frontend)
46 add_subdirectory(FuzzMutate)
47 add_subdirectory(InterfaceStub)
48 add_subdirectory(IR)
49 add_subdirectory(LineEditor)
50 add_subdirectory(Linker)
51 add_subdirectory(MC)
52 add_subdirectory(MI)
53 add_subdirectory(MIR)
54 add_subdirectory(ObjCopy)
55 add_subdirectory(Object)
56 add_subdirectory(ObjectYAML)
57 add_subdirectory(Option)
58 add_subdirectory(Remarks)
59 add_subdirectory(Passes)
60 add_subdirectory(ProfileData)
61 add_subdirectory(SandboxIR)
62 add_subdirectory(Support)
63 add_subdirectory(TableGen)
64 add_subdirectory(Target)
65 add_subdirectory(TargetParser)
66 add_subdirectory(Testing)
67 add_subdirectory(TextAPI)
68 add_subdirectory(Transforms)
69 add_subdirectory(XRay)
70 add_subdirectory(tools)